css: An opaque background does not allow omitting push_group
When the background-clip of the background is smaller than the background-clip of blended images, not pushing a group is wrong. Test testing exactly that included.
This commit is contained in:
@ -75,18 +75,9 @@ _gtk_theming_background_paint_color (GtkThemingBackground *bg,
|
|||||||
static gboolean
|
static gboolean
|
||||||
_gtk_theming_background_needs_push_group (GtkCssStyle *style)
|
_gtk_theming_background_needs_push_group (GtkCssStyle *style)
|
||||||
{
|
{
|
||||||
const GdkRGBA *bg_color;
|
|
||||||
GtkCssValue *background_color;
|
|
||||||
GtkCssValue *blend_modes;
|
GtkCssValue *blend_modes;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
background_color = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_COLOR);
|
|
||||||
bg_color = _gtk_css_rgba_value_get_rgba (background_color);
|
|
||||||
|
|
||||||
/* An opaque background-color means we don't need to push the group */
|
|
||||||
if (bg_color->alpha == 1)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
blend_modes = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_BLEND_MODE);
|
blend_modes = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_BLEND_MODE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -89,6 +89,9 @@ testdata = \
|
|||||||
background-area.css \
|
background-area.css \
|
||||||
background-area.ref.ui \
|
background-area.ref.ui \
|
||||||
background-area.ui \
|
background-area.ui \
|
||||||
|
background-blend-mode-clip-interaction.css \
|
||||||
|
background-blend-mode-clip-interaction.ref.ui \
|
||||||
|
background-blend-mode-clip-interaction.ui \
|
||||||
background-color-transparent.css \
|
background-color-transparent.css \
|
||||||
background-color-transparent.ref.ui \
|
background-color-transparent.ref.ui \
|
||||||
background-color-transparent.ui \
|
background-color-transparent.ui \
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
* {all: unset; }
|
||||||
|
|
||||||
|
window {
|
||||||
|
background: lime;
|
||||||
|
}
|
||||||
|
|
||||||
|
box {
|
||||||
|
background-color: red;
|
||||||
|
background-image: linear-gradient(yellow, yellow), linear-gradient(white, white);
|
||||||
|
background-clip: border-box, content-box;
|
||||||
|
background-size: 50% 100%, 100% 50%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-blend-mode: multiply;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#reference box {
|
||||||
|
background-image: linear-gradient(red,red), linear-gradient(yellow, yellow);
|
||||||
|
background-clip: content-box, border-box;
|
||||||
|
background-size: 100% 100%, 50% 100%;
|
||||||
|
background-color: transparent;
|
||||||
|
background-blend-mode: normal;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<!-- interface-requires gtk+ 3.0 -->
|
||||||
|
<object class="GtkWindow" id="window1">
|
||||||
|
<property name="width_request">50</property>
|
||||||
|
<property name="height_request">50</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="type">popup</property>
|
||||||
|
<property name="name">reference</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
16
testsuite/reftests/background-blend-mode-clip-interaction.ui
Normal file
16
testsuite/reftests/background-blend-mode-clip-interaction.ui
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<!-- interface-requires gtk+ 3.0 -->
|
||||||
|
<object class="GtkWindow" id="window1">
|
||||||
|
<property name="width_request">50</property>
|
||||||
|
<property name="height_request">50</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="type">popup</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
Reference in New Issue
Block a user