diff options
author | Benjamin Otte <otte@redhat.com> | 2015-06-26 21:08:04 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-06-26 21:12:50 +0200 |
commit | cd3f24d5793e038ee29d780b24747707c73ad00c (patch) | |
tree | 4e06de6da08db1f87e31219dcb4ea4e547cb1f35 /testsuite | |
parent | 142abce46a18ef09ca77ed581cf3b385671c9515 (diff) | |
download | gtk+-cd3f24d5793e038ee29d780b24747707c73ad00c.tar.gz |
cssvalue: Change color transitions to run premultiplied
Previously, the unpremultiplied values from the GdkRGBA were taken. Now
we premultiply the color values as specified by the CSS specs.
This is only relevant when transitioning with translucent colors.
An example is the halfway transition between transparent (0, 0, 0, 0)
and white (1, 1, 1, 1). Previously, all 4 values where transitioned
separately and the result was semi-transparent gray (0.5, 0.5, 0.5,
0.5).
By depending on the alpha value, the result is now semi-transparent
white (1, 1, 1, 0.5) which is what one would naively expect.
New reftest: color-transition
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/reftests/Makefile.am | 3 | ||||
-rw-r--r-- | testsuite/reftests/color-transition.css | 18 | ||||
-rw-r--r-- | testsuite/reftests/color-transition.ref.ui | 8 | ||||
-rw-r--r-- | testsuite/reftests/color-transition.ui | 25 |
4 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/reftests/Makefile.am b/testsuite/reftests/Makefile.am index 61cc0a233a..3887acc95e 100644 --- a/testsuite/reftests/Makefile.am +++ b/testsuite/reftests/Makefile.am @@ -185,6 +185,9 @@ testdata = \ cellrenderer-pixbuf-stock-rtl.css \ cellrenderer-pixbuf-stock-rtl.ui \ cellrenderer-pixbuf-stock-rtl.ref.ui \ + color-transition.css \ + color-transition.ref.ui \ + color-transition.ui \ css-currentcolor-alpha.css \ css-currentcolor-alpha.ui \ css-currentcolor-alpha.ref.ui \ diff --git a/testsuite/reftests/color-transition.css b/testsuite/reftests/color-transition.css new file mode 100644 index 0000000000..ac964b00b6 --- /dev/null +++ b/testsuite/reftests/color-transition.css @@ -0,0 +1,18 @@ +@import "reset-to-defaults.css"; + +@keyframes foo { + 100% { background-color: blue; } +} + +GtkWindow { + background-color: #7F0080; +} + +GtkBox { + background-color: red; +} + +GtkBox GtkBox { + background-color: transparent; + animation: foo 100s steps(2); +} diff --git a/testsuite/reftests/color-transition.ref.ui b/testsuite/reftests/color-transition.ref.ui new file mode 100644 index 0000000000..fa28350906 --- /dev/null +++ b/testsuite/reftests/color-transition.ref.ui @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkWindow" id="window1"> + <property name="can_focus">False</property> + <property name="type">popup</property> + </object> +</interface> diff --git a/testsuite/reftests/color-transition.ui b/testsuite/reftests/color-transition.ui new file mode 100644 index 0000000000..47e01cb600 --- /dev/null +++ b/testsuite/reftests/color-transition.ui @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkWindow" id="window1"> + <property name="can_focus">False</property> + <property name="type">popup</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + </object> + </child> + </object> + </child> + </object> +</interface> |