Commit Graph

121 Commits

Author SHA1 Message Date
Timm Bäder
262ac4247a testsuite: Add a testcase for blend nodes with invisible children 2020-01-07 17:27:19 +01:00
Timm Bäder
1dd31d58fb testsuite: Add a test case for rotated border node 2020-01-07 17:27:17 +01:00
Timm Bäder
ac1497eb2d testsuite: Add an inset shadow rendering test case 2019-12-03 08:40:35 +01:00
Timm Bäder
4f532224e0 testsuite: Add another repeat node test case 2019-11-26 09:09:25 +01:00
Timm Bäder
39a48de025 testsuite: Add a testcase for repeat nodes that don't repeat 2019-11-19 10:45:35 +01:00
Timm Bäder
0415574acf testsuite: Add another repeat node test case 2019-08-11 09:05:31 +02:00
Timm Bäder
4c70bf6c9c testsuite: Add a repeat node test case 2019-08-11 09:05:31 +02:00
Matthias Clasen
3fccb16ca6 gsk: Move text-related test out of ci
These are too sensitive to rendering differences
between renderers to run reliably in ci, but we
still want to keep them around. In particular,
the big glyph tests are useful to exercise the
GL glyph cache.
2019-07-28 09:35:37 -04:00
Matthias Clasen
fd7f6ca7ad tests: improve error handling 2019-07-25 13:51:34 -04:00
Timm Bäder
b9b5072668 gl renderer: Fix opacity nodes with overlapping child nodes 2019-07-14 10:08:04 +02:00
Timm Bäder
042f7d117f compare-render: Don't unref an invalid GFile
We already unref it when the g_file_make_directory_with_parents fails.
2019-07-07 07:24:00 +02:00
Benjamin Otte
062244ab71 testsuite: Make creating the output dir not racy
Fixes #1942
2019-06-09 23:17:10 +02:00
Benjamin Otte
24effe45cc testsuite: Add tests for printing/parsing transforms 2019-06-03 19:12:03 +02:00
Matthias Clasen
2f7047147d gsk: Add some more transform tests
Tests around identity. Seems trivial, but
still managed to find a bug.
2019-06-03 16:20:38 +00:00
Matthias Clasen
0ab4a232b7 Move transform tests to the gsk suite
That is where they belong.
2019-06-03 16:10:09 +00:00
Timm Bäder
05ca772631 GskTransform: Ignore identity transforms
We often end up with e.g. a scale of 1 or a translation by 0/0. Ignore
those transforms since they don't do anything.
2019-06-03 17:03:02 +02:00
Matthias Clasen
3788e1dea7 testsuite: Pass --output for gsk tests
We want to keep the output from ci runs.
So we now write the .out.png and .diff.png
files to build/testsuite/gsk/compare/$RENDERER.
2019-06-03 02:09:04 +00:00
Matthias Clasen
e0bf301d34 gsk tests: Add an --output option
This will be used to save artifacts in ci.
2019-06-03 02:09:04 +00:00
Matthias Clasen
c7387a8e7f gsk: Test huge glyphs
These don't fit in the glyph cache.
2019-06-03 02:08:36 +00:00
Matthias Clasen
1c1d4f32c8 gsk: Test big glyphs
These are big, but still fit in the glyph cache.
Therefore, the test succeeds.
2019-06-03 02:08:36 +00:00
Benjamin Otte
7e9cb07a92 Merge branch 'for-master' into 'master'
For master

See merge request GNOME/gtk!903
2019-06-03 00:22:40 +00:00
Benjamin Otte
5a0c8805fc transform: Coalesce similar transforms
If somebody does a transform like
  scale(5) scale(10) translate(1,1) translate(5,0)
store it instead as
  scale(50) translate(6,1)
This way, less memory is consumed and transforms are easier to read.

In particular, this simplifies the typical transforms we do in GTK,
which are just one translation after another.
2019-06-02 21:18:56 +02:00
Timm Bäder
db548ee2a0 gl renderer: Fix scale computation
We don't need to just look at the scale of the new modelview matrix, but
at the one we get when multiplying the new one with the current one.

Test case attached.
2019-06-02 10:25:39 +02:00
Timm Bäder
f1996783ec gl renderer: Fix rounded rect intersection code
Test case attached.

Fixes #1920
2019-06-02 08:31:44 +02:00
Benjamin Otte
53f23f8ae9 rendernodeparser: Handle empty Cairo nodes
Cairo nodes can contain a NULL surface if they have never been drawn to.
Make this the default Cairo node.
2019-05-30 15:32:36 +02:00
Benjamin Otte
1e0c0c0ba7 rendernodeparser: Parse cairo script
Use cairo-script-interpreter to parse the scripts that generate cairo
nodes.

This requires libcairoscriptinterpreter.so to work properly, but if
it isn't found we disable this (unimportant for normal functioning)
code and just emits a parser warning.
The testsuite requires it however or it will fail.

