Benjamin Otte
720ac700b3
gpu: Move the pattern code into the nodeprocessor
...
We need the nodeprocessor infrastructure to create patterns, so keeping
it in a different source file would just cause header headaches.
2024-01-07 07:22:50 +01:00
Benjamin Otte
373a6ab9f1
gpu: Add a texture cache
...
... and use it when drawing textures.
We'll need it in other places later, but for now that's what we have.
2024-01-07 07:22:50 +01:00
Benjamin Otte
57c1c95e75
gpu: Make frames carry a timestamp
...
Frames now carry a timestamp for when they are used.
This is mainly intended to attach timestamps to cached items (textures
or glyphs), but it could in theory also be used when profiling.
We use wallclock time here, not server time, because it's cheaper and
because we're more intereseted in the local machine we're rendering on.
2024-01-07 07:22:50 +01:00
Benjamin Otte
ffc117564b
gpu: Make patterns do opacity nodes
...
Of course, for now this only works for opacity nodes that contain color
nodes, but we're still building up to ore useful stuff here.
2024-01-07 07:22:50 +01:00
Benjamin Otte
ee3367697d
gpu: Move pattern code into its own file
...
Now we can extend the pattern creation easily - and we can add new
patterns quickly later.
Plus, we need to keep this file in sync with pattern.glsl and it's neat
when those 2 files reference only each other.
2024-01-07 07:22:50 +01:00
Benjamin Otte
c6e19f0384
gpu: Add float array to shaders and add an ubershader
...
... and use it for a naive color node implementation using both
so I can test it actually works.
2024-01-07 07:22:50 +01:00
Benjamin Otte
9df265acdc
gpu: Clip fallback nodes to current clip
...
Avoids uploading parts of the node that aren't visible.
2024-01-07 07:22:49 +01:00
Benjamin Otte
461d9b4052
gpu: Set scissor rect before clearing
...
The render area that restricts clearing on Vulkan needs to be respected
by the GL renderer, too.
2024-01-07 07:22:49 +01:00
Benjamin Otte
0ed45c5f40
gpu: Move global syncing out
...
This is necessary so that fallback code can properly sync itself,
instead of just add_node().
Fixes a bunch of glitches when fallbacks would be used.
2024-01-07 07:22:49 +01:00
Benjamin Otte
73ac2d0a1c
gpu: Add a flip_y argument to shader execution
...
Because GL flips its shit sometimes (ie when it's the framebuffer),
pass the height of the target as the flip variable, so commands
that need to operate on the pixels can flip the y axis around this value.
2024-01-07 07:22:49 +01:00
Benjamin Otte
57ab670991
gpu: Add handling for (rounded) clip node(s)
...
This is again mostly a copy of the Vulkan renderer.
It's a bit awkward codewise with the new invalidation framework,
because we need to cache the previous values individually now,
but it's a lot more finegrained, and we don't emit globals multiple
times when clips are nested.
2024-01-07 07:22:49 +01:00
Benjamin Otte
e2b5e0d17d
gpu: Add scissor operation
...
Nothing is using it yet (we don't do clipping) apart from initializing
the scissor rect at startup.
2024-01-07 07:22:49 +01:00
Benjamin Otte
77e05a4240
gpu: Add support for transform nodes
...
This essentially copies the Vulkan renderer machinery, but adapts it to
the new handling with pending globals.
2024-01-07 07:22:49 +01:00
Benjamin Otte
97c5bb284b
gpu: Document the coordinate systems we use
2024-01-07 07:22:49 +01:00
Benjamin Otte
286b473f55
gpu: Add gsk_gpu_image_get_projection_matrix()
...
... and use it to initialize the "proper" projection matrix to use in
shaders.
The resulting viewport will go from top left (0,0) to bottom right
(width, height) and the z clipping plane will go from -10000 to 10000.
2024-01-07 07:22:49 +01:00
Benjamin Otte
1152c93778
gpu: Handle container nodes
...
Now everything is slower because we upload every other node
individually!
2024-01-07 07:22:49 +01:00
Benjamin Otte
1a85d569e3
gpu: Add ability to run shaders
...
This heaves over an inital chunk of code from the Vulkan renderer to
execute shaders.
The only shader that exists for now is a shader that draws a single
texture.
We use that to replace the blit op we were doing before.
2024-01-07 07:22:49 +01:00
Benjamin Otte
bd114ab1a8
inspector: Learn about new renderers
2024-01-07 07:22:49 +01:00
Benjamin Otte
7a1f764910
gsk: Add new renderers to the GSK_RENDERER env var
...
Use:
"ngl" for the new GL renderer
"vulkan" for the new Vulkan renderer
2024-01-07 07:22:49 +01:00
Benjamin Otte
10f934f782
node-editor: Add the new renderer(s)
2024-01-07 07:22:49 +01:00
Benjamin Otte
97c60b84c8
gl: Undeprecate the NGL renderer for now
...
It's used for the new GPU renderer.
2024-01-07 07:22:49 +01:00
Benjamin Otte
bf89431464
gpu: Use gdk_draw_context_empty_frame() when appropriate
...
It's a new function, so make use of it.
2024-01-07 07:22:49 +01:00
Benjamin Otte
9ddae8aebc
gpu: Add outline of new GPU renderer
...
For now, it just renders using cairo, uploads the result to the GPU,
blits it onto the framebuffer and then is happy.
But it can do that using Vulkan and using GL (no idea which version).
The most important thing still missing is shaders.
It also has a bunch of copy/paste from the Vulkan renderer that isn't
used yet.
But I didn't want to rip it out and then try to copy it back later
2024-01-07 07:22:49 +01:00
Benjamin Otte
e3c70645f9
vulkan: Turn Vulkan instances into init/ref/unref
...
This is not yet used.
2024-01-07 07:22:49 +01:00
Benjamin Otte
1e54e838e0
vulkan: Remove GskVulkanRenderer
...
We want to introduce a new one next.
Technically, this breaks API, because gsk_vulkan_renderer_new() is going
away, but practically, we're gonna bring it back once we introduce that
renderer in a few commits.
2024-01-07 07:22:49 +01:00
Benjamin Otte
40854f2ae9
gsk: Add header guard to missing header
2024-01-07 07:22:49 +01:00
Matthias Clasen
5e8e877f95
Merge branch 'matthiasc/for-main' into 'main'
...
rect: Annotate some functions as pure
See merge request GNOME/gtk!6713
2024-01-06 22:47:49 +00:00
Matthias Clasen
99844c8ccf
rect: Annotate some functions as pure
...
gdk_rectangle_equal and gdk_rectangle_contains_point are pure.
2024-01-06 17:18:18 -05:00
Matthias Clasen
8418e4276a
Merge branch 'matthiasc/for-main' into 'main'
...
gdk: Make a warning more useful
See merge request GNOME/gtk!6712
2024-01-06 20:43:43 +00:00
Matthias Clasen
7693e7133d
inspector: Reorder the general tab
...
Put the devices below the monitors, for a more logical arrangement.
2024-01-06 09:49:37 -05:00
Matthias Clasen
e56f9dbeb8
inspector: Drop a size group
...
All this size group did was causing values to be needlessly
ellipsized. Drop it.
2024-01-06 09:49:37 -05:00
Matthias Clasen
282d66a604
inspector: Clean up the general tab
...
Put the Wayland protocols, GL and Vulkan extensions behind expanders,
so we have less scrolling surface by default.
2024-01-06 09:49:37 -05:00
Matthias Clasen
3f513f3cc7
x11: Add a forgotten empty_frame implementation
...
This was causing warnings when using GLX.
2024-01-06 09:36:25 -05:00
Matthias Clasen
854910cc17
gdk: Make a warning more useful
...
We can just print out what is missing where, instead of a riddle.
2024-01-06 09:36:25 -05:00
Matthias Clasen
6bc7ec3d4d
Merge branch 'fix-docs-links' into 'main'
...
docs: Fix: gdk->gtk links
See merge request GNOME/gtk!6711
2024-01-05 20:10:33 +00:00
Matthias Clasen
bda6530fea
docs: Fix: gsk->gtk links
...
gi-docgen can only generate links for dependencies, so we have
to manually expand to a relative url here.
2024-01-05 14:57:16 -05:00
Matthias Clasen
6227592dfa
docs: Fix: gdk->gtk and gdk->gsk links
...
gi-docgen can only generate links for dependencies, so we have
to manually expand to a relative url here.
fixup
2024-01-05 14:57:07 -05:00
Matthias Clasen
bc066de998
Merge branch 'wip/chergert/fix-6308' into 'main'
...
texthistory: fix potential NULL dereference
Closes #6308
See merge request GNOME/gtk!6709
2024-01-05 16:43:19 +00:00
Benjamin Otte
68980a5e3b
Merge branch 'wip/otte/for-main' into 'main'
...
testsuite: Add a test for a recent mipmap generation bug
See merge request GNOME/gtk!6710
2024-01-05 07:28:19 +00:00
Benjamin Otte
f200e8b132
reftests: Add a testcase for GtkGLArea::allowed-apis
...
See code comments for how it uses GL commands that should fail with GLES.
Related: !6520
2024-01-05 07:30:38 +01:00
Benjamin Otte
dde2d9b545
gl: Don't initialize texture storage in wrong format
...
We're calling glTexImage2D() right after with the correct format.
So add the special format "0" to avoid intializing the texture memory.
2024-01-05 07:20:32 +01:00
Benjamin Otte
ac64948efd
testsuite: Add a test for a recent mipmap generation bug
...
Tests the fix in ab1fba6fdc
.
Related: #6298
Related: !6704
2024-01-05 07:20:32 +01:00
Christian Hergert
dfe2141227
texthistory: fix potential NULL dereference
...
Fixes #6308
2024-01-04 09:40:04 -08:00
Emmanuele Bassi
1e1c973d71
Merge branch 'ebassi/doc-link-fixes' into 'main'
...
docs: Use second level headings for sections
See merge request GNOME/gtk!6708
2024-01-04 14:48:38 +00:00
Emmanuele Bassi
b69898228d
docs: Use second level headings for sections
...
The first level heading should be reserved for the class description.
2024-01-04 13:48:29 +00:00
Emmanuele Bassi
9c71469c67
docs: Fix link to GtkLabel.set_mnemonic_widget()
2024-01-04 13:48:06 +00:00
Emmanuele Bassi
a8b1c90303
docs: Fix link to GtkSnapshot.restore()
2024-01-04 13:47:29 +00:00
Matthias Clasen
69ffaab09f
Merge branch 'reduce-shortcuts-searchentry-width' into 'main'
...
shortcutswindow: Reduce default width of search entry
See merge request GNOME/gtk!6707
2024-01-04 13:42:18 +00:00
Mohammed Sadiq
9730d44252
shortcutswindow: Reduce default width of search entry
...
Reduce the default width of search entry so that it fits on smaller
screens (ie, screens having 360px or less width). Also, set max width
to the old value of 40, so that the search entry will have the same
old size if window width permits.
This commit won't make any difference on larger screens.
2024-01-04 18:51:42 +05:30
Matthias Clasen
f99e725391
Merge branch 'fix-dropdown-checkmark' into 'main'
...
dropdown: Fix initial checkmark
Closes #6305
See merge request GNOME/gtk!6705
2024-01-04 03:22:25 +00:00