Commit Graph

1920 Commits

Author SHA1 Message Date
Matthias Clasen
68d634b31c Disable the border-image-url reftest
It seems to make assumptions about text positioning that
are not holding with subpixel positioning. I'm not 100%
sure how that leads to exactly the artifacts that are seen
here, but I am just disabling the test until that is fully
understood.
2021-03-30 11:00:54 -04:00
Matthias Clasen
d1c66f75e3 Disable flaky focus tests 2021-03-30 11:00:54 -04:00
Matthias Clasen
eba9cd8775 Disable the label-background reftest
It makes assumptions about text positioning that are
not holding with subpixel positioning. There is no
guarantee that the next word in a multi-word text
starts on an even pixel boundary, as it does when
you break the text into multiple, separately rendered
blocks.
2021-03-30 11:00:54 -04:00
Matthias Clasen
9606945ed8 Fix tests for new version 2021-03-30 11:00:54 -04:00
Matthias Clasen
146069058f Add some tests for node diffing
Nothing deep yet, but more can be added.
2021-03-28 10:45:40 -04:00
Matthias Clasen
db126a19b6 Plug a test memleak 2021-03-27 21:52:49 -04:00
Matthias Clasen
d24a0e9606 tests: Plug a memory leak 2021-03-27 21:13:25 -04:00
Matthias Clasen
b8693cc4f4 tests: Make the pixbuf test use TAP
Otherwise, meson just considers this test skipped.
2021-03-27 21:03:43 -04:00
Matthias Clasen
dda69bd16d tests: Plug memory leaks
This one was pointed out by asan.
2021-03-27 21:03:43 -04:00
Matthias Clasen
7aef77a21a reftests: Plug a few memory leaks
Noticed in passing.
2021-03-27 16:25:28 -04:00
Matthias Clasen
01f4e5c8cd Add some more compose tests
These tests changes to the algorithmic dead key
matching.
2021-03-26 20:38:45 -04:00
Matthias Clasen
50d42093b5 Make testsuite fail if we lack pixbuf loaders
Add a test that requires that we have png and jpeg
loaders.
2021-03-25 21:23:11 -04:00
Jason Francis
cd77485193
gtk: Allow selection models to take null list model during construction
This brings it in line with the documentation, and with the respective
set_model() functions.
2021-03-15 15:55:47 -04:00
Matthias Clasen
124f60593b nodeparser: Print debug message before child
This puts the message up top, where it can be seen,
and not at the other end of an endless tree of children.

Update tests to match.
2021-03-09 12:15:25 -05:00
Matthias Clasen
5d30569575 Add some more rounded rect tests 2021-03-07 21:28:19 -05:00
Matthias Clasen
875a92b95f label: Fix markup parsing interactions
We were not handling mnemonics vs markup right
in all cases. Rewrite the _-stripping code to
do it during the link parsing, instead of as
a separate function. This avoids the issue of
stripping _ from attribute names in markup.

Add tests.

Fixes: 3706
2021-03-02 23:25:01 -05:00
Christian Hergert
2a38cecd33 gsk: add OpenGL based GskNglRenderer
The primary goal here was to cleanup the current GL renderer to make
maintenance easier going forward. Furthermore, it tracks state to allow
us to implement more advanced renderer features going forward.

Reordering

This renderer will reorder batches by render target to reduce the number
of times render targets are changed.

In the future, we could also reorder by program within the render target
if we can determine that vertices do not overlap.

Uniform Snapshots

To allow for reordering of batches all uniforms need to be tracked for
the programs. This allows us to create the full uniform state when the
batch has been moved into a new position.

Some care was taken as it can be performance sensitive.

Attachment Snapshots

Similar to uniform snapshots, we need to know all of the texture
attachments so that we can rebind them when necessary.

Render Jobs

To help isolate the process of creating GL commands from the renderer
abstraction a render job abstraction was added. This could be extended
in the future if we decided to do tiling.

Command Queue

Render jobs create batches using the command queue. The command queue
will snapshot uniform and attachment state so that it can reorder
batches right before executing them.

Currently, the only reordering done is to ensure that we only visit
each render target once. We could extend this by tracking vertices,
attachments, and others.

This code currently uses an inline array helper to reduce overhead
from GArray which was showing up on profiles. It could be changed to
use GdkArray without too much work, but had roughly double the
instructions. Cycle counts have not yet been determined.

GLSL Programs

This was simplified to use XMACROS so that we can just extend one file
(gskglprograms.defs) instead of multiple places. The programs are added
as fields in the driver for easy access.

Driver

The driver manages textures, render targets, access to atlases,
programs, and more. There is one driver per display, by using the
shared GL context.

Some work could be done here to batch uploads so that we make fewer
calls to upload when sending icon theme data to the GPU. We'd need
to keep a copy of the atlas data for such purposes.
2021-02-23 14:41:52 -08:00
Matthias Clasen
189e0c05fd Merge branch 'wip/smcv/reftest-dedup' into 'master'
Reduce duplication in reftests

See merge request GNOME/gtk!3203
2021-02-17 03:55:45 +00:00
Simon McVittie
1c6cf7a3b6 reftests: Share reftest-compare.[ch] between GSK and GTK tests
The only non-whitespace difference is that the copy in GSK does not
set the symbol's visibility.

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-02-15 09:22:41 +00:00
Simon McVittie
6b29eeeb1c reftest-compare: Fix spelling of "diff"
This is the only non-whitespace difference between the copies in
testsuite/reftests/ and testsuite/gsk/.

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-02-15 09:22:41 +00:00
Matthias Clasen
f15aa2f3e5 imcontext: Fix a regression in Compose file parsing
We accidentally dropped the handing of # comments.
Bring it back. Test included.

