Commit Graph

1962 Commits

Author SHA1 Message Date
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
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
Emmanuele Bassi
99e0929d6c build: Use a consistent style for Meson files 2020-12-15 12:46:59 +00:00
Matthias Clasen
a828d4318e Mark flaky tests as flaky
We can't mark these as xfail, since it sometimes succeed.
2020-12-08 18:10:02 -05:00
Matthias Clasen
2caf283323 Mark the window-show-contents-on-map.ui reftest as xfail
We know now what the test is trying to test, just lack
the right plumbing to do it properly. So, keep the test
around, marked as expected fail.
2020-12-08 12:04:47 -05:00
Matthias Clasen
6fb66e299a Revert "reftests: Remove window-show-contents-on-map.ui test"
This reverts commit 074b933ae4.
2020-12-08 11:45:52 -05:00
Jonas Ådahl
074b933ae4 reftests: Remove window-show-contents-on-map.ui test
It tested that a widget shown after the window was mapped deals with
window resizing appropriately when doing the follow-up allocation. Now,
doing this only allocates both at the same time, as allocation happens
during the frame dispatch.

To do the equivalent now, one would have to write code that shows the
label after the first frame was drawn, and that's not possible via a
reftest, so lets remove it.
2020-12-08 14:22:59 +01:00
Jonas Ådahl
7b7f3342d8 reftests/textview-tags: Hide text view cursor
Otherwise it'd sometimes show up, causing test flakyness.
2020-12-08 12:03:18 +01:00
Jonas Ådahl
130ff5f841 testsuite/notify: Don't fiddle with GtkWidget::visible
It may map toplevel windows with arbitrary modes, which will effect
other properties, such as GtkWindow::maximized and
GtkWindow::fullscreen.
2020-12-07 22:41:36 +01:00
Jonas Ådahl
fea1b151e6 testsuite/filtermodel: Remove calls to gtk_widget_realize()
They don't do what they used to do.
2020-12-07 22:29:51 +01:00
Jonas Ådahl
4083f7e47f testsuite: Remove test for gtk_window_resize()
And use gtk_window_set_default_size() in the other place.
2020-12-07 09:46:39 +01:00
Benjamin Otte
eb9c204535 gtk: Remove GtkFileChooserButton
... as discussed in the meeting.
2020-12-03 02:02:27 +01:00
Matthias Clasen
b75b359f19 Drop devel styling from our windows
We are about to do a stable release. Time to get used
again to plain old, boring header bars.
2020-11-23 12:10:01 -05:00
Benjamin Otte
1c7daece7a Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2855
2020-11-17 19:08:01 +00:00
Benjamin Otte
8fd1530848 testsuite: Make defaultvalue test always get the property
Make the test not skip properties completely, just skip checking the
property.

This caught the last 2 commits.
2020-11-17 19:04:39 +01:00
Matthias Clasen
121e61cf01 gsk: Avoid using gtk css types in public api
Using GtkCssSection in public headers here may be
ok from the C perspective, since it all ends up in
the same library anyway. But it causes circular
dependency problems for our gir files that are still
split by namespace.

To avoid this problem, copy the GtkCssLocation struct
struct as GskParseLocation, and pass take two of them
instead of a GtkCssSection in the error callback.

Update all users.

Fixes: #2454
2020-11-16 23:27:44 -05:00
Benjamin Otte
4b0b6100d6 build: Include GSK types in gtk_test_register_all_type() 2020-11-17 03:13:31 +01:00
Emmanuele Bassi
995daa1e29 a11y: GtkStack is a group of stack pages 2020-11-12 21:46:06 +00:00
Matthias Clasen
74a7f73239 Merge branch 'matthiasc/builder-requires' into 'master'
Matthiasc/builder requires

See merge request GNOME/gtk!2806
2020-11-11 03:53:52 +00:00
Matthias Clasen
d6a0948182 testsuite: Update buildertool tests
gtk-builder-tool simplify --3to4 now produces a
<requires lib="gtk" version="4.0"/>.
Adapt for that, and also add some tests that check that we
actually verify the requires, and accept 3.99 and 4.0, but
not 5.x.
2020-11-10 19:20:51 -05:00
Matthias Clasen
18779b9d67 testsuite: Remove <requires> from ui files
We don't need these here, the testsuite is shipped
with GTK.
2020-11-10 19:17:45 -05:00
Emmanuele Bassi
c264254d4b a11y: Parse reference lists using varargs
Using GList is a bit lame, and makes the API more complicated to use
than necessary in the common case.

