mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
reftests: Add a bunch of linear gradient tests
This commit is contained in:
parent
2e901752b1
commit
d56ac0d4df
35
tests/reftests/linear-gradient.css
Normal file
35
tests/reftests/linear-gradient.css
Normal file
@ -0,0 +1,35 @@
|
||||
@import url("reset-to-defaults.css");
|
||||
|
||||
/* One caveat that apply to cairo gradients, and make things therefor
|
||||
* untestable:
|
||||
* The start and end points must be identical when drawing
|
||||
* This means that you cannot:
|
||||
* ... add extra color stops, even if they'd be invisible
|
||||
* ... mirror the gradient (ie 'to left, red, green' vs 'to right, green, red')
|
||||
* and probably a bunch of other things.
|
||||
* These things can cause off-by-one rounding errors in pixman (and probably
|
||||
* your GPU, too) and that'd trigger test failures.
|
||||
*/
|
||||
#a {
|
||||
background-image: linear-gradient(to bottom, blue 0%, green 15px, red 100%);
|
||||
}
|
||||
|
||||
#reference #a {
|
||||
background-image: linear-gradient(blue, green, red);
|
||||
}
|
||||
|
||||
#b {
|
||||
background-image: linear-gradient(to left, pink 0, cyan, red 0, green 50%, blue 40px, violet -10em);
|
||||
}
|
||||
|
||||
#reference #b {
|
||||
background-image: linear-gradient(270deg, red, green, blue);
|
||||
}
|
||||
|
||||
#c {
|
||||
background-image: repeating-linear-gradient(3.5turn, red, green 10px, red 20px);
|
||||
}
|
||||
|
||||
#reference #c {
|
||||
background-image: linear-gradient(to bottom, red, green 10px, red 20px, green 30px, red 40px);
|
||||
}
|
67
tests/reftests/linear-gradient.ref.ui
Normal file
67
tests/reftests/linear-gradient.ref.ui
Normal file
@ -0,0 +1,67 @@
|
||||
<?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>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="name">reference</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="name">a</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="name">b</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button3">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="name">c</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
66
tests/reftests/linear-gradient.ui
Normal file
66
tests/reftests/linear-gradient.ui
Normal file
@ -0,0 +1,66 @@
|
||||
<?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>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="name">a</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="name">b</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button3">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="name">c</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
Loading…
Reference in New Issue
Block a user