gtk4.git
2 years agofontchooser: Improve accessibility
Matthias Clasen [Sat, 10 Jun 2023 15:00:35 +0000 (11:00 -0400)]
fontchooser: Improve accessibility

Set up missing accessible relations, labels and roles.

2 years agobutton: Improve accessible setup
Matthias Clasen [Sat, 10 Jun 2023 14:25:02 +0000 (10:25 -0400)]
button: Improve accessible setup

With the current approach, we get duplicate labels
in the accessible name: _Cancel Cancel. Change things
around to always set the labelled-by accessible relation
if we have a label, and not the label accessible property.

2 years agoMerge branch 'textview-ctrl-backspace' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 13:33:10 +0000 (13:33 +0000)]
Merge branch 'textview-ctrl-backspace' into 'main'

textview: Improve word navigation

Closes #737

See merge request GNOME/gtk!6080

2 years agotextview: Improve word navigation
Matthias Clasen [Sat, 10 Jun 2023 13:03:10 +0000 (09:03 -0400)]
textview: Improve word navigation

Both Ctrl-Left and Ctrl-Backspace were failing
to step over a non-word at the beginning of
the line. Fix this to match GtkEntry behavior.

Fixes: #737
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 11:03:02 +0000 (11:03 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk-demo: Change sidebar tab behavior

Closes #3543

See merge request GNOME/gtk!6079

2 years agogtk-demo: Change sidebar tab behavior
Matthias Clasen [Sat, 10 Jun 2023 04:02:29 +0000 (00:02 -0400)]
gtk-demo: Change sidebar tab behavior

Change the sidebar to use the 'item' tab
behavior.

Fixes: #3543
2 years agotestsuite: More memleak fixes
Matthias Clasen [Sat, 10 Jun 2023 03:14:03 +0000 (23:14 -0400)]
testsuite: More memleak fixes

2 years agobuilder: Cosmetics
Matthias Clasen [Sat, 10 Jun 2023 03:13:26 +0000 (23:13 -0400)]
builder: Cosmetics

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 03:17:14 +0000 (03:17 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

inspector: Cosmetics

See merge request GNOME/gtk!6078

2 years agogtk: Plug a memory leak
Matthias Clasen [Sat, 10 Jun 2023 02:30:01 +0000 (22:30 -0400)]
gtk: Plug a memory leak

2 years agogsk: Fully free mask nodes
Matthias Clasen [Sat, 10 Jun 2023 02:23:06 +0000 (22:23 -0400)]
gsk: Fully free mask nodes

We were forgetting to chain up in finalize.  Oops

2 years agogsk: Plug a memory leak
Matthias Clasen [Sat, 10 Jun 2023 01:54:16 +0000 (21:54 -0400)]
gsk: Plug a memory leak

2 years agotestsuite: Plug some memory leaks
Matthias Clasen [Fri, 9 Jun 2023 14:59:47 +0000 (10:59 -0400)]
testsuite: Plug some memory leaks

2 years agoinspector: Show computed values in a11y tab
Matthias Clasen [Sat, 10 Jun 2023 01:03:54 +0000 (21:03 -0400)]
inspector: Show computed values in a11y tab

Show the name and description in the a11y tab.
These are not direct property values, but computed
according to ARIA rules.

2 years agoinspector: Cosmetics
Matthias Clasen [Fri, 9 Jun 2023 20:39:42 +0000 (16:39 -0400)]
inspector: Cosmetics

Don't use technobabble like "fps overlay" in the UI.

2 years agoMerge branch 'filechooser-sort-directories-first' into 'main'
Matthias Clasen [Fri, 9 Jun 2023 19:10:58 +0000 (19:10 +0000)]
Merge branch 'filechooser-sort-directories-first' into 'main'

FileChooser: Sort directories before files by default

See merge request GNOME/gtk!4284

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 9 Jun 2023 14:18:51 +0000 (14:18 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Avoid deprecation warnings from GTK_ALIGN_BASELINE_FILL

Closes #5875

See merge request GNOME/gtk!6077

2 years agoFix some typos in gtk.supp
Matthias Clasen [Fri, 9 Jun 2023 12:28:36 +0000 (08:28 -0400)]
Fix some typos in gtk.supp

Actually ignore the media module leak.

2 years agoprint: Drop one use of private api
Matthias Clasen [Fri, 9 Jun 2023 12:23:09 +0000 (08:23 -0400)]
print: Drop one use of private api

We added public api for the foreground color
for just this case, so use it.

2 years agogdk: Fix an oversight in GdkContentFormats
Matthias Clasen [Fri, 9 Jun 2023 12:12:56 +0000 (08:12 -0400)]
gdk: Fix an oversight in GdkContentFormats

When clearing a builder, reset the counts to 0.

Otherwise valgrind spots uninitialized memory
use in our testsuite.

2 years agoAvoid deprecation warnings from GTK_ALIGN_BASELINE_FILL
Matthias Clasen [Fri, 9 Jun 2023 10:39:02 +0000 (06:39 -0400)]
Avoid deprecation warnings from GTK_ALIGN_BASELINE_FILL

We have to be careful to only use GDK_ALIGN_BASELINE_FILL when
permitted by GDK_VERSION_MAX_ALLOWED because gtkenums.h is a
public header.

Fixes: #5875
I don't think we can avoid conditional compilation here, because the old definition is going to cause deprecated declaration warnings unless you define an old GDK_VERSION_MIN_REQUIRED.

2 years agoDrawingArea: Document Widget.get_color, !StyleCont
Daniel Boles [Fri, 9 Jun 2023 12:02:40 +0000 (13:02 +0100)]
DrawingArea: Document Widget.get_color, !StyleCont

StyleContext is deprecated. To just get foreground colour we now have a
method on Widget, so use that in this example, instead of StyleContext.

2 years agoUpdate POTFILES.in and POTFILES.skip
Piotr Drąg [Fri, 9 Jun 2023 11:22:17 +0000 (13:22 +0200)]
Update POTFILES.in and POTFILES.skip

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Fri, 9 Jun 2023 00:47:26 +0000 (00:47 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Set GIO_USE_VFS=local everywhere

See merge request GNOME/gtk!6076

2 years agoMerge branch 'print-subdir' into 'main'
Matthias Clasen [Fri, 9 Jun 2023 00:32:45 +0000 (00:32 +0000)]
Merge branch 'print-subdir' into 'main'

Move printing code to its own directory

See merge request GNOME/gtk!6067

2 years agotestsuite: Set GIO_USE_VFS=local everywhere
Benjamin Otte [Fri, 9 Jun 2023 00:26:18 +0000 (02:26 +0200)]
testsuite: Set GIO_USE_VFS=local everywhere

And do so centrally, not randomly in individual tests.

(Hopefully) fixes spurious test failures in CI.

Related: #5867

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Thu, 8 Jun 2023 23:54:07 +0000 (23:54 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Make memorytexture tests random

See merge request GNOME/gtk!6075

2 years agoprint: Reimplement collate preview
Matthias Clasen [Thu, 8 Jun 2023 04:24:38 +0000 (00:24 -0400)]
print: Reimplement collate preview

Redo this with widgets instead of cairo drawing.
The new private widget is called GtkPageThumbnail.

2 years agoprint: Drop some private api use
Matthias Clasen [Thu, 8 Jun 2023 04:02:05 +0000 (00:02 -0400)]
print: Drop some private api use

2 years agoMove resources too
Matthias Clasen [Thu, 8 Jun 2023 03:47:34 +0000 (23:47 -0400)]
Move resources too

2 years agotestsuite: Don't always loop in memorytexture tests
Benjamin Otte [Thu, 8 Jun 2023 23:09:52 +0000 (01:09 +0200)]
testsuite: Don't always loop in memorytexture tests

When running the tests, only run the random (and potentially large) size
download test once instead of 10 times.

There's no real benefit in doing that, both because it's unlikely to
fail only in the 2nd or 9th run and because the sizes are picked
randomly.

This also speeds up the test massively as the download test was
dominating the runtime.

2 years agotestsuite: Make memorytexture tests random
Benjamin Otte [Thu, 8 Jun 2023 23:04:27 +0000 (01:04 +0200)]
testsuite: Make memorytexture tests random

Instead of picking a few numbers in advance and running them through the
test gauntlet every time, pick the random numbers at runtime.

This both increases the test coverage in that it ultimately tests more
combinations across many runs and it reduces the runtime of individual
runs because every tun only runs the download tests twice (with 1px and
the random size) instead of 5 times.

And that speedup benefits the CI, where the asan runs would cause this
test to timeout sometimes.

2 years agoMerge branch 'wip/otte/for-vulkan' into 'main'
Benjamin Otte [Thu, 8 Jun 2023 21:57:07 +0000 (21:57 +0000)]
Merge branch 'wip/otte/for-vulkan' into 'main'

vulkan: Fancy gradients

See merge request GNOME/gtk!6073

2 years agovulkan: Antialiasing for linear gradients
Benjamin Otte [Thu, 8 Jun 2023 19:42:18 +0000 (21:42 +0200)]
vulkan: Antialiasing for linear gradients

Shaders are complicated now...

2 years agotestsuite: Add a test for repeating gradients
Benjamin Otte [Thu, 8 Jun 2023 10:52:33 +0000 (12:52 +0200)]
testsuite: Add a test for repeating gradients

Make sure scaling the image also scales the color stop lookup.

2 years agovulkan: Make gradient shader use buffers
Benjamin Otte [Thu, 8 Jun 2023 10:03:48 +0000 (12:03 +0200)]
vulkan: Make gradient shader use buffers

This allows putting any number of color stops into the buffer, so
fallbacks with too many stops are no longer necessary.

2 years agovulkan: Add support for storage buffers
Benjamin Otte [Thu, 25 May 2023 20:21:23 +0000 (22:21 +0200)]
vulkan: Add support for storage buffers

And add a default storage buffer that is used for per-frame temporary
data.

So far nothing is using this code, this is just infrastructure.

2 years agovulkan: Switch GLSL version to 450
Benjamin Otte [Thu, 8 Jun 2023 09:00:18 +0000 (11:00 +0200)]
vulkan: Switch GLSL version to 450

We need more modern features soon.

2 years agovulkan: Only update descriptor sets with contents
Benjamin Otte [Thu, 8 Jun 2023 04:55:40 +0000 (06:55 +0200)]
vulkan: Only update descriptor sets with contents

If one of the descriptor sets doesn't have any items, don't include it
in the sets passed to vkUpdateDescriptorSets().

This has no effect right now, because we either have both images and
samplers or neither, but it will become relevant once we also support
buffers.

2 years agoprint: Some more include cleanup
Matthias Clasen [Wed, 7 Jun 2023 19:35:12 +0000 (15:35 -0400)]
print: Some more include cleanup

2 years agoUpdate POTFILES.in
Matthias Clasen [Wed, 7 Jun 2023 18:41:46 +0000 (14:41 -0400)]
Update POTFILES.in

The moving the printing sources needs to
be reflected here.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 7 Jun 2023 15:11:29 +0000 (15:11 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Fix a compiler warning

See merge request GNOME/gtk!6070

2 years agoci: Mark asan as must-pass
Matthias Clasen [Wed, 7 Jun 2023 14:54:48 +0000 (10:54 -0400)]
ci: Mark asan as must-pass

The asan test run seems to pass pretty
reliably now, so lets keep it that way.

2 years agoFix a compiler warning
Matthias Clasen [Wed, 7 Jun 2023 11:41:30 +0000 (07:41 -0400)]
Fix a compiler warning

Compilers these days are very picky about
their NULLs.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Wed, 7 Jun 2023 14:21:32 +0000 (14:21 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

gtk-demo: Remove random numbers

See merge request GNOME/gtk!6069

2 years agogtk-demo: make the sidebar request proper width
Benjamin Otte [Wed, 7 Jun 2023 13:55:59 +0000 (15:55 +0200)]
gtk-demo: make the sidebar request proper width

- 25 chars sounds about right for the texts we use
- don't use min width so we allow shrinking the widget (large text or
  small mobile devices)
- ellipsize the text instead of clipping it.

2 years agogtk-demo: Remove random numbers
Benjamin Otte [Wed, 7 Jun 2023 13:54:53 +0000 (15:54 +0200)]
gtk-demo: Remove random numbers

There were 3 different random numbers set to determine the sidebar width
and all of them were wrong. Remove them.

Instead, propagate the natural width of the listitems.

2 years agoFix a compiler warning
Matthias Clasen [Wed, 7 Jun 2023 11:41:30 +0000 (07:41 -0400)]
Fix a compiler warning

Compilers these days are very picky about
their NULLs.

2 years agoMake introspection build
Matthias Clasen [Wed, 7 Jun 2023 11:27:03 +0000 (07:27 -0400)]
Make introspection build

2 years agoprint: Maintain compatibility
Matthias Clasen [Wed, 7 Jun 2023 04:29:39 +0000 (00:29 -0400)]
print: Maintain compatibility

gtkunixprint.h is a public header, that needs
to keep being installed in the same location.

2 years agoprint: Start sorting apart includes
Matthias Clasen [Wed, 7 Jun 2023 03:35:07 +0000 (23:35 -0400)]
print: Start sorting apart includes

Use gtk/gtk.h in the print sources, so that it
becomes apparent where we are using private apis.

2 years agoprint: Move all the remaining sources
Matthias Clasen [Wed, 7 Jun 2023 03:14:39 +0000 (23:14 -0400)]
print: Move all the remaining sources

Move the unix- and Windows-specific print
sources to the gtk/print subdirectory.

2 years agoprint: Move frontend sources
Matthias Clasen [Wed, 7 Jun 2023 02:52:12 +0000 (22:52 -0400)]
print: Move frontend sources

Move the cross-platform printing sources
to the gtk/print subdirectory.

2 years agoprint: Install headers in a subdir
Matthias Clasen [Wed, 7 Jun 2023 02:45:02 +0000 (22:45 -0400)]
print: Install headers in a subdir

This is a first step towards isolating the printing
code within gtk.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 7 Jun 2023 03:14:17 +0000 (03:14 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Drop gtkunixprint-autocleanups.h

See merge request GNOME/gtk!6066

2 years agoprint: Rename private headers
Matthias Clasen [Wed, 7 Jun 2023 02:26:38 +0000 (22:26 -0400)]
print: Rename private headers

Rename private print-related headers to follow our
naming conventions:
gtkprintutils.h -> gtkprintutilsprivate.h
gtkprinteroption.h -> gtkprinteroptionprivate.h
gtkprinteroptionset.h => gtkprinteroptionsetprivate.h
gtkprinteroptionwidget.h -> gtkprinteroptionwidgetprivate.h

2 years agoDrop gtkunixprint-autocleanups.h
Matthias Clasen [Wed, 7 Jun 2023 02:18:12 +0000 (22:18 -0400)]
Drop gtkunixprint-autocleanups.h

Move these definitions where they belong
and git rid of an auxiliary header we don't
need anymore.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 6 Jun 2023 11:17:32 +0000 (11:17 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

ci: More asan test runs

See merge request GNOME/gtk!6064

2 years agoMerge branch 'wip/otte/fix-glx' into 'main'
Marco Trevisan [Tue, 6 Jun 2023 10:56:55 +0000 (10:56 +0000)]
Merge branch 'wip/otte/fix-glx' into 'main'

glx: Ignore all errors

See merge request GNOME/gtk!6065

2 years agoglx: Fake an X request to make GLX hack work
Benjamin Otte [Tue, 6 Jun 2023 03:13:39 +0000 (05:13 +0200)]
glx: Fake an X request to make GLX hack work

Sometimes, GLX can decide to use the previous request serial when faking
XErrors via __glXSendError() (look through the Mesa sources to enjoy).
This can cause the error trap we just installed to not feel responsible
for the error. And that makes GDK decide to immediately abort the
application.
That is not what we or GLX want.

So we use a no-op X Request to bump the request number so that when GLX
does its shenanigans, it uses a serial that our error trap will catch.

Fixes a crash in mutter's CI which apparently manages to drive GLX
without an X server.

2 years agoglx: Move error trap even further out
Benjamin Otte [Tue, 6 Jun 2023 02:57:12 +0000 (04:57 +0200)]
glx: Move error trap even further out

This way we only create one error trap for all attempts to create a
context instead of up to 3.

2 years agoglx: Ignore all errors
Benjamin Otte [Mon, 5 Jun 2023 17:12:29 +0000 (19:12 +0200)]
glx: Ignore all errors

In error cases, glXCreateContextAttribsARB() will always return NULL so
it is enough to run the loop until the first non-NULL context is
returned.

And at that point, we can just look at the return value and ignore all
errors.

2 years agoci: Build less for asan
Matthias Clasen [Tue, 6 Jun 2023 02:05:16 +0000 (22:05 -0400)]
ci: Build less for asan

The asan build is all about running the tests
with asan, so lets not waste time building
demos and examples.

2 years agoci: More asan test runs
Matthias Clasen [Tue, 6 Jun 2023 01:47:36 +0000 (21:47 -0400)]
ci: More asan test runs

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 6 Jun 2023 01:37:47 +0000 (01:37 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Revert "ci: More verbose output from asan"

See merge request GNOME/gtk!6063

2 years agoci: Disable headless tests under asan
Matthias Clasen [Tue, 6 Jun 2023 01:15:31 +0000 (21:15 -0400)]
ci: Disable headless tests under asan

Our use of LD_PRELOAD for these tests does not
sit right with asan, so just skip them in this
case.

2 years agoci: Tweak asan options
Matthias Clasen [Tue, 6 Jun 2023 01:09:51 +0000 (21:09 -0400)]
ci: Tweak asan options

Allow the allocator to return NULL, so our
g_try_malloc tests don't fail.

2 years agoci: Turn off LeakSanitizer
Matthias Clasen [Tue, 6 Jun 2023 00:56:00 +0000 (20:56 -0400)]
ci: Turn off LeakSanitizer

When it is enabled, almost every report from asan is
"LeakSanitizer has encountered a fatal error."
So try without.

2 years agoci: Reenable asan builds
Matthias Clasen [Mon, 5 Jun 2023 20:21:24 +0000 (16:21 -0400)]
ci: Reenable asan builds

This is an attempts to catch sporadic ci failures.

2 years agowayland: Free seat globals in dispose
Matthias Clasen [Mon, 5 Jun 2023 22:05:27 +0000 (18:05 -0400)]
wayland: Free seat globals in dispose

This matches what we do for the display globals.

2 years agogdk: Dispose seats when a display is closed
Matthias Clasen [Mon, 5 Jun 2023 22:04:12 +0000 (18:04 -0400)]
gdk: Dispose seats when a display is closed

We dispose the display itself. It does not make
sense to hold onto seat resources beyond that point.

2 years agowayland: Don't leak all globals
Matthias Clasen [Mon, 5 Jun 2023 21:18:10 +0000 (17:18 -0400)]
wayland: Don't leak all globals

2 years agowayland: Drop an unused field
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.

2 years agoRevert "ci: More verbose output from asan"
Matthias Clasen [Mon, 5 Jun 2023 18:52:15 +0000 (14:52 -0400)]
Revert "ci: More verbose output from asan"

This reverts commit 4f65c121b701c839552b89991d009c48d8636480.

2 years agoPost-release version bump
Matthias Clasen [Mon, 5 Jun 2023 11:39:28 +0000 (07:39 -0400)]
Post-release version bump

2 years ago4.11.3
Matthias Clasen [Mon, 5 Jun 2023 11:26:41 +0000 (07:26 -0400)]
4.11.3

2 years agoMerge branch 'search-entry-allocation' into 'main'
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

2 years agoMerge branch 'wip/otte/for-main' into 'main'
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

2 years agostringsorter: Handle NULL strings
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.

2 years agotestsuite: Make clipped-repeat test work universally
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.

2 years agorendernode: Scale repeat offscreens properly
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.

2 years agorendernode: Use cairo_set_device_offset()
Benjamin Otte [Sun, 21 May 2023 03:03:49 +0000 (05:03 +0200)]
rendernode: Use cairo_set_device_offset()

Simplifies the code.

2 years agotestsuite: Adapt color-matrix testcase
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.

2 years agotestsuite: fix memleak
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.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
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

2 years agogl: Free all tracked buffers
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.

2 years agosearchentry: Improve size allocation
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.

2 years agotext: Make the placeholder non-intrusive
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.

2 years agoMerge branch 'wip/otte/vulkan' into 'main'
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

2 years agovulkan: Create multiple render objects
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).

2 years agovulkan: Stop differentiating rounded from cicular corners
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.

2 years agovulkan: Cleanup: Initialize constants at the top
Benjamin Otte [Tue, 23 May 2023 03:32:35 +0000 (05:32 +0200)]
vulkan: Cleanup: Initialize constants at the top

2 years agovulkan: Add support for texture-scale nodes
Benjamin Otte [Tue, 23 May 2023 03:26:08 +0000 (05:26 +0200)]
vulkan: Add support for texture-scale nodes

2 years agovulkan: Split textures and samplers
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.

2 years agovulkan: Add a hackish way to handle empty children
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

2 years agovulkan: Convert blend shader
Benjamin Otte [Sun, 21 May 2023 02:42:02 +0000 (04:42 +0200)]
vulkan: Convert blend shader

Same work as crossfade shader pretty much.

2 years agovulkan: Update the cross-fade shader
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.

2 years agovulkan: Implement bindless texture rendering
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.

2 years agovulkan: Clip using scissors
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.

2 years agovulkan: Make scissoring an explicit operation
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.