Matthias Clasen [Mon, 5 Jun 2023 21:17:48 +0000 (17:17 -0400)]
wayland: Drop an unused field
Nobody is using the wl_input_device field.
Matthias Clasen [Mon, 5 Jun 2023 18:52:15 +0000 (14:52 -0400)]
Revert "ci: More verbose output from asan"
This reverts commit
4f65c121b701c839552b89991d009c48d8636480.
Matthias Clasen [Mon, 5 Jun 2023 11:39:28 +0000 (07:39 -0400)]
Post-release version bump
Matthias Clasen [Mon, 5 Jun 2023 11:26:41 +0000 (07:26 -0400)]
4.11.3
Matthias Clasen [Mon, 5 Jun 2023 10:17:46 +0000 (10:17 +0000)]
Merge branch 'search-entry-allocation' into 'main'
text: Make the placeholder non-intrusive
See merge request GNOME/gtk!6060
Benjamin Otte [Mon, 5 Jun 2023 04:07:27 +0000 (04:07 +0000)]
Merge branch 'wip/otte/for-main' into 'main'
testsuite: Adapt color-matrix testcase
See merge request GNOME/gtk!6018
Benjamin Otte [Sat, 27 May 2023 17:05:32 +0000 (19:05 +0200)]
stringsorter: Handle NULL strings
NULL is a valid string GValue, so we need to handle it.
The utf8 normalizing and collating functions do not, so we better catch
it early.
Benjamin Otte [Sun, 21 May 2023 03:40:26 +0000 (05:40 +0200)]
testsuite: Make clipped-repeat test work universally
Cover the rounded corners so that they cause no visible difference in
the end result.
Benjamin Otte [Mon, 5 Jun 2023 03:29:41 +0000 (05:29 +0200)]
rendernode: Scale repeat offscreens properly
Respect the matrix in use at time of encountering a repeat node so that
the offscreen uses roughly the same device pixel density as the target.
Fixes the handling of the clipped-repeat test.
Benjamin Otte [Sun, 21 May 2023 03:03:49 +0000 (05:03 +0200)]
rendernode: Use cairo_set_device_offset()
Simplifies the code.
Benjamin Otte [Sun, 21 May 2023 02:48:46 +0000 (04:48 +0200)]
testsuite: Adapt color-matrix testcase
Make it use an alpha value that is well defined, ie 0.4 instead of 0.5.
0.4 * 255 = 102
0.5 * 255 = 127.5
This avoids rounding issues where some math may cause the resulting
alpha value to be 127, and some other math ends up with 128.
Benjamin Otte [Sun, 4 Jun 2023 18:15:24 +0000 (20:15 +0200)]
testsuite: fix memleak
Also use the actual diff command we found instead of searching for it
again.
Matthias Clasen [Mon, 5 Jun 2023 03:03:01 +0000 (03:03 +0000)]
Merge branch 'matthiasc/for-main' into 'main'
gl: Free all tracked buffers
See merge request GNOME/gtk!6061
Matthias Clasen [Mon, 5 Jun 2023 02:17:56 +0000 (22:17 -0400)]
gl: Free all tracked buffers
This was overlooked when the number of tracked
buffers was bumped from 2 to 4 in
46e3454eb7730e4.
Matthias Clasen [Mon, 5 Jun 2023 01:44:37 +0000 (21:44 -0400)]
searchentry: Improve size allocation
We want to always reserve space for the clear icon,
but let the text widget use that space when the icon
isn't shown. A plain box layout can't do that, so
do our own size allocation.
Matthias Clasen [Mon, 5 Jun 2023 01:45:59 +0000 (21:45 -0400)]
text: Make the placeholder non-intrusive
We never want to let the placeholder cause
the widget to grow, so set its max-width-chars
to a small value to make it ellipsize.
Benjamin Otte [Sun, 4 Jun 2023 18:21:21 +0000 (18:21 +0000)]
Merge branch 'wip/otte/vulkan' into 'main'
Vulkan hacking going overboard
See merge request GNOME/gtk!5992
Benjamin Otte [Wed, 24 May 2023 14:55:18 +0000 (16:55 +0200)]
vulkan: Create multiple render objects
Sometimes the GPU is still busy when the next frame starts (like when
no-vsync benchmarking), so we need to keep all those resources alone and
create new ones.
That's what the render object is for, so we just create another one.
However, when we create too many, we'll starve the CPU. So we'll limit
it. Currently, that limit is at 4, but I've never reached it (I've also
not starved the GPU yet), so that number may want to be set lower/higher
in the future.
Note that this is different from the number of outstanding buffers, as
those are not busy on the GPU but on the compositor, and as such a
buffer may have not finished rendering but have been returend from the
compositor (very busy GPU) or have finished rendering but not been
returned from the compositor (very idle GPU).
Benjamin Otte [Tue, 23 May 2023 21:47:55 +0000 (23:47 +0200)]
vulkan: Stop differentiating rounded from cicular corners
Our shaders can handle both, so don'ttry to tell them apart anymore.
Removes a lot of unnecessary fallbacks.
Benjamin Otte [Tue, 23 May 2023 03:32:35 +0000 (05:32 +0200)]
vulkan: Cleanup: Initialize constants at the top
Benjamin Otte [Tue, 23 May 2023 03:26:08 +0000 (05:26 +0200)]
vulkan: Add support for texture-scale nodes
Benjamin Otte [Tue, 23 May 2023 03:08:13 +0000 (05:08 +0200)]
vulkan: Split textures and samplers
The idea here is that we can do more complex combinations and use that
to support texture-scale nodes or use fancy texture formats (suc as
YUV).
I'm not sure this is actually necessary, but for now it gives more
flexibility.
Benjamin Otte [Mon, 22 May 2023 02:21:02 +0000 (04:21 +0200)]
vulkan: Add a hackish way to handle empty children
For blend and crossfade nodes, one of the children may exist and
influence the rendering, while the other does not.
Previously, we would skip the node, which would cause the required
rendering to not happen. We now send a valid texture id for the
invalid offscreen, thereby actually rendering the required parts.
Fixes the blend-invisible-child compare test
Current state for compare tests:
Ok: 397
Expected Fail: 0
Fail: 26
Unexpected Pass: 0
Skipped: 2
Timeout: 0
Benjamin Otte [Sun, 21 May 2023 02:42:02 +0000 (04:42 +0200)]
vulkan: Convert blend shader
Same work as crossfade shader pretty much.
Benjamin Otte [Sat, 20 May 2023 23:28:36 +0000 (01:28 +0200)]
vulkan: Update the cross-fade shader
This also fixes it rendering weird things when the bounds of start and
end node don't match.
Benjamin Otte [Sat, 20 May 2023 00:56:02 +0000 (02:56 +0200)]
vulkan: Implement bindless texture rendering
Instead of having a descriptor set per operation, we just have one
descriptor set and bind all our images into it.
Then the shaders get to use an index into the large texture array
instead.
Getting this to work - because it's a Vulkan extension that needs to be
manually enabled, even though it's officially part of Vulkan 1.2 - is
insane.
Benjamin Otte [Fri, 19 May 2023 03:35:18 +0000 (05:35 +0200)]
vulkan: Clip using scissors
If we have a rectangular clip without transforms, we can use
scissoring. This works particularly well because it allows intersecting
rounded rectangles with regular rectangles in all cases:
Use the scissor rect for the rectangle and the normal clipping code for
the rounded rectangle.
Benjamin Otte [Fri, 19 May 2023 01:08:43 +0000 (03:08 +0200)]
vulkan: Make scissoring an explicit operation
The idea is to use it for clip nodes when they are integer-aligned.
To do that, we need to track the scissor rect in the parse state, so we
do that, too.
Also move the viewport offset out of the projection matrix, as it is
part of the transform between clip and scissor, so it needs to live in
the offset.
Benjamin Otte [Thu, 18 May 2023 21:35:59 +0000 (23:35 +0200)]
vulkan: Remove unneeded struct member
We can use gsk_vulkan_pipeline_get_vertex_stride() whenever we need that
value.
Benjamin Otte [Thu, 18 May 2023 21:34:27 +0000 (23:34 +0200)]
vulkan: Bind vertex buffers only once
We can index into the same buffer from every pipeline due to the aligned
buffer writes (see previous commit).
So we do that.
Benjamin Otte [Thu, 18 May 2023 21:22:25 +0000 (23:22 +0200)]
vulkan: Align vertex data
We align the data to a multiple of vertex stride, that way we use more
memory, but we could compute an offset into the vertex buffer without
changing the offset.
Benjamin Otte [Thu, 18 May 2023 21:10:16 +0000 (23:10 +0200)]
vulkan: Set offsets when counting
We can set the vertex offset while counting the data, this gets rid of
the need of passing all the counting machinery into the actual data
collection code.
Benjamin Otte [Thu, 18 May 2023 20:55:15 +0000 (22:55 +0200)]
vulkan: Simplify switch statement
All branches do the same thing now, so pull them all into the same
branch.
Benjamin Otte [Thu, 18 May 2023 20:52:17 +0000 (22:52 +0200)]
vulkan: Simplify collect_vertex_data()
We don't have any size arguments to it, so don't use them.
Benjamin Otte [Thu, 18 May 2023 19:56:20 +0000 (21:56 +0200)]
vulkan: Remove a function from pipeline impls
That function is available already in the structs we feed to Vulkan.
Store it from there and reuse it.
Benjamin Otte [Thu, 18 May 2023 01:03:10 +0000 (03:03 +0200)]
vulkan: Don't draw fully clipped nodes
... if they are container nodes. Other nodes will get culled by the
vertex shader.
Benjamin Otte [Wed, 17 May 2023 23:18:38 +0000 (01:18 +0200)]
vulkan: Add optimization for transforms
When attempting a complex transform, check if the clip can be ignored
and do that if possible.
That way we don't cause fallbacks when transforming the clip is too
complex.
Benjamin Otte [Sun, 4 Jun 2023 17:16:04 +0000 (19:16 +0200)]
vulkan: Don't crash with overly large nodes
... when these nodes are used as children of a complex transform nodes
and we lose the clip.
Benjamin Otte [Mon, 15 May 2023 00:25:41 +0000 (02:25 +0200)]
vulkan: Update texture shader to do AA
Benjamin Otte [Mon, 15 May 2023 00:24:50 +0000 (02:24 +0200)]
vulkan: Split generic code off
No need to duplicate code in shaders when it can be shared.
Benjamin Otte [Sun, 14 May 2023 23:56:10 +0000 (01:56 +0200)]
vulkan: Use rounded rect APIs to improve clips
There are a bunch of intersection APIs available these days.
Let's use them.
Benjamin Otte [Sun, 14 May 2023 21:13:23 +0000 (23:13 +0200)]
gsk: Add (private) gsk_rounded_rect_intersection()
The idea is that for a rectangle intersection, each corner of the
result is either entirely part of one original rectangle or it is
an intersection point.
By detecting those 2 cases and treating them differently, we can
simplify the code to compare rounded rectangles.
Benjamin Otte [Sun, 14 May 2023 02:15:06 +0000 (04:15 +0200)]
vulkan: Set the initial clip rect
Instead of rendering unclipped, set the clip region to the extents of
the current clip region.
Benjamin Otte [Sun, 14 May 2023 02:12:14 +0000 (04:12 +0200)]
vulkan: Only draw one rect
Instead of emitting the render commands once per rectangle of the clip
region, just emit them once with the region's extents.
This is generally faster because it emits fewer commands to the GPU,
even though it may touch significantly more pixels.
For a proper method, we'd need to record the commands per clip rectangle
instead of emitting all of them all the time.
Benjamin Otte [Sat, 13 May 2023 04:02:51 +0000 (06:02 +0200)]
vulkan: Use CLAMP_TO_EDGE in sampler
We don't want to clamp to the border, that causes fade-outs at the
edges.
Benjamin Otte [Sat, 13 May 2023 01:14:16 +0000 (03:14 +0200)]
vulkan: Rewrite AA shaders to respect scale
The border and color shaders - the ones that do AA - now multiply their
coordinates by the scale factor, which gives them better rounding
capabilities.
This in particular improves the case where they are used in fractional
scaling situations, where the scale is defined at the root element.
Benjamin Otte [Fri, 12 May 2023 20:19:37 +0000 (22:19 +0200)]
vulkan: Don't allocate no descriptor sets
If we don't need them, exit early.
Shuts up the validation layers when running simple denos without
textures.
Benjamin Otte [Fri, 12 May 2023 18:49:31 +0000 (20:49 +0200)]
vulkan: Only use a single pipeline layout
There's no need to use 3 different ones when they are compatible.
Benjamin Otte [Fri, 12 May 2023 16:17:44 +0000 (18:17 +0200)]
vulkan: Don't cull vertices
We end up with the backside, when we scale(-1) and we still want it to
be visible, just flipped.
Benjamin Otte [Fri, 12 May 2023 13:23:02 +0000 (15:23 +0200)]
vulkan: Use scale factor for offscreens and fallbacks
Previously, we just used the defaultscale factor, but now that we're
having it available in push constants, we can read it back for creating
offscreens and rendering fallbacks.
So do that.
Benjamin Otte [Fri, 12 May 2023 03:15:28 +0000 (05:15 +0200)]
vulkan: Split scale from matrix
Now, the scale is no longer part of the matrix. This allows shaders to
transform points by the scale which increases accuracy for antialiasing.
Benjamin Otte [Fri, 12 May 2023 02:18:59 +0000 (04:18 +0200)]
vulkan: Keep the modelview as a GskTransform
This allows doing more optimized math on it.
Benjamin Otte [Fri, 12 May 2023 02:09:13 +0000 (04:09 +0200)]
vulkan: Split modelview and projection
This is adding extra work, but the benefits should become visible
in future commits.
Benjamin Otte [Fri, 12 May 2023 01:59:44 +0000 (03:59 +0200)]
vulkan: Add scale to push constants
This way, it can be pushed to the shaders
Benjamin Otte [Fri, 12 May 2023 01:35:58 +0000 (03:35 +0200)]
vulkan: Move scale into the state object
Benjamin Otte [Wed, 17 May 2023 23:18:30 +0000 (01:18 +0200)]
vulkan: Add offset to the Vulkan clip checks
This was forgotten when tracking the offset was added, so code was
actually selecting the wrong shaders.
Benjamin Otte [Fri, 12 May 2023 00:51:50 +0000 (02:51 +0200)]
vulkan: Move offset into the state object
Benjamin Otte [Thu, 11 May 2023 21:38:12 +0000 (23:38 +0200)]
vulkan: Add a new GskVulkanParseState
It's a 1:1 replacement for GskVulkanPushConstants, just without the
indirection through a different file.
GskVulkanPushConstants as a struct is gone now.
The file still exists to handle the push_constants operation.
Benjamin Otte [Thu, 11 May 2023 23:34:52 +0000 (01:34 +0200)]
vulkan: Don't store push constants in RenderOp
Instead, only store the values that are needed.
Benjamin Otte [Thu, 11 May 2023 20:09:12 +0000 (22:09 +0200)]
vulkan: Split out gsk_vulkan_render_pass_append_push_constants()
Simplifies the code and makes future refactoring easier
Benjamin Otte [Thu, 11 May 2023 19:36:44 +0000 (21:36 +0200)]
vulkan: Pass values to push directly
Don't require a GskVulkanPushConstants there.
Benjamin Otte [Wed, 10 May 2023 15:55:56 +0000 (17:55 +0200)]
vulkan: Add a static assert
We don't want to make the push constants larger than what the spec
guarantees. And that is 128 bytes, see value for
maxPushConstantsSize in table 55 of
https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-minmax
Benjamin Otte [Thu, 11 May 2023 14:59:02 +0000 (16:59 +0200)]
vulkan: Handle clip properly for offscreens
This was broken in the last commit.
Benjamin Otte [Wed, 10 May 2023 14:40:22 +0000 (16:40 +0200)]
vulkan: Track offset in the renderpass
This avoids emitting lots of push constant updates as most of the
transforms we have are simple translations to adjust drawing for the
next widget.
Benjamin Otte [Wed, 10 May 2023 01:17:38 +0000 (03:17 +0200)]
vulkan: Pass scale to offscreens
Create offscreens with enough pixels for the given scale and ensure
the scale is passed on.
This improves text rendering on offscreens quite a bit.
Benjamin Otte [Wed, 10 May 2023 00:46:57 +0000 (02:46 +0200)]
vulkan: Clean up scale handling
1. Use a graphene_vec2_t
2. Ensure it's always positive
3. Don't break with fallback
The scale value is nothing more than an indication of how many pixels to
assume per unit of a node.
Benjamin Otte [Wed, 10 May 2023 00:11:28 +0000 (02:11 +0200)]
vulkan: Fix typo
Benjamin Otte [Tue, 9 May 2023 22:21:39 +0000 (00:21 +0200)]
vulkan: Don't store unused matrices
We can compute it when needed, so do that.
Benjamin Otte [Tue, 9 May 2023 22:17:01 +0000 (00:17 +0200)]
vulkan: Remove unneeded argument
The initial matrix can be computed as needed, so we don't need to
precompute it.
Benjamin Otte [Tue, 9 May 2023 22:09:03 +0000 (00:09 +0200)]
vulkan: Don't explode without vertex data
If no buffer has any vertex data (read: if nothing gets drawn), don't
try to allocate a 0 bytes buffer.
Benjamin Otte [Tue, 9 May 2023 22:08:24 +0000 (00:08 +0200)]
vulkan: Handle empty child bounds in repeat node
Also add test to the testsuite for it.
Benjamin Otte [Tue, 9 May 2023 21:50:13 +0000 (23:50 +0200)]
vulkan: Fix repeat nodes
Benjamin Otte [Tue, 9 May 2023 21:48:44 +0000 (23:48 +0200)]
vulkan: Don't transform the viewport rect
We don't want to render the offscreen trnsformed, we want to render it
as-is.
We lose the correct scale factor, but that requires some separate work,
so for now it gets a bit blurry on hidpi.
Benjamin Otte [Tue, 9 May 2023 20:30:49 +0000 (22:30 +0200)]
vulkan: Make quarks global variables
I don't want to ensure there's a RenderPass available everywhere and
recreate the quarks in each, I just want to use them.
Benjamin Otte [Tue, 9 May 2023 20:26:13 +0000 (22:26 +0200)]
vulkan: Split out a function
We can now create offscreens explicitly.
Benjamin Otte [Tue, 9 May 2023 20:25:22 +0000 (22:25 +0200)]
vulkan: offscreens are used as color attachments
... so set the corresponding flag.
Also name the function "new_for_offscreen()" because thats what this
function is about, "texture" is ambiguous.
Benjamin Otte [Sun, 7 May 2023 08:07:02 +0000 (10:07 +0200)]
vulkan: compute new modelview directly
no need to go through a GskTransform
Benjamin Otte [Sun, 7 May 2023 01:41:38 +0000 (03:41 +0200)]
vulkan: Make border shader handle fractional widths
We were rounding widths properly, make sure we always round up.
Benjamin Otte [Sun, 7 May 2023 01:40:44 +0000 (03:40 +0200)]
vulkan: Don't round corners when growing rounded rect
If the corner is set to 0, keep it there.
Benjamin Otte [Sat, 6 May 2023 23:49:29 +0000 (01:49 +0200)]
vulkan: Rewrite rounded rectangle to use SDF distance
We can use this to properly compute distance in scaled situations.
We also now compute coverage with (imperfect) antialiasing.
Benjamin Otte [Sat, 6 May 2023 23:06:52 +0000 (01:06 +0200)]
vulkan: Start rework on shaders to allow antialiased drawing
This introduces the rect object and adds a rect_distance() and
rect_coverage() function.
_distance() returns the signed distance tp the rectangle.
_coverage() returns the coverage of a pixel centered at that position.
Note that the pixel size is computed using dFdx/dFdy.
Benjamin Otte [Fri, 5 May 2023 07:29:47 +0000 (09:29 +0200)]
vulkan: Render whole texture
When the node bounds were a non-integer size, the texture would get
ceil()ed pixels, but various viewport or scissor computations might
floor() instead, leaving the right/bottom row of pixels untouched.
Make sure those functions ceil(), too.
Benjamin Otte [Sat, 20 May 2023 23:27:09 +0000 (01:27 +0200)]
renderer: return_if_fail() if the given texture size is 0
All renderers SEGV currently when that happens.
Matthias Clasen [Sun, 4 Jun 2023 17:35:04 +0000 (17:35 +0000)]
Merge branch 'matthiasc/for-main' into 'main'
wayland: Don't leak cursor structs
See merge request GNOME/gtk!6058
Ekaterine Papava [Sun, 4 Jun 2023 14:45:45 +0000 (14:45 +0000)]
Update Georgian translation
Matthias Clasen [Thu, 1 Jun 2023 00:35:17 +0000 (20:35 -0400)]
testsuite: Improve test coverage
Matthias Clasen [Thu, 1 Jun 2023 00:34:28 +0000 (20:34 -0400)]
wayland: Don't leak cursor structs
Found by gcc's -fanalyzer.
Matthias Clasen [Wed, 31 May 2023 21:13:05 +0000 (17:13 -0400)]
NEWS: Cosmetics
Matthias Clasen [Sat, 3 Jun 2023 19:38:24 +0000 (19:38 +0000)]
Merge branch 'drop-x11-dnd-keynav' into 'main'
x11: Stop using passive grabs
See merge request GNOME/gtk!6055
Matthias Clasen [Sat, 3 Jun 2023 16:17:55 +0000 (12:17 -0400)]
Revert "gdk/x11: Also grab keyboard during XDnD grabs"
This reverts commit
ae94417f80c92b26792280a9b798cafc01e49232.
Matthias Clasen [Sat, 3 Jun 2023 14:44:21 +0000 (10:44 -0400)]
x11: Stop using passive grabs
The keynav that this implements is half-broken under
xwayland anyway, and it confused and complicates things
on the compositor side.
Benjamin Otte [Sat, 3 Jun 2023 16:19:09 +0000 (16:19 +0000)]
Merge branch 'wip/otte/fix-glx' into 'main'
glx: Trap errors inside loop
Closes #5857
See merge request GNOME/gtk!6056
Benjamin Otte [Sat, 3 Jun 2023 16:00:56 +0000 (18:00 +0200)]
glx: Trap errors inside loop
Instead of trapping errors for the whole loop trying to create GL
contexts, trap them once per GL context.
Apparently GLX does throw an error when a too high version is requested
and doesn't just return NULL and then that error lingers when we try
lower versions.
Fixes #5857
Matthias Clasen [Sat, 3 Jun 2023 11:01:40 +0000 (11:01 +0000)]
Merge branch 'wip/antoniof/boxlayout-baseline-optional' into 'main'
boxlayout: Don't always reserve height for baseline alignment
Closes #5863
See merge request GNOME/gtk!6053
António Fernandes [Fri, 2 Jun 2023 19:18:56 +0000 (20:18 +0100)]
boxlayout: Don't always reserve height for baseline alignment
Otherwise an horizontal box may have a larger minumum height than
any of its children even though non of them is baseline-aligned.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5863
Matthias Clasen [Fri, 2 Jun 2023 11:31:45 +0000 (11:31 +0000)]
Merge branch 'trap-bad-rr-errors' into 'main'
x11: Trap XRandr errors when getting outputs during init and update
See merge request GNOME/gtk!6046
Luca Bacci [Fri, 2 Jun 2023 09:34:48 +0000 (09:34 +0000)]
Merge branch 'for-main' into 'main'
GdkWin32 Cleanup
See merge request GNOME/gtk!5714
Marco Trevisan (Treviño) [Thu, 1 Jun 2023 22:23:51 +0000 (00:23 +0200)]
x11: Trap XRandr errors when getting outputs during init and update
We may try to update the XRR outputs and Crtcs when they're changing in
the server, and so we may get BadRROutput that we're currently not
handling properly.
As per this, use traps and check whether we got errors, and if we did
let's ignore the current output.
It's not required to call init_randr13() again because if we got errors
it's very likely that there's a change coming that will be notified at
next iteration during which we'll repeat the init actions.
Matthias Clasen [Thu, 1 Jun 2023 20:58:22 +0000 (20:58 +0000)]
Merge branch 'sumibi-yakitori/fix-glcontext-macos' into 'main'
macOS: Fix problems with OpenGL context creation on macOS
Closes #5811
See merge request GNOME/gtk!6044
Daniel Boles [Thu, 1 Jun 2023 19:31:22 +0000 (20:31 +0100)]
Window: Copy caveats from :*visible to the setters