Fixes: #3664
2021-02-14 11:56:24 -05:00
Matthias Clasen
5d6792137d testsuite: Add a missing file 2021-02-14 11:56:24 -05:00
Emmanuele Bassi
b74a9445af tests: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:23 +00:00
Matthias Clasen
dff2aa20ff gl: Fixed clipped offscreen rendering
When we are rendering a texture node to an offscreen,
and we have a clip, we must force the offscreen rendering.
Otherwise, the code will notice: Hey, it already is a texture
node, so no need to render it to a texture again. But when
clipping is involved, that is exactly what we want to do.

Testcase included.

Fixes: #3651
2021-02-09 22:43:15 -05:00
Matthias Clasen
bfc80c32ea Add tests for the css filter property
Test that we can parse filters and that we
don't accept invalid filters.
2021-02-06 16:16:44 -05:00
Matthias Clasen
5f48764ac8 cssfiltervalue: Reject invalid filters
The Filter Effects Spec doesn't allow negative values
for most of the filter parameters.
2021-02-06 16:16:44 -05:00
Matthias Clasen
a1f7073ff5 Add tests for the css filter property
Test that we can parse filters.
2021-02-05 21:37:47 -05:00
Matthias Clasen
d5838f14f9 Drop the installed test for now
It fails in ci, and I have no idea why.
2021-02-04 07:26:10 -05:00
Matthias Clasen
18e83fe16d Add more css transition tests 2021-02-03 22:10:13 -05:00
Matthias Clasen
90d7ed5dd1 Rename test to transition
Thats what it is about, so name it clearly.

Add missing installed tests too.
2021-02-03 22:10:13 -05:00
Matthias Clasen
3c6e7569ff Add more css transition tests
Test font size transitions.
2021-02-03 22:10:13 -05:00
Matthias Clasen
4e2ec2d68d testsuite: Pass GDK_DEBUG=default-settings to css tests
Otherwise, settings might creep in and change css defaults.
2021-02-03 22:10:13 -05:00
Matthias Clasen
640273a0e2 Improve the css value tests
The test code had some bugs. Fix those, and
print out useful information when tests fail.
2021-02-03 22:10:13 -05:00
Matthias Clasen
a14a0c6315 css: Fix shadow value equal
This function was not doing the right thing.

Once we are doing the right thing and not compare
shadows as unequal, some reftests that inhibit
snapshots for a few frames now hang forever, since
we are no more redrawing unnecessarily. Fix that
with an explicit queue_draw.
2021-02-03 22:10:13 -05:00
Matthias Clasen
7a9bc1f1d8 Link the data url tests statically
Thats the cleaner way to test internal apis.
2021-02-03 09:02:06 -05:00
Matthias Clasen
9cc6f3ee29 Add tests for css value transitions
Just a few cases for now, enough to test a recently
fixed regression with shadow transitions.
2021-02-03 08:56:57 -05:00
Matthias Clasen
949c783187 composetable: Parse hex escapes too
This was a small omission from the Compose file
syntax that doesn't cost us much to support.

Add a test for this syntax too.

Fixes: #1004
2021-02-02 12:05:19 -05:00
Matthias Clasen
814a4a781a Add tests for string values
Add a test that checks we parse values with
multiple characters correctly.
2021-02-02 11:55:00 -05:00
Matthias Clasen
9142aa0f51 composetable: Prepare for multi character values
Make it possible for gtk_compose_table_check to return
a string instead of just a single Unicode character.
Currently, we only ever return strings holding a single
character, still.
2021-02-02 09:02:00 -05:00
Matthias Clasen
ecb072fdd0 composetable: Check algorithmic matching
Just some spot checks, enough to verify the
fix in the previous commit.
2021-02-01 21:59:21 -05:00
Matthias Clasen
8d18d93742 composetable: Add tests for compact table matching
Not very exhaustive, just some spot checks.
2021-02-01 21:10:44 -05:00
Matthias Clasen
c9cac5fbc3 composetable: Add tests for matching
This tests the api we use to match key sequences
against compose tables.
2021-02-01 19:55:56 -05:00
Matthias Clasen
569294070b Add tests for GtkComposeTable
Add some tests for the code that parses Compose files.

This tests the fix in the previous commit.
2021-02-01 19:02:31 -05:00
Matthias Clasen
ec8db379a6 tests: Disable the textview-margins reftest
It is too flaky to be useful.
2021-01-30 19:57:24 -05:00
Matthias Clasen
456a2f3bcf Merge branch 'msvc.nounistd' into 'master'
testsuite/testutils.c: Fix build on Visual Studio

See merge request GNOME/gtk!3131
2021-01-29 20:16:13 +00:00
Chun-wei Fan
d8e8b3c235 testsuite/testutils.c: Fix build on Visual Studio
Visual Studio does not come with unistd.h, but Windows do have write() and
close() in io.h, so include io.h instead of unistd.h on Windows.

For MinGW, unistd.h in turn includes io.h.
2021-01-29 17:59:10 +08:00
Timm Bäder
79f273348d gl renderer: Fix viewport computation when rendering offscreen
Fixes #3615
2021-01-29 10:37:48 +01:00
Matthias Clasen
06321511ad builder-tool: Translate GtkImage:pixbuf
The pixbuf property doesn't exist anymore. It is
commonly set to a path in ui files, so translate it
to the file property.
2021-01-27 17:01:51 -05:00
Matthias Clasen
1258fcaaf4 css: Fix text-decoration-line support
This property needs to be treated as flags, not as
enum, since it should be possible to specify more
than one value, e.g.

text-decoration-line: underline overline;

Tests included.

Fixes: #3621
2021-01-26 17:53:14 -05:00
Matthias Clasen
749f1a7c00 Add a reftest for transform-origin 2021-01-24 23:47:10 -05:00