A new test is included that tests all of this.
2019-05-30 15:32:36 +02:00
Benjamin Otte
928c85ccc3 rendernodeparser: Parse Cairo nodes
We also print the script, but we don't parse it yet.
2019-05-26 00:50:13 +02:00
Krzesimir Nowak
49d994ddc2 testsuite: Fix leak 2019-05-21 19:23:00 +02:00
Benjamin Otte
63a8144e1a testsuite: Remove serialize-deserialize test
The serialize-deserialize test is completely handled via the new
nodeparser tests.

So move those tests over and delete the old test binary.
2019-05-21 06:43:59 +02:00
Benjamin Otte
0a32305f01 testsuite: Add render tests for all the empty nodes
Test that rendering empty nodes succees. For a lot of nodes the
resulting rendering isn't clearly defined, in those cases we overdraw
those regions (sometimes the whole image) with black.
2019-05-21 06:43:59 +02:00
Benjamin Otte
eb386134e3 testuite: Improve compare-render binary
- Remove remains of g_test_*() functions
  We're not a glib test, we're a simple binary.
- Handle nonexistence of reference image properly
  Don't assert, but create the output image and the error out.
2019-05-21 06:43:59 +02:00
Benjamin Otte
b37c2216fc testsuite: Add empty node tests
For every node type, add a test that creates it empty and ensure that
it prints the reference output.
2019-05-21 06:43:59 +02:00
Benjamin Otte
b90a66cab5 rendernodeparser: Allow parsing strings
Instead of only allowing for glyph indexes, allow ASCII characters as
replacements. So this glyph sequence
  glyphs: 65 8, 66 8, 67 8
Can be replaced by
  glyphs: "ABC"
provided that the glyph for "A", "B" and "C" are 65, 66 and 67
respectively and their advance is exactly 8.
x offset and y offset must always be 0 and every glyph must start a
cluster.
2019-05-21 06:43:59 +02:00
Benjamin Otte
1a65a6ce76 rendernodeparser: Update to new rules
Update to the docs outlined in #1887.

In particular, the changes do:

1. Require no property, have a working default for everything
2. Be clear about what gets printed and how.

Tests ahve been adapted to still pass.
2019-05-21 06:43:59 +02:00
Benjamin Otte
a1d08b4b52 rendernode: Take a graphene_point_t for the offset
... instead of 2 floats.
2019-05-21 06:43:59 +02:00
Benjamin Otte
0fd0be4f9a testsuite: Redo node-parser
Base the rewrite on testsuite/css/parser/test-css-parser - we now
require the node file to match a reference node and track the errors it
triggers.
We also no longer use gtester.
2019-05-21 06:43:59 +02:00
Benjamin Otte
ed0ecf0ff0 rendernodeparser: Allow single values instead of 4
This allows writing:
  colors: red;
instead of
  colors: red red red red;
to draw a red border.
2019-05-21 06:43:59 +02:00
Benjamin Otte
c8fc40e793 rendernodeparser: Print properties alphabetically
Because now we have a rule.

Also update some tests to the new order.
2019-05-21 06:43:59 +02:00
Timm Bäder
2979aea3ae testsuite: Add a color matrix test case
Color matrix nodes with an identity matrix and no offset should still
produce the expected image.
2019-05-18 13:47:59 +02:00
Benjamin Otte
63578d832a testsuite: Don't die on the first error
Continue running the test, just mark it as a failure.
2019-05-12 17:27:01 +02:00
Benjamin Otte
3a373b9b33 rendernodeparser: Parse images differently
Instead of encoding the raw data, encode the full image to a PNG.
And instead of stuffing that encoding into a string, use a full
data: url.
And then remove the width and height properties, because they're now
implicitly included in the data.
And then change the parser to match.
And because the parser now parses regular urls on top of data: urls, we
can now load any random file.
2019-05-12 17:27:01 +02:00
Timm Bäder
730b52b084 testsuite: Add blur node testcase
Renderers need to handle blur radius 0 as well. Currently broken in GL
and (I guess, unless it's my driver) Vulkan.
2019-05-07 17:21:16 +02:00
Timm Bäder
c8865459fc testsuite: Add blend-difference test case
Comparing blend nodes with mode: difference
2019-05-06 17:34:48 +02:00
Timm Bäder
8559593a18 testsuite: Add a blend node test case
This is currently broken in the GL renderer.
2019-05-06 17:34:48 +02:00
Benjamin Otte
43a5ff8e01 testsuite: Add serialize test for debug node 2019-05-05 07:18:39 +02:00
Benjamin Otte
da5b99f807 testsuite: Add rounded-rect parsing test 2019-05-05 07:18:39 +02:00
Benjamin Otte
b4f5baf4fa rendernode: Parse and print blend nodes properly 2019-05-05 07:18:39 +02:00
Timm Bäder
8c04129b94 testsuite: Add nodeparser test case
A serialized frame from the widget factory!
2019-05-05 07:18:39 +02:00
Timm Bäder
dde69802cd Add error func to node deserialization 2019-05-05 07:18:39 +02:00
Benjamin Otte
5530331b35 testsuite: Black out parts of reftest 2019-05-05 07:18:39 +02:00