Commit Graph

1907 Commits

Author SHA1 Message Date
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
Matthias Clasen
fe515c4c1c testsuite: Link some tests statically
Link tests for private apis statically.
2021-01-23 10:34:57 -05:00
Matthias Clasen
131a61c51b testsuite: Fix a leak
asan pointed out that the array tests leak.
2021-01-22 11:50:04 -05:00
Matthias Clasen
e808fb424a testsuite: Stop requiring diff
Unify the many copies of diff_with_file in one source
file, and patch it to detect diff at runtime and fall
back to a simple strcmp if we don't have it. Make all
tests use this new testutils.c, and stop requiring
diff for building the tests.

This should let us allow to build on Windows with the
default value for -Dbuild-tests.
2021-01-21 23:57:24 -05:00
Matthias Clasen
ee43a6a603 Bump version to 4.1
master is now open for 4.2 API additions.

Includes an update for the one test we have that
has the version number in its expected output.
2021-01-18 23:09:44 -05:00
Matthias Clasen
bbfaacb598 Add a reftest for box flipping
Test that a horizontal box changes the order of its
children in RTL, and that widget margins flip start
and end.

This tests the fix in d89ff71819.
2021-01-15 18:43:31 -05:00
Matthias Clasen
8243b5493b a11y: Avoid __ prefixes for variable names
Seems that msvc does not like that.
2021-01-08 22:24:42 -05:00
Matthias Clasen
ca9801f5fb 3to4: Remove GtkToolbar::toolbar_style
The property was removed (with the rest of the widget),
so keeping it around in the ui file makes no sense.

Testcase included.
2021-01-05 13:58:58 -05:00
Matthias Clasen
7e579bb59a Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2997
2020-12-24 07:13:22 +00:00
Benjamin Otte
96e1b85c2c gdkarray: Add a "stolen" boolean to splice()
If set to TRUE, does not call the free func for the removed items.

This can be used to move items between arrays without having to do the
refcounting dance.
2020-12-24 06:38:45 +01:00
Benjamin Otte
dee863dbb2 rendernode: Bail if matrix is invalid
Invalid matrices are okay in GSK (and GL), but not in Cairo.

Testcase included.
2020-12-24 06:38:45 +01:00
Matthias Clasen
aa95ae774f gsk: Fix serialization of glyphs
We were forgetting to put a space between two numbers
in some cases, confusing the parser.

Test included.

Fixes: #3496
2020-12-21 10:49:56 -05:00
Emmanuele Bassi
f2b16836c2 3to4: Add test for GtkCheckButton:draw-indicator removal 2020-12-19 15:52:22 +00:00
Matthias Clasen
9c5a42be0d Update expected test results
We have one test that expected 3.99 to show up in an error message.
2020-12-16 12:12:58 -05:00