Commit Graph

79748 Commits

Author SHA1 Message Date
Matthias Clasen
4c5fc2db89 Add a test for CSS variables 2024-04-21 14:35:26 -04:00
Alice Mikhaylenko
9faeea801e tmp tests 2024-03-20 23:11:36 +04:00
Alice Mikhaylenko
26aecbb006 tmp: Add libadwaita styles 2024-03-20 23:11:36 +04:00
Alice Mikhaylenko
17ccb849b3 csskeyframes: Support variables 2024-03-20 23:11:36 +04:00
Alice Mikhaylenko
4a3894e820 cssanimation: Recompute values while playing
This will be necessary for supporting variables in animations.
2024-03-20 23:11:36 +04:00
Alice Mikhaylenko
156a7450be cssvalue: Pass an extra GtkCssVariableSet to compute()
This will be useful for supporting variables in @keyframes.
2024-03-20 23:11:35 +04:00
Alice Mikhaylenko
b7988d133d Implement basic support for CSS variables 2024-03-20 22:46:32 +04:00
Alice Mikhaylenko
1baaeeb048 cssvalue: Add contains_variables()
We'll need this to know which values to recompute for animations.
2024-03-20 22:46:32 +04:00
Alice Mikhaylenko
63f489dc64 csstokenizer: Add save() and restore()
We'll need that to check if property values contain variables.
2024-03-20 22:46:32 +04:00
Alice Mikhaylenko
3323f08c75 cssselector: Support :root
This is useful for defining global variables.
2024-03-20 22:46:32 +04:00
Alice Mikhaylenko
35060aae8d cssprovider: Copy bytes when loading
We'll need to keep accessing them later to compute values with variables,
so we can't avoid this anymore.
2024-03-20 22:46:32 +04:00
Alice Mikhaylenko
c6c13ded6a csstokenizer: Fix an out of bounds when reading an ident followed by EOG
TODO: Split this into a separate MR, it's a preexisting bug.
2024-03-20 22:46:32 +04:00
Matthias Clasen
e1406d2e95 Merge branch 'matthiasc/for-main' into 'main'
gsk: Avoid some allocations

See merge request GNOME/gtk!7047
2024-03-18 12:26:37 +00:00
Daniel Rusek
2fe467983c Update Czech translation 2024-03-18 11:30:47 +00:00
Matthias Clasen
ee4a56ed4a settings: Mention the macOS implementation 2024-03-17 21:44:02 -04:00
Matthias Clasen
2408e227aa Add another xfail for clipped compare tests
These just keep happening.
2024-03-17 21:30:36 -04:00
Matthias Clasen
144cd2d91c gsk: Avoid some allocations
We can use a static font options object and allocate it only once.
2024-03-17 21:30:36 -04:00
Matthias Clasen
6abd9def55 Merge branch 'macos-popover-focus' into 'main'
macos: Fix IMContext for popovers

See merge request GNOME/gtk!7041
2024-03-17 16:55:52 +00:00
Martin
f5685cc0ae Update Slovenian translation 2024-03-17 10:28:21 +00:00
Martin
54bd03573e Update Slovenian translation 2024-03-17 10:26:36 +00:00
Matthias Clasen
bc81b33990 Merge branch 'matthiasc/for-main' into 'main'
Forgotten file

See merge request GNOME/gtk!7046
2024-03-17 03:05:56 +00:00
Matthias Clasen
de764d61ef Forgotten file 2024-03-16 22:26:22 -04:00
Matthias Clasen
68fa9bcf2e Merge branch 'matthiasc/for-main' into 'main'
4.14.1

See merge request GNOME/gtk!7045
2024-03-17 02:11:30 +00:00
Matthias Clasen
2f124bc712 Post-release version bump 2024-03-16 22:10:26 -04:00
Matthias Clasen
c648bb7b19 NEWS: Updates 2024-03-16 20:52:15 -04:00
Matthias Clasen
90956b15d9 docs: Small tweaks 2024-03-16 20:52:15 -04:00
Benjamin Otte
195ebf6848 Merge branch 'wip/otte/gl-map-buffer' into 'main'
Add GLBuffer implementation w/ persistent mapping