The only real use case for a GList is gtk_widget_add_mnemonic_label(),
and for that we can use the GValue-based API instead.

Fixes: #3343
2020-11-10 14:31:56 +00:00
Emmanuele Bassi
0af6630521 a11y: Consolidate accessibility environment variables
Use a single environment variable for everything:

 - select the ATContext implementation
 - select the test ATContext
 - disable ATContext entirely

We use the same pattern as GSK_RENDERER, GTK_DEBUG, etc.

The documentation needs to be updated to include the environment
variable.
2020-11-09 16:21:49 +00:00
Arnaud Bonatti
f7de0bc9c8 Fix tests with regard to GtkBuilder <requires>. 2020-11-07 16:17:36 +01:00
Matthias Clasen
13d1e497f7 testsuite: Improve GdkCursor coverage 2020-11-04 23:36:09 -05:00
Matthias Clasen
403a70ca89 testsuite: Add tests for gtk4-builder-tool validate 2020-11-01 23:09:26 -05:00
Matthias Clasen
4bd829e3e1 testsuite: Test GtkFixed rewriting 2020-11-01 23:09:26 -05:00
Matthias Clasen
c3f8010b19 testsuite: Test GtkToolbar rewriting 2020-11-01 21:23:35 -05:00
Matthias Clasen
c01f3be6e6 testsuite: Test GtkActionBar rewriting 2020-11-01 21:23:35 -05:00
Matthias Clasen
0cf372c814 testsuite: Test GtkPaned rewriting 2020-11-01 21:23:35 -05:00
Matthias Clasen
b79637ac41 testsuite: Test GtkOverlay rewriting 2020-11-01 21:23:35 -05:00
Matthias Clasen
5702b71037 Remove leftover file
This was never used in tests.
2020-11-01 21:23:35 -05:00
Matthias Clasen
a4e5f5ca50 testsuite: More gtk4-builder-tool tests 2020-11-01 21:23:35 -05:00
Matthias Clasen
b0b00d49d2 testsuite: Test gtk4-builder-tool simplify --replace
Run all gtk4-builder-tool test with and without --replace.
This improves test coverage for gtk4-builder-tool
2020-11-01 21:23:35 -05:00
Matthias Clasen
168b21c77e testsuite: Improve coverage for GdkTexture 2020-11-01 21:23:35 -05:00
Matthias Clasen
2dcc641d5a testsuite: Improve coverage for GdkDisplayManager 2020-11-01 21:23:35 -05:00
Matthias Clasen
c8432ae668 testsuite: Improve coverage for seats 2020-11-01 21:23:35 -05:00
Matthias Clasen
642ad4e06f testsuite: Improve coverage for rectangles 2020-11-01 21:23:35 -05:00
Matthias Clasen
07c491f235 testsuite: Improve coverage for keys 2020-10-31 14:57:02 -04:00
Matthias Clasen
970f91ec24 testsuite: Add more css parser tests
Add tests for url parsing.
2020-10-31 09:18:40 -04:00
Matthias Clasen
48381bd4f6 testsuite: Add a forgotten test
I've written this test a while ago, but did not add
it to the test data list in meson.build.
2020-10-31 08:30:02 -04:00
Matthias Clasen
1a12999431 testsuite: Add a css test
This test verifies that CDO and CDC are ignored
as required.
2020-10-31 00:38:49 -04:00
Matthias Clasen
875452b476 testsuite: Improve coverage for GtkMultiSorter 2020-10-30 23:33:34 -04:00
Matthias Clasen
1c4c5e3b80 testsuite: Improve coverage for GtkStringList 2020-10-30 23:33:15 -04:00
Matthias Clasen
9b78bc4af7 testsuite: Improve coverage 2020-10-30 23:04:23 -04:00
Matthias Clasen
26150d8489 testsuite: Improve coverage for GtkExpression 2020-10-30 22:27:40 -04:00
Matthias Clasen
59dd7d8900 testsuite: Improve coverage for GtkMultiFilter 2020-10-30 22:27:40 -04:00