Commit e04654f8 authored by Benjamin Otte's avatar Benjamin Otte

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.
parent a8991a6b
......@@ -75,18 +75,9 @@ _gtk_theming_background_paint_color (GtkThemingBackground *bg,
static gboolean
_gtk_theming_background_needs_push_group (GtkCssStyle *style)
{
const GdkRGBA *bg_color;
GtkCssValue *background_color;
GtkCssValue *blend_modes;
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);
/*
......
......@@ -89,6 +89,9 @@ testdata = \
background-area.css \
background-area.ref.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.ref.ui \
background-color-transparent.ui \
......
* {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;
}
<?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>
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment