Commit Graph

75515 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
e0aaf9bc83 gsk/vulkan/renderpass: Refactor scale
Instead of tracking a single scale, track x and y scales separately.
Factor out gsk_vulkan_render_pass_new() into a private function that
receives both scales, and pass 'scale_factor' for both.
2023-04-01 14:46:56 -03:00
Georges Basile Stavracas Neto
b1a8c0e686 gsk/vulkan/renderpass: Factor out node implementations
This is mostly a cosmetic change, and the goal is twofold:

 1. Make it easier to spot unimplemented render node types; and
 2. Prepare for a small rework

The implementation for each node now lives in specific functions,
like the GL renderer; unlike the GL renderer, however, we use a
node type vtable to map GskRenderNodeType → implementation. Render
node without an implementation map to NULL, and use the fallback
implementation. Render nodes that fail any check and return FALSE
also use fallback implementation.
2023-03-31 14:00:33 -03:00
Matthias Clasen
bd29bed785 Merge branch 'gbsneto/easy-vulkan-fixes' into 'main'
Easy Vulkan cleanups and fixes

See merge request GNOME/gtk!5753
2023-03-31 13:25:30 +00:00
Alexander Shopov
cf2c955b12 Update Bulgarian translation
(cherry picked from commit 3458ebf8c9)
2023-03-31 10:04:32 +00:00
Matthias Clasen
ad8684431e Merge branch 'more-property-notification' into 'main'
filedialog: Make filters nullable

See merge request GNOME/gtk!5755
2023-03-31 01:54:52 +00:00
Matthias Clasen
4e17900b9a testsuite: Check more property notification
Handle more value types.
2023-03-30 21:39:55 -04:00
Matthias Clasen
fdce10fb96 Make adjustment setters behave 2023-03-30 21:39:55 -04:00
Matthias Clasen
3b96b053ad models: Fix up property notifications
We were emitting redundant notifications
for the ::model property.
2023-03-30 20:18:19 -04:00
Matthias Clasen
82b188c8fb filedialog: Make filters nullable
It should be possible to reset a property
to its default value.
2023-03-30 20:17:28 -04:00
Matthias Clasen
ef45004d14 Merge branch 'more-notify-tests' into 'main'
testsuite: Clean up some exclusions

See merge request GNOME/gtk!5752
2023-03-30 23:34:48 +00:00
Benjamin Otte
8566622748 Merge branch 'gbsneto/wayland-buffer-scale-creation' into 'main'
gdk/wayland/surface: Track and apply buffer scale

See merge request GNOME/gtk!5751
2023-03-30 21:59:45 +00:00
Matthias Clasen
577195a243 Make widget property setters behave
We want to allow setting a property to its
current value, while still having a precondition
for widget->parent being NULL otherwise.
2023-03-30 17:32:38 -04:00
Georges Basile Stavracas Neto
6e80c8b07e gdk/vulkancontext: Accept Khronos validation layers
The Lunarg validation layers seem to have been deprecated in favour
of the Khronos ones. There's no reason not to have both, to accept
loading both - simultaneously, even.
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
c85599e2e8 gsk/vulkanglyphcache: Cleanup maths
A trivial cleanup to match what the GL renderer does
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
981e94505c vulkan/glyphcache: Add padding around ink rect
This is what the GL renderer does, and it gets rid of the cutout
characters.
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
c0449e3245 gdk/vulkancontext: Pass all painted rects
Instead of passing a single, potentially massive rectangle that is
just the extents of the damage rect, collect and pass all damage
rects individually.
2023-03-30 17:13:35 -03:00
Georges Basile Stavracas Neto
8217b6e484 gdk/wayland/surface: Track and apply buffer scale
Add a new flag to track whether buffer scale is dirty or not,
and centralize calling wl_surface_set_buffer_scale() in a single
place: gdk_wayland_surface_sync_buffer_scale().