See merge request GNOME/gtk!7042
2024-03-17 00:27:51 +00:00
Benjamin Otte
0615b48318 Merge branch 'wip/otte/VYycQTm2HrM' into 'main'
gpu: Sort passes correctly

Closes #6318

See merge request GNOME/gtk!7044
2024-03-16 23:08:05 +00:00
Benjamin Otte
aff34e8d1b gpu: Sort passes correctly
In a very particular situation, it could happen that our renderpass
reordering did not work out.
Consider this nesting of renderpasses (indentation indicates subpasses):

pass A
  subpass of A
pass B
  subpass of B

Out reordering code would reorder this as:

subpass of B
subpass of A
pass A
pass B

Which doesn't sound too bad, the subpasses happen before the passes
after all.

However, a subpass might be a pass that converts the image for a texture
stored in the texture cache and then updates the cached image.
If "subpass of A" is such a pass *and* if "subpass of B" then renders
with exactly this texture, then "subpass of B" will use the result of
"subpass of A" as a source.

The fix is to ensure that subpasses stay ordered, too.

The new order moves subpasses right before their parent pass, so the
order of the example now looks like:

subpass of A
pass A
subpass of B
pass B

The place where this would happen most common was when drawing thumbnail
images in Nautilus, the GTK filechooser or Fractal.
Those images are usually PNG files, which are straight alpha. They are then
drawn with a drop shadow, which requires an offscreen for drawing as
well as those images as premultipled sources, so lots of subpasses happen.
If there is then a redraw with a somewhat tricky subregion, then the
slicing of the region code could end up generating 2 passes that each draw
half of the thumbnail image - the first pass drawing the top half and the
second pass drawing the bottom half.
And due to the bug the bottom half would then be drawn from the
offscreen before the actual contents of the offscreen would be drawn,
leading to a corrupt bottom part of the image.

Test included.

Fixes: #6318
2024-03-16 23:44:59 +01:00
Matthias Clasen
c05bb504ff Merge branch 'accessible-leaks' into 'main'
Fix leaks of GtkAccessible and GtkATContext

See merge request GNOME/gtk!7031
2024-03-16 21:39:43 +00:00
Benjamin Otte
47307dc7c1 vulkan: Prefer cached buffer memory
We write the buffers in small chunks, and we even sometimes read it. So
prefer it when it's cached.

Speeds up the text benchmarks by a factor of 3x on my dedicated GPU.
2024-03-16 22:32:49 +01:00
Matthias Clasen
16ea91c1fe Merge branch 'macos-fullscreen-resize' into 'main'
macos: Cleanup fullscreen state

See merge request GNOME/gtk!7043
2024-03-16 21:27:29 +00:00
Benjamin Otte
96b800fa0c gl: Add buffer implementation using persistent mapping
If glBufferStorage() is available, we can replace our usage of
glBufferSubData() with persistently mapped storage via
glMappedBufferRange().

This has 1 disadvantage:

1. It's not supported everywhere, it requires GL 4.4 or
   GL_EXT_buffer_storage. But every GPU of the last 10 years should
   implement it. So we check for it and keep the old code.
   The old code can also be forced via GDK_GL_DISABLE=buffer-storage.

But it has 2 advantages:

1. It is what Vulkan does, so it unifies the two renderers' buffer
   handling.

2. It is a significant performance boost in use cases with large vertex
   buffers. Those are pretty rare, but do happen with lots of text at a
   small font size. An example would be a small font in a maximized VTE
   terminal or the overview in gnome-text-editor.

A custom benchmark tailored for this problem can be created with:

  tests/rendernode-create-tests 1000000 text.node

This creates a node file called "text.node" that draws 1 million text
nodes.
(Creating that test takes a minute or so. A smaller number may be useful
on less powerful hardware than my Intel Tigerlake laptop.)
The difference can then be compared via:

  tools/gtk4-rendernode-tool benchmark --runs=20 text.node