gdk_wayland_surface_sync_buffer_scale() is only called by
gdk_wayland_surface_sync(), which itself is called by the GL,
Vulkan, and Cairo contexts, right before submitting a frame.
This ensure that each frame has an up-to-date buffer scale.

This mimics how opaque and input regions are tracked.
2023-03-30 16:32:50 -03:00
Matthias Clasen
2650c4e974 testsuite: Check more property notification
We can easily check some object types
such as widgets.
2023-03-30 14:13:19 -04:00
Matthias Clasen
87f9e8a4c1 testsuite: Clean up some exclusions
Drop some exclusions from the notify test.
The tests work fine for these objects.
2023-03-30 14:13:19 -04:00
Matthias Clasen
54b895341c listitem: Fix a notification problem
We were notifying ::item when ::child is
changed. Oops
2023-03-30 14:13:19 -04:00
Matthias Clasen
5ee0e19568 Merge branch 'matthiasc/for-main' into 'main'
emojichooser: Stop using gtk_widget_get_allocation

See merge request GNOME/gtk!5749
2023-03-30 02:45:56 +00:00
Matthias Clasen
fc573491b2 emojichooser: Stop using gtk_widget_get_allocation
Replace all uses with gtk_widget_compute_bounds.
2023-03-29 21:14:24 -04:00
Matthias Clasen
5e9405887e Merge branch 'fix-popover-positioning' into 'main'
wayland: Fix corner cases in positioning

See merge request GNOME/gtk!5741
2023-03-29 20:12:29 +00:00
Matthias Clasen
49778fda3e Merge branch 'matthiasc/for-main' into 'main'
Add some more keysyms tests

See merge request GNOME/gtk!5745
2023-03-29 12:05:58 +00:00
Matthias Clasen
dbefc330bd Add some more keysyms tests
Spot-check a few keypad symbols.
2023-03-29 07:35:24 -04:00
Matthias Clasen
31ebe42d2e testsuite: Update a test
cacecd2fb5 changed a warning message that
some tests check for. Oops.
2023-03-29 07:34:27 -04:00
Benjamin Otte
8fd526a194 Merge branch 'wip/otte/filechooser-fixes' into 'main'
filechooser fixes

See merge request GNOME/gtk!5746
2023-03-29 11:28:28 +00:00
Benjamin Otte
1449e487d3 Merge branch 'wip/otte/node-naming' into 'main'
node format: Allow naming textures and nodes

See merge request GNOME/gtk!5740
2023-03-29 11:28:15 +00:00
Benjamin Otte
889870546f filechoosercell: Remove position property
Instead, query the position from the listitem
2023-03-29 10:42:49 +02:00
Benjamin Otte
82e308b635 filechoosercell: Remove selected property
Instead, query the selected state from the listitem.
2023-03-29 10:42:49 +02:00
Benjamin Otte
0834dc50aa filechooser: Select via action
Don't fudge around poking through the listview, trying to get a model
and selecting it directly. Instead, use the proper way and activate the
"listitem.select" action.
2023-03-29 10:42:49 +02:00
Benjamin Otte
cbef6a9258 listbase: Select via action
Instead of directly calling select_item(), trigger the select-item
action of the focused child.

We do this convoluted calling into the widget because that way
GtkListItem::selectable gets respected, which is what one would expect.

Plus, this code is usually triggered via keybindings, and this way the
ListBase keybindings work identical to the ListItem keybindings.
2023-03-29 10:42:49 +02:00
Matthias Clasen
c5a53f235a Merge branch 'wip/otte/trelistmodel-fixage' into 'main'
treelistmodel: Don't add items in reverse

Closes #5707

See merge request GNOME/gtk!5744
2023-03-29 02:23:46 +00:00
Benjamin Otte
47ba29bc14 docs: Document additions to the node format 2023-03-29 03:53:52 +02:00
Benjamin Otte
9dd050ff30 testsuite: Add parsing tests for node and texture naming 2023-03-29 03:53:52 +02:00
Benjamin Otte
0d6a6a5997 rendernodeparser: Detect duplicates and print them by name
If we encounter a node or texture the 1st time and they are going
to be used again, give them a name.

Then, when encountering them again, print them by name instead
of duplicating them.
2023-03-29 03:53:52 +02:00
Benjamin Otte
5a0c4de07f rendernodeparser: Add support for reusing nodes
We extend the syntax for nodes from:
  <node-type> { ... }
to
  <node-type> { ... }
  <node-type> <string> { ... }
  <string>;
where the first is the same as before, the 2nd defines a named node and
the last references a previously defined node.
Or to give an example:
  color "node" {
    bounds: 0 0 10 10;
    color: red;
  }
  transform {
    bounds: 20 0 10 10;
    child: "node";
  }
This will draw the red box twice, once at (0,0) and once at
(20,0).

The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse nodes, in particular when
dealing with caches.
2023-03-29 03:53:52 +02:00
Benjamin Otte
348a68599a rendernodeparser: Add support for reusing textures
We extend the syntax for textures from just:
  <url>
to
  [<string>] <url>
  <string>
where the first defines a named texture while the second references a
texture.
Or to give an example:
  texture {
    bounds: 0 0 10 10;
    texture: "foo" url("foo.png");
  }
  texture {
    bounds: 20 0 10 10;
    texture: "foo";
  }
This will draw the texture "foo.png" twice, once at (0,0) and once at
(20,0).

The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse textures, in particular when
mixing them in texture and texture-scale nodes.
2023-03-29 03:53:52 +02:00
Benjamin Otte
8590b1ef11 rendernodeparser: Add a Context object
... and pass it through all the parsing functions.

So far it's unused, this is just the plumbing.
2023-03-29 03:53:52 +02:00
Benjamin Otte
d1f27c281d rendernodeparser: Split out a function
This code was copy/pasted, so unify it.
2023-03-29 03:53:52 +02:00
Benjamin Otte
76ff2f5410 rendernodeparser: Emit error when failing to resolve URL 2023-03-29 03:53:52 +02:00
Benjamin Otte
1605b07ff5 rendernodeparser: Failing to parse a string is an error
Testcase included.
2023-03-29 03:53:52 +02:00
Benjamin Otte
cc9de42e70 testsuite: Fix broken test
The test was referencing a nonexisting image.

Plus, node parsing cannot reference relative URLs.
2023-03-29 03:53:52 +02:00
Kévin Commaille
cd860beb38 Add a test for splicing treelistmodel 2023-03-29 03:32:51 +02:00
Benjamin Otte
1718db144e treelistmodel: Don't add items in reverse
This was broken since commit bf55685000
where we started to track items.

Fixes #5707
2023-03-29 03:32:48 +02:00
Matthias Clasen
65dc4cac86 wayland: Fix corner cases in positioning
We were not handling some cases correctly.
This was making the dropdown in the gtk-demo
image-scaling demo appear in the top left
corner.
2023-03-28 20:37:54 -04:00
Matthias Clasen
ea572227f0 Merge branch 'wayland-popup-anchor' into 'main'
wayland: Comply with protocol requirements

See merge request GNOME/gtk!5723
2023-03-28 15:36:34 +00:00
Alexandre Franke
ac96384260 Update French translation 2023-03-28 10:25:01 +00:00
Matthias Clasen
db9883584d Merge branch 'matthiasc/for-main' into 'main'
gdk: Improve logging for backends

Closes #5704

See merge request GNOME/gtk!5737
2023-03-28 10:19:31 +00:00
Matthias Clasen
435bc70886 Merge branch 'sumibi-yakitori/fix-texture-filter' into 'main'
glrenderer: Fix to prevent creation of GL_TEXTURE_MAG_FILTER filters with incorrect values

See merge request GNOME/gtk!5729
2023-03-28 02:17:39 +00:00