and
  GDK_GL_DISABLE=buffer-storage tools/gtk4-rendernode-tool benchmark --runs=20 text.node

For my laptop, the difference is:
before: 1.1s
after:  0.8s

Related: !7021
2024-03-16 20:55:26 +01:00
Benjamin Otte
e7a2baf78c gpu: Remove unused arguments
It's not just unused, it's also wrong.

We are reading from the buffer when reallocating the vertex buffer
and memcpy()ing the old into the new buffer - at that point we read from
it.
2024-03-16 19:46:37 +01:00
Matthias Clasen
438d86fcf5 gsk: Move the buffer upload counter
Move the sysprof counter for buffer uploads to the generic
code, so it works for both ngl and Vulkan. This partially
reverts commit ecf1b7c18a.
2024-03-16 19:39:16 +01:00
Arjan Molenaar
4fd848c9de macos: Retrieve NSEvents based on event properties
We cannot depend on the exact event, since some events (e.g. for popups)
are rewritten. Therefore we need to determine the NSEvent based on
heuristics. The usual suspects are event type, device and timestamp.

This allows us to fix IMContext for popups.
2024-03-16 17:25:38 +01:00
Matthias Clasen
a23a7d4149 Merge branch 'maze-demo' into 'main'
demos: Make the maze demo non-resizable

Closes #6549

See merge request GNOME/gtk!7040
2024-03-16 14:41:27 +00:00
Matthias Clasen
1cbdf88b0f Merge branch 'debug-cleanup' into 'main'
gsk: Fix a typo

See merge request GNOME/gtk!7039
2024-03-16 14:41:16 +00:00
Benjamin Otte
0a0feef57d Merge branch 'wip/otte/gdk-gl-disable' into 'main'
Rework GL feature handling

See merge request GNOME/gtk!7038
2024-03-16 14:25:11 +00:00
Matthias Clasen
2701a2bfdd demos: Make the maze demo non-resizable
It isn't playable if the entrance/exit don't reach the edge
of the window.

Fixes: #6549
2024-03-16 10:08:37 -04:00
Benjamin Otte
2aea75f426 testsuite: Run the plain test without any args
Never do nothing.
2024-03-16 14:53:22 +01:00
Matthias Clasen
b1fb7cd4ae gsk: Drop unused debug flags
The 'surface', 'sync' and 'opengl' flags are not used anywhere.
2024-03-16 09:44:57 -04:00
Matthias Clasen
33ffe28236 docs: Clarify GSK_DEBUG=vulkan
Make it clearer what this debug flag does.
2024-03-16 09:44:57 -04:00
Matthias Clasen
fd90b56df6 gsk: Move and clarify a debug message
Move the only error message in the OPENGL category to RENDERER,
and make it clearer what and how.
2024-03-16 09:44:57 -04:00
Benjamin Otte
43373e6350 gpu: Rename env var GSK_GPU_SKIP to GSK_GPU_DISABLE
See previous commits.
2024-03-16 14:11:08 +01:00
Benjamin Otte
afd5ea53d8 vulkan: Rename env var from GDK_VULKAN_SKIP to GDK_VULKAN_DISABLE
It's a better name.
2024-03-16 14:03:36 +01:00
Benjamin Otte
f725bdad25 gl: Move GL_ARB_base_instance check
It's a GLContext feature check, not a GpuRenderer thing.

So put it there.
2024-03-16 13:52:28 +01:00
Benjamin Otte
cfbe3709bf gpu: Respect the GDK_GL_DISABLE flag
It's now possible to disable sync support.
2024-03-16 13:52:21 +01:00
Benjamin Otte
4e453acd4f gl: Remove the BGRA feature
Nobody is using it anymore now that we have format tracking for all
formats.
2024-03-16 13:44:02 +01:00
Benjamin Otte
3a04542146 gl: Add GDK_GL_DISABLE env var
This allows disabling certain GL features for testing, same as with
Vulkan.
2024-03-16 13:44:02 +01:00