Compare commits

...

134 Commits

Author SHA1 Message Date
Matthias Clasen 7e4745202c Add some more text rendering tests 2024-01-29 18:29:35 -05:00
Matthias Clasen 1564d768d3 Accept font options in node files
The goal is to fix all the context that influences the rendering
of text nodes in the node file. This includes the relevant parts
of cairo_font_options_t (via pango_cairo_context_set_font_options)
as well as the dpi (via pango_cairo_font_map_set_resolution).

The default values we use match the default of the gsettings backing
our GtkSettings:

hint-metrics: off;
hint-style: slight;
antialias: on;
dpi: 96;

This will help with better font testing.

Parser test included.
2024-01-29 18:29:35 -05:00
Matthias Clasen e80acf53fd node-editor: Drop a duplicated menu item 2024-01-29 18:29:35 -05:00
Benjamin Otte 1ffa01b38a Merge branch 'contentview-step1-finished' into 'main'
[macos] Use system shadow on macOS

Closes #6255

See merge request GNOME/gtk!6785
2024-01-29 18:09:33 +00:00
Matthias Clasen f93601ed2b Merge branch 'cache-weak-unref' into 'main'
gpu: Fix a problem with texture caches

Closes #6377

See merge request GNOME/gtk!6824
2024-01-29 13:24:56 +00:00
Matthias Clasen e1722777e5 Merge branch 'drag-out-of-fullscreen' into 'main'
gtk: Make window handles work when attached to fullscreen windows

See merge request GNOME/gtk!6825
2024-01-29 13:15:46 +00:00
Matthias Clasen 24850dff0e Merge branch 'fix-gc-context' into 'main'
gpu: Call make current before gc

Closes #6366

See merge request GNOME/gtk!6826
2024-01-29 13:13:43 +00:00
Matthias Clasen d790268031 gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 08:12:27 -05:00
Matthias Clasen 89712fc750 gpu: Fix syntax confusion. 2024-01-29 08:12:27 -05:00
Matthias Clasen 9b62a5c931 gpu: Drop an unused argument
The timestamp wasn't used in atlas creation.
2024-01-29 08:12:27 -05:00
Matthias Clasen fbf3836502 gpu: Drop excessive logging
This was logging every frame, which is too much.
2024-01-29 08:12:27 -05:00
Matthias Clasen 8d80f97597 gpu: free non-atlased glyphs
"Only free glyphs when their atlas is freed" works great for
glyphs that are on an atlas. Don't forget the others.
2024-01-29 08:12:27 -05:00
Matthias Clasen e6ec8133a5 gpu: Don't weak unref too much
We can reach the code that removes the item from the hash table
before or after the weak unref has triggered. Just leave the
weakref in place and let it do its thing, if it hasn't gone
off yet. That matches what we do in free.

Fixes: #6377
2024-01-29 08:11:25 -05:00
Matthias Clasen 6b436fdbbb gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 07:49:59 -05:00
Matthias Clasen 7b2b5469eb gpu: Call make current before gc
We do gc in a timeout, when an arbitrary GL context might be
current, so we need to make sure its ours and we don't free
random textures in another context.

Fixes: #6366
2024-01-29 07:39:57 -05:00
Benjamin Otte 3fc325d799 Merge branch 'dmabuf-texture-gst-v4l2' into 'main'
gstsink: Add support for DMABuf import and graphics offload

See merge request GNOME/gtk!6618
2024-01-29 11:06:11 +00:00
Ben Mather dee6742931 gtk: Allow windows to be dragged out of fullscreen using a window handle
Window handles allow windows to be dragged from maximized to restored,
but when the window is fullscreen they do nothing.  With this change,
windows will be unfullscreened when dragged.
2024-01-29 09:51:16 +00:00
Robert Mader d2097d0449 gstsink: Add support for DMABuf import and graphics offload
By implementing support for `GdkDmabufTextureBuilder` and
`GstVideoInfoDmaDrm`. This allows zero-copy video playback on Wayland
when paired with hardware video decoding.

Can be tested with `gtk4-demo --run=video_player`
2024-01-28 19:09:41 +01:00
Matthias Clasen c7f00d51eb Merge branch 'wayland-empty-frame' into 'main'
wayland: Add a way to check if a surface is dirty

See merge request GNOME/gtk!6822
2024-01-28 17:02:29 +00:00
Matthias Clasen f5308dfbec wayland: Commit empty frames if needed
If we have outstanding double-buffered state (other than the
buffer itself), commit a frame even if its 'empty'.
2024-01-28 11:44:16 -05:00
Matthias Clasen 1097e1349c wayland: Add a way to check if a surface is dirty
We keep various pieces of double-buffered state on our side,
and then explicitly sync it over to the Wayland side.

Add a function to find out if we have any.
2024-01-28 11:44:16 -05:00
Benjamin Otte d577e4421e Merge branch 'gpu-cache-fixes' into 'main'
gpu: Caching fixes

See merge request GNOME/gtk!6817
2024-01-28 16:13:25 +00:00
Matthias Clasen 1bac8b439a gpu: Be more aggressive about cache gc
Count dead pixels in textures (ie the number of pixels in GPU
textures that are no longer backed by an alive GdkTexture object),
and when the there's too many, do a gc before rendering the next
frame.
2024-01-28 11:00:07 -05:00
Matthias Clasen ee52e98b7d gpu: Redo texture caching
Count the uses of cached texture - from the device (via the linked
list) and from the texture (via render data / weak ref), and only
free the item once the use count reaches zero.
2024-01-28 10:50:46 -05:00
Matthias Clasen 5e4eda15c9 gpu: Trigger cache gc from the renderer
Instead of forever running a timeout to do gc, ensure the timeout
is scheduled whenever we render a frame (this is done by calling
gsk_gpu_device_maybe_gc () before gsk_gpu_frame_render (), and
gsk_gpu_device_queue_gc () after).
2024-01-28 10:50:19 -05:00
Matthias Clasen e861ea4bd2 gpu: Add a knob for cache GC
Read the GSK_CACHE_TIMEOUT environment variable to override the
default 15s timeout for cache gc. This is mainly meant for debugging.

Since we don't really need two knobs, reuse the gc timeout value
for the max age of items too.
2024-01-28 10:49:57 -05:00
Matthias Clasen 8009ed3a3c gpu: Add more details to debug spew
Print the number of items in the cache hash tables.
2024-01-27 19:50:45 -05:00
Matthias Clasen 1d95a171f6 gpu: Don't forget to unage cached textures
Whenever we successfully looking up a cached item, we need to
call use() on it to mark it as fresh.
2024-01-27 19:50:41 -05:00
Matthias Clasen e0136b283a Cosmetics 2024-01-27 19:49:58 -05:00
Matthias Clasen 42867c7a3c Cosmetics 2024-01-27 19:49:57 -05:00
Ekaterine Papava 40f20fee3d Update Georgian translation 2024-01-27 17:15:52 +00:00
Matthias Clasen 63e814a45f Merge branch 'matthiasc/for-main' into 'main'
node-editor: Make the crash warning work

Closes #6370

See merge request GNOME/gtk!6820
2024-01-27 16:43:08 +00:00
Matthias Clasen c1270cf52b gpu: Fix a crash in vulkan
The node processing wasn't skipping 0-size nodes when using the
uber shader, leading to assertions down the road. Since the ngl
renderer doesn't use uber shaders, this only affects vulkan.

Test included.

Fixes: #6370
2024-01-27 10:30:38 -05:00
Matthias Clasen f2ec2f2a58 node-editor: Make the crash warning work
In some cases, we leave behind both an autosave and an
autosave-unsafe file, so check for the unsafe one first.
2024-01-27 10:21:26 -05:00
Benjamin Otte e67bb62b1f Merge branch 'wip/otte/6363' into 'main'
gpu: Add support for MacOS default framebuffer

See merge request GNOME/gtk!6815
2024-01-27 15:15:38 +00:00
Matthias Clasen ee8a800763 Merge branch 'matthiasc/for-main' into 'main'
nodeparser: Fix a font handling mishap

See merge request GNOME/gtk!6818
2024-01-27 08:30:37 +00:00
Matthias Clasen 746cfe48b0 nodeparser: Fix a font handling mishap
When we don't have an embedded font file via a url, then we want
to parse fonts "as normal", i.e. allow fallback for aliases like
"Monospace 10". This was broken when the url support was added.
Make it work again.

Update affected tests. In particular, the output of the text-fail
test goes back to be the same it was before the url changes.
2024-01-26 23:54:58 -05:00
Benjamin Otte 3a93d52718 gpu: Add support for MacOS default framebuffer
This adds the same code as the GL renderer used to allow backends to
redirect rendering to a different framebuffer.

Related: #6363
2024-01-26 16:55:49 +01:00
Benjamin Otte 1994e1940c Merge branch 'wip/otte/6363' into 'main'
gpu: Don't use layout binding in old GL versions

Closes #6363

See merge request GNOME/gtk!6814
2024-01-26 15:46:08 +00:00
Benjamin Otte d74855fe9f gpu: Don't use layout binding in old GL versions
GL needs version 4.2 before it supports explicit bindings. We use GLES
usually, and Mesa supports GL 4.6, so we didn't hit this case before.

However, MacOS does use GL and Mac OS is stuck on GL 4.1.

Fixes #6363
2024-01-26 14:17:16 +01:00
Emmanuele Bassi 979749a3bc Merge branch 'ewlsh/add-accessible-relation-list' into 'main'
gtk: Add AccessibleList to enable relations in bindings

Closes #6358

See merge request GNOME/gtk!6807
2024-01-26 10:52:26 +00:00
Fran Dieguez 29c7725416 Update Galician translation 2024-01-26 09:57:16 +00:00
Matthias Clasen 3abf6acb16 Post-release version bump 2024-01-25 16:25:26 -05:00
Matthias Clasen df8cf0e030 Use software rendering for testsuite runs
We need to force software rendering, or test failures will cause
meson dist to fail.
2024-01-25 16:25:26 -05:00
Matthias Clasen 7952b2a0bc 4.13.6 2024-01-25 16:25:26 -05:00
Matthias Clasen c98e568583 Merge branch 'ngl-by-default' into 'main'
gsk: Change the default renderer

See merge request GNOME/gtk!6809
2024-01-25 20:41:32 +00:00
Matthias Clasen f90e77d173 gdk: Enable fractional scaling for GL by default
The ngl renderer has good support for fractional scaling, so we
can enable this by default now.

If you are using the gl renderer, you can disable fractional
scaling with the

GDK_DEBUG=gl-no-fractional

environment variable.
2024-01-25 14:41:04 -05:00
Matthias Clasen 98e3fca284 gsk: Change the default renderer
The intent of this change to get wider testing and verify that the
new renderers are production-ready. If significant problems show
up, we will revert this change for 4.14.

The new preference order is ngl > gl > vulkan > cairo.

The gl renderer is still there because we need it to support gles2
systems, and vulkan still has some rough edges in application support
(no gl area support, webkit only works with gl).

If you need to override the default renderer choice, you can
still use the GSK_RENDERER environment variable.
2024-01-25 14:41:04 -05:00
Benjamin Otte a7c98227e6 Merge branch 'wip/antoniof/fix-section-tiles' into 'main'
gtklistitemmanager fixes

See merge request GNOME/gtk!6805
2024-01-25 19:31:35 +00:00
Benjamin Otte f2856e494c Merge branch 'wip/otte/for-main' into 'main'
gpu: Fix variable

See merge request GNOME/gtk!6812
2024-01-25 19:26:44 +00:00
Benjamin Otte dc1f12682c testsuite: Add a test for zero width borders
See previous commit for an explanation of the problem.

This test actually draws a rounded border, but the rounding is clipped
away. What is remaining is the 4 corners of the border, where the
top/bottom color is red and the left/right color is green. But because
the bottom/right side has a width of zero, the result should be all red.
2024-01-25 19:39:34 +01:00
Benjamin Otte 502fb250ab gpu: Fix zero-width border corner rendering
When a border side has a width of 0 but we're having rounded corners, we
draw content in the edges of that side, and naturally pick its color.
That is wrong though, when the width is zero, we're supposed to keep
using the color of the other side in that corner.

So do that.

Fixes the border-corner-zero-width-rendering.ui reftest.
2024-01-25 19:39:34 +01:00
Benjamin Otte 7d7d3ff35c gpu: Fix variable
I had a test that allocated over 4GB of ops and...
2024-01-25 19:08:32 +01:00
António Fernandes 9fb449793d listitemmanager: Fix section change handler mistake
The statement is not doing what it was meant to do.

gtk_list_item_manager_get_nth (self, position, &offset) returns the
tile for a given position, and if the tile maps to more than 1 item,
the offset indicates how far into that tile the given position is.

So position - offset would give us the position of this tile. It
doesn't make sense to subtract it from n_items.

Instead, we should be adding the offset to compensate for having
landed too early in the list, such that we successfully reach
position + n_items.
2024-01-25 17:35:56 +00:00
António Fernandes 3d88c44803 listitemmanager: Don't doubly-recycle widget
When there is a duplicate item in the hash table of deleted items, we:

1. Unparent the unparent the old `widget` value (gtk_widget_unparent is
   passed as `GDestroyNotify value_destroy_func` for the hastable).
2. Set the new `widget` value in the hashtable.
3. Also set the same `widget` in the recycled queue.

This means the same widget is found in the 2 containers and, therefore,
the same widget may be returned twice by gtk_list_item_change_get().
Alternatively, this means we may reuse the item by taking it from the
hashtable and reassigning it to a tile, but then it ends up getting
unparented by gtk_list_item_change_finish(). Or we don't take it at
all and end up calling gtk_widget_unparent()` on it twice, which may
result in use-after-free on the second call the parent was holding the
last reference.

This was introduced by 76d601631d

Previously, gtk_list_item_manager_release_list_item() would just emit
the warning but otherwise do nothing. Let's restore that behavior.
2024-01-25 17:35:56 +00:00
António Fernandes b05000d8bd listitemmanager: Remove section when adding at its end
We are failing to go from this:

    [ BLUE ] [ RED ]

...to this:

    [ BLUE GREEN YELLOW ] [ RED ]

...where '[' and ']' represent section header and footer.

Instead, the result is...

    [ BLUE ] [ GREEN YELLOW ] [ RED ]

... despite the first 3 items belonging to the same section according
to the section model. This leaves the view in an inconsistent state
and, ultimately, to crashes the non-removed footer.

Indeed, when receiving items-changed(1,0,2), we call `append_items()`
which inserts a new tile before the tile at `1` (which was RED), and
then notices there is a HEADER right befo-re it, so it flags both it
and the corresponding FOOTER as unmatched:

    [ BLUE ] ( GREEN-YELLOW RED )

... where '(' and ')' represent unmatched header and footer.

Problem is subsequent code in `release_items()` doesn't even touch
the section boundary footer-header pair ('] ('), because they are
belong in the tracked interval (visible items). And `ensure_items()`
proceeds to match the header with a new footer, producing the result
described above.

To handle this correctly, `append_items()` must delete the section
boundary, and flag as unmatched both the HEADER of the section before
and the FOOTER of section after (whose respective footer and header
has been marked for removal):

    ( BLUE . . GREEN-YELLOW RED )

... where '.' represents tiles marked for removal.

This way, `release_items()` will release the removed footer-header
section boundary, and `ensure_items()` is going to reinstate new
section remove the section boundary at the correct place, resulting
in the expected behavior:

    [ BLUE GREEN YELLOW ] [ RED ]
2024-01-25 17:22:32 +00:00
António Fernandes 4b45adaf39 testsuite: Test inserting items at sections
We are not catching bugs when inserting if we're right at a boundary.

This because we never add or remove items from a section. We only ever
add or remove whole sections.

Introduce a test which inserts items at a random position inside of a
section.
2024-01-25 17:16:00 +00:00
Maximiliano Sandoval 6f2d33369b docs: Add favicons
Requires gi-docgen main.
2024-01-25 17:06:24 +01:00
Matthias Clasen e08727fa47 Merge branch 'gpu-cache-stats' into 'main'
gpu: cache eviction

Closes #6346

See merge request GNOME/gtk!6784
2024-01-25 15:08:36 +00:00
Matthias Clasen 7624e6621a gpu: Add profiler marks around cache gc 2024-01-25 09:41:49 -05:00
Matthias Clasen cdddb6cb96 gpu: Print more detailed cache statistics
Print out stale glyphs and dead pixel ratios.
2024-01-25 09:41:49 -05:00
Matthias Clasen f6c01a7674 gpu: Fix ordering problem in clear_cache()
We must free the glyphs before their atlases, since we now maintain
the dead pixel count of the atlas when glyphs are freed.
2024-01-25 09:41:49 -05:00
Matthias Clasen ffa5bf1b7d gpu: Fix atlas freeing
We need to unset current_atlas if we free that one.
2024-01-25 09:41:49 -05:00
Matthias Clasen 4c6e623ec5 gpu: Keep track of atlas use
Count how many dead pixels we have, and free the atlas if more than
half of its pixels are dead.

As part of this, change when glyphs are freed. We now keep them
in the hash table until their atlas is freed and we only do dead
pixel accounting when should_collect is called. This keeps the
glyphs available for use from the cache as long as are in the atlas.

If a stale glyph is sused, we 'revive' it by removing its pixels
from the dead.

This matches more closely what the gl renderer does.
2024-01-25 09:41:48 -05:00
Matthias Clasen 621ef0703a gpu: Make atlas freeing more robust
Currently, we don't free an atlas before all its glyphs are gone,
but we might revisit that in the future, so be prepared for it.
2024-01-25 09:40:58 -05:00
Matthias Clasen f514caadb0 gpu: Evict stale glyphs from the cache
Same story as for textures: if it hasn't been used for 4 seconds,
it is stale and can go.
2024-01-25 09:40:58 -05:00
Matthias Clasen 4d92093c67 gpu: Fix texture eviction
If we gc a cached texture for which the GdkTexture is still alive,
the cached texture object will remain accessible via the render
data, so need to make sure not to leave a dangling pointer behind
here.
2024-01-25 09:40:58 -05:00
Matthias Clasen bd9ea05ebb gpu: Evict stale textures from the cache
This is straightforward. If a texture hasn't been used for 4 seconds,
we consider it stale, and drop it the next time gc comes around.

The choice of 4 seconds is arbitrary.

Fixes: #6346
2024-01-25 09:40:58 -05:00
Matthias Clasen e8599bd36e gpu: Start doing cache gc
Call the gc function periodically from a timeout to collect
stale cached items.
2024-01-25 09:40:58 -05:00
Matthias Clasen 1accd0c1ba gpu: Print some cache stats
This reuses the GLYPHCACHE debug flag that is used for the same
purpose in the gl renderer.
2024-01-25 09:40:58 -05:00
Matthias Clasen 14488041bc gpu: Add a static assertion
Stating the obvious, maybe.
2024-01-25 09:40:58 -05:00
Emmanuele Bassi c11b29583e Merge branch 'gbsneto/a11y-cleanups-1' into 'main'
Unassorted a11y cleanups

See merge request GNOME/gtk!6808
2024-01-25 12:58:34 +00:00
Arjan Molenaar 9467243ac3 Properly unset the use_client_shadow flag 2024-01-25 13:11:13 +01:00
Evan Welsh 32f1f7280b gtk: Add AccessibleList to enable relations in bindings
Bindings need a boxed type to "wrap" lists of Gtk.Accessible objects.

Closes #6358
2024-01-25 03:39:49 -08:00
Yosef Or Boczko ff81104834 Update Hebrew translation 2024-01-25 11:35:41 +00:00
Arjan Molenaar 6e7893d527 Let GdkDisplay decide if shadows should be drawn
Replace the `#ifdef` blocks by a backend call.
2024-01-25 12:09:10 +01:00
Arjan Molenaar 6efe5eefd3 Differentiate between compositing and frame extents support
* If the WM supports compositing, we can use CSD with rounded corners.
* If the WM supports frame extents, we can use client side shadows.
2024-01-24 21:57:44 +01:00
Fran Dieguez 3fd869a8ba Update Galician translation 2024-01-24 00:33:44 +00:00
Georges Basile Stavracas Neto d337eed643 a11y/atspicontext: Remove empty constructed override
It does nothing.
2024-01-23 19:09:57 -03:00
Georges Basile Stavracas Neto 296d44159b a11y/atspi/root: Chain up to finalize
The gtk_at_spi_root_finalize() function currently chains up to
dispose(),
which is probably a copy-paste mistake since gtk_at_spi_root_dispose()
exists and also chains up to dispose().

Chain up to finalize().
2024-01-23 19:09:57 -03:00
Georges Basile Stavracas Neto 4ce9f9b3ac gtk/atcontext: Cleanup a11y backends list
Declaring a separate entry for Wayland and X11 is not very useful when
both just end up calling the same constructor. Also, in theory, this
can cause the Wayland entry to be picked up on X11 if both backends
are enabled (which is the common case).

Not that it matters, since the 'name' field is unused.

Nonetheless, clean it up to be a single entry
2024-01-23 19:09:57 -03:00
Georges Basile Stavracas Neto 9fb37229a1 atcontext: Remove end sentinel from array
This array is iterated using G_N_ELEMENTS(), which means it always
iterates a well known number of times.

Remove the sentinel.
2024-01-23 19:09:57 -03:00
Georges Basile Stavracas Neto c8299f5b3e atcontext: Move variable declaration to top
This conforms better to the GTK C coding style.
2024-01-23 19:09:57 -03:00
Georges Basile Stavracas Neto f019a325ef atcontext: Use size_t for loop iterator
G_N_ELEMENTS() returns a division of two size_t values, which results
in a size_t value.

This is just a cleanup, no functional change.
2024-01-23 19:09:57 -03:00
Matthias Clasen 0d69b723fc Merge branch 'matthiasc/for-main' into 'main'
Clean up some accidents

See merge request GNOME/gtk!6802
2024-01-23 11:47:52 +00:00
Benjamin Otte d632258abb Merge branch 'wip/otte/subpixel-positioning' into 'main'
Add subpixel positioning for GPU renderer

See merge request GNOME/gtk!6799
2024-01-23 06:38:32 +00:00
Benjamin Otte 969fc17737 testsuite: Disable test on cairo
With the --repeat version of this test, Cairo needs to draw partially
clipped glyphs. However, there's a bug in Cairo where it doesn't account
for the subpixel positioning when clipping, so the glyphs get cut off at
the edge.

This is filed as https://gitlab.freedesktop.org/cairo/cairo/-/issues/821
2024-01-23 07:12:33 +01:00
Benjamin Otte ada0ea0f68 testsuite: Add subpixel positioning test for hidpi
On hidpi (ie scaled by 2x) we want to align to the pixel grid, not the
unit grid.

The GL renderer currently gets that wrong, so it's disabled here.
2024-01-23 06:17:14 +01:00
Benjamin Otte fff912efd3 testsuite: Add a test for subpixel positioning
Draw a grid of 21x21 box glyphs.

Each glyph is offset by n/20 pixels in the x and y direction.

The background color is carefully selected to be divisible by 16, so
that when the box glyph is subpixel positioned by 1/4th of a pixel
offset from the pixel grid in either direction, the result will be an
edge pixel whose color value can be computed exactly.

Cairo still rounds this wrong for color values >= 128 which is why we
use a dark gray that guarantees the resulting color values are all <128.
2024-01-23 06:17:14 +01:00
Benjamin Otte c31b6ff1d5 gpu: Implement subpixel positioning
This makes glyph rendering match the Cairo and GL renderers.
2024-01-23 06:17:14 +01:00
Benjamin Otte cf4b9dcb4d gpu: Align glyphs to the pixel grid
Add GSK_GPU_SKIP=glyph-align to turn off the glyph aligning.

FIXME: Should this be handled by the renderer at all or should we rely
on higher rendering layers to align glyphs properly?

This is kind of a tricky question just like with texture-scale nodes and
NEAREST filtering, because rendernodes can be embedded in other nodes
that disturb the pixel grid.
2024-01-23 06:17:14 +01:00
Benjamin Otte 549c8aec4a testsuite: Add tests for the recent repeat node fixes
Make sure to test horizontal and vertical versions, because who knows...
2024-01-23 06:17:14 +01:00
Benjamin Otte b7f7487b53 cairo: Fix wrong offset when tiling repeat nodes 2024-01-23 06:17:14 +01:00
Benjamin Otte dfc34b7295 gpu: Offset tiles properly
When drawing repeat nodes as tiles, this could result in wrong
renderings when the tiles were clipped wrong.
2024-01-23 06:17:14 +01:00
Matthias Clasen 83230766b2 Avoid a strdup
Not that it matters, but it looks cleaner that way.
2024-01-23 00:08:15 -05:00
Matthias Clasen 3bd1f491d1 node-editor: Remove some dead code
We ended up not needing a map implementation after all.
Remove the vestiges.
2024-01-23 00:07:23 -05:00
Matthias Clasen 2c1562630d Revert an accidental change
This snuck in with some recent cleanups.
2024-01-23 00:07:23 -05:00
Benjamin Otte 3451c2e72c Merge branch 'wip/otte/for-main' into 'main'
gsk: Respect offscreen_for_opacity of first child

Closes #6350

See merge request GNOME/gtk!6800
2024-01-22 17:52:33 +00:00
Benjamin Otte 00be97e741 gsk: Respect offscreen_for_opacity of first child
The container node constructor forgot to initialize that value from the
first child.

Testcase included.

Fixes #6350
2024-01-22 18:22:50 +01:00
Arjan Molenaar f947aafc2e Reset window transparency and shadow properties
... so that if a window is unrealized and realized again
that you end up in a stable form.
2024-01-22 16:22:56 +01:00
Arjan Molenaar 3e9f2aa4bb Differentiate between transparency and client side shadows
Transparency we need to support rounded corners. Client-side
shadows we need on platforms where the window manager does not
do them (mainly Wayland and X11). On platforms that support shadows
by default (macOS, Windows), we can just use them.
2024-01-22 16:22:56 +01:00
Paul Rouget a6ce506714 [macos] Use FullSizeContent for CSD 2024-01-22 16:22:36 +01:00
Matthias Clasen 9b9e8b385e Merge branch 'matthiasc/for-main' into 'main'
Tweak profiling strings

See merge request GNOME/gtk!6796
2024-01-22 13:46:52 +00:00
Emmanuele Bassi d3f30e73d0 Merge branch 'gtypes-doc-fix' into 'main'
droptarget: Fix GType in doc strings

See merge request GNOME/gtk!6798
2024-01-22 12:15:31 +00:00
Alexandre Franke 257706ba0a Update French translation
(cherry picked from commit 92862dfeec)
2024-01-22 12:09:29 +00:00
Guido Günther 2bc38e103d droptarget: Fix GType in doc strings
While we have several `GType`s the actual type name is still singular.
2024-01-22 12:30:56 +01:00
Benjamin Otte 60b3e5cac1 Merge branch 'wip/otte/for-main' into 'main'
gpu: Handle a full cache

See merge request GNOME/gtk!6797
2024-01-22 07:48:36 +00:00
Benjamin Otte d14932474b testsuite: clip the node
Clip from 1025px (which is what this test is about) to 1024px because the
GLES2 renderer in CI otherwise scales its repeat node offscreen for the
--repeat version of this test and that conveniently produces off-by-one
misrenderings everywhere.

However, we need to keep the image large enough so that all the glyphs
are actually rendered and not skipped which would not overflow the
cache.
2024-01-22 08:30:16 +01:00
Benjamin Otte f0982e2683 testsuite: Overflow slices of glyph cache
This test is specifically engineered to trigger an overflow in the glyph
renderer that was theorized on IRC with an earlier patchset.

If only one slice was available, and that slice was not high enough to
hold the glyph we were trying to put in there, it would allocate a slice
that was too small. The check for the size was missing.

So now add a test that fills up all the slices in the glyph cache apart
from one and than tries to add one final glyph that is too large for the
last slice.
2024-01-22 07:47:35 +01:00
Benjamin Otte d8fbaf5d4f testsuite: Add a test to exhaust the glyph cache
See previous commit.
2024-01-22 07:47:10 +01:00
Benjamin Otte 183d712252 gpu: Handle a full cache
Previously, we only checked if the cache had exhausted the maximum
number of slices.
But we also need to check that the height of the slices doesn't exceed
the height of the texture.
2024-01-22 07:47:10 +01:00
Benjamin Otte 3eb5447376 rendernodeparser: Improve error handling for font parsing
After the node-editor crashed on me once too often, I decided to take a
good hard look at the parsing code and add a bunch of weird corner
cases into the testsuite.

That meant redoing the parser so that the error paths cause neither
crashes nor duplicated or wrong error messages.
2024-01-22 07:47:10 +01:00
Benjamin Otte 976c5077b9 css: Add gtk_css_parser_has_url()
This function wasn't needed so far so I didn't add it.
The next commits will use it.

I made has_url() return TRUE for the BAD_URL token, even though a
BAD_URL is not a valid URL. But parsing code will almost always want to
treat these tokesn the same way it would treat otherwise bad urls, so
returning TRUE here makes it go own the right error path in calling
code.
2024-01-22 07:47:10 +01:00
Benjamin Otte 4e00384830 testsuite: Remove duplicate newline 2024-01-22 07:47:10 +01:00
Matthias Clasen f779832861 Tweak profiling strings
Capitalize our mark names, and use GTK as category.

The justification is: it looks better in sysprof.
2024-01-21 14:02:08 -05:00
Matthias Clasen a482cb5d25 Merge branch 'matthiasc/for-main' into 'main'
gl: Fix text carets going missing on NVidia

Closes #6348

See merge request GNOME/gtk!6795
2024-01-21 14:42:54 +00:00
Matthias Clasen f781039aa2 gsk: Add a testcase for underlines and carets
The gl renderer has an optimization where it uses the glyph atlas
to render color nodes that show up in the middle of text (e.g. for
underlines and carets). This adds a simple test for that scenario,
which hits this codepath.
2024-01-21 09:29:57 -05:00
Matthias Clasen 6e8a70ada1 Drop gdk_gl_context_has_bgra
This private api turned out to be more problematic than useful,
and it isn't used anymore.
2024-01-21 08:29:33 -05:00
Matthias Clasen c43294c837 gl: Fix text carets going missing on NVidia
Use the same logic for uploading the 'corner pixel' that we use
for uploading glyphs, since that works.

Fixes: #6348
2024-01-21 08:22:47 -05:00
Matthias Clasen 761995ce3c Merge branch 'bilelmoussaoui/file-fixes' into 'main'
gtk: Allow a nullable file in FileChooser.set_current_folder

See merge request GNOME/gtk!6794
2024-01-21 12:01:33 +00:00
Bilal Elmoussaoui d164dd3146 gtk: Allow a nullable file in FileChooser.set_current_folder
To match the annotation
2024-01-21 09:36:30 +01:00
Matthias Clasen 4b9b55ab17 Merge branch 'gl-fix-big-glyphs' into 'main'
gl: Avoid a use-after-free

Closes #6347

See merge request GNOME/gtk!6791
2024-01-20 19:16:56 +00:00
Artur S0 6e9767c7c1 Update Russian translation 2024-01-20 18:59:41 +00:00
Matthias Clasen b2f783b70b gl: Avoid a use-after-free
This only happens with big, non-atlased glyphs, so it is rare, but
it gets triggered by the Masking demo in gtk4-demo.

Fixes: #6347
2024-01-20 13:33:54 -05:00
Matthias Clasen 5a68426c9a Merge branch 'bilelmoussaoui/gi-stuff' into 'main'
gi/docs: Document GtkGraphicsOffloadEnabled

See merge request GNOME/gtk!6790
2024-01-20 17:48:21 +00:00
Bilal Elmoussaoui 32d77fa874 gi/docs: Document GtkGraphicsOffloadEnabled
Mostly to add since annotation
2024-01-20 17:18:26 +00:00
Matthias Clasen 8d00af6351 Merge branch 'matthiasc/for-main' into 'main'
gsk: Inline some more rect functions

See merge request GNOME/gtk!6789
2024-01-20 17:11:48 +00:00
Matthias Clasen a91a0720f5 gl: Consistently use float apis 2024-01-20 11:52:42 -05:00
Matthias Clasen f01208ad94 gpu: Consistently use ceilf
There was a mix of ceil() and ceilf() calls here, but the arguments
are always floats, so use ceilf() throughout.
2024-01-20 11:33:59 -05:00
Matthias Clasen 56b955f819 roundedrect: Use fabsf
The arguments are floats.
2024-01-20 11:33:59 -05:00
Matthias Clasen 0d7761269c gpu: Use gsk_rect_scale 2024-01-20 11:33:59 -05:00
Matthias Clasen 9ebaafa2af gsk: Inline some more rect functions
When we use graphene_rect_scale, the rect is always normalized,
so we can avoid some overhead here.
2024-01-20 11:33:59 -05:00
Matthias Clasen 25ea6beb39 inspector: Fix a typo 2024-01-20 09:38:53 -05:00
Matthias Clasen 905bb2c6fd Merge branch 'matthiasc/for-main' into 'main'
gpu: Cosmetics

See merge request GNOME/gtk!6788
2024-01-20 13:51:43 +00:00
131 changed files with 8551 additions and 1081 deletions
+79 -1
View File
@@ -1,6 +1,84 @@
Overview of Changes in 4.13.6, xx-xx-xxxx
Overview of Changes in 4.13.7, xx-xx-xxxx
=========================================
Overview of Changes in 4.13.6, 25-01-2024
=========================================
This release changes the ngl renderer to be the default renderer.
The intent of this change is to get wider testing and verify that
the new renderers are production-ready. If significant problems
show up, we will revert this change for 4.14.
You can still override the renderer choice using the GSK_RENDERER
environment variable.
Since ngl can handle fractional scaling much better than the old gl
renderer, we allow fractional scaling by default with gl now. If you
are using the old gl renderer (e.g. because your system is limited to
GLES2), you can disable fractional scaling by setting the GDK_DEBUG
environment variable to include the gl-no-fractional key.
* GtkColumnView:
- Fix infinite loops in dispose
- Fix problems with weak ref cycles in GtkExpression
* GtkListView:
- Fix some corner cases with sections during insertions and deletions
- Don't double-recycle widgets
* GtkStack:
- Add automatic cleanup for GtkStackPage
* GDK:
- Use standard cursor names for drag cursors
- Enable fractional scaling with gl by default
* GSK:
- Many fixes and improvements to the unified renderers:
- Fix text rendering with the uber shader
- Fix rounding issues with fractional scales
- Fix some memory leaks
- Many text rendering fixes
- Implement subpixel positioning for glyphs
- Support custom fonts in node files
- Add tests for font rendering
- Fix drawing of repeat nodes
- Implement subpixels positioning
- Evict stale textures, glyphs and atlases from the cache
- Some fixes and improvements to the GL renderer:
- Fix problems with GLES on Nvidia
- Avoid a crash in the mask demo
- Respect opacity of the first child node in containers
- Some fixes and improvements to the fallback renderer:
- Fix drawing of repeat nodes
- Make ngl the default renderer
* Wayland:
- Fix problems with tablet cursors
- Fix problems without seats
* Accessibility:
- Respect a separate "show-status-shapes setting
- Fix change notification for accessible names on some widgets
* Inspector:
- Show the git commit in devel builds
* Tools:
- Make gtk4-node-editor autosave its contents
- Add a benchmark command to gtk4-rendernode-tool
* Translation updates:
French
Galician
Georgian
Occitan
Persian
Russian
Vietnamese
Overview of Changes in 4.13.5, 07-01-2024
=========================================
+6 -25
View File
@@ -1567,23 +1567,6 @@ edit_action_cb (GtkWidget *widget,
node_editor_window_edit (self, &start);
}
static void
node_editor_window_map (GtkWidget *widget)
{
char *path;
GTK_WIDGET_CLASS (node_editor_window_parent_class)->map (widget);
path = get_autosave_path (NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
{
g_free (path);
return;
}
g_free (path);
}
static void
node_editor_window_set_property (GObject *object,
guint prop_id,
@@ -1660,8 +1643,6 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
widget_class->realize = node_editor_window_realize;
widget_class->unrealize = node_editor_window_unrealize;
widget_class->map = node_editor_window_map;
properties[PROP_AUTO_RELOAD] = g_param_spec_boolean ("auto-reload", NULL, NULL,
TRUE,
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME);
@@ -1765,16 +1746,16 @@ set_initial_text (NodeEditorWindow *self)
path = get_autosave_path (NULL);
path1 = get_autosave_path ("-unsafe");
if (g_file_get_contents (path, &initial_text, &len, NULL))
{
gtk_text_buffer_set_text (self->text_buffer, initial_text, len);
g_free (initial_text);
}
else if (g_file_get_contents (path1, &initial_text, &len, NULL))
if (g_file_get_contents (path1, &initial_text, &len, NULL))
{
self->auto_reload = FALSE;
gtk_revealer_set_reveal_child (GTK_REVEALER (self->crash_warning), TRUE);
gtk_text_buffer_set_text (self->text_buffer, initial_text, len);
g_free (initial_text);
}
else if (g_file_get_contents (path, &initial_text, &len, NULL))
{
gtk_text_buffer_set_text (self->text_buffer, initial_text, len);
g_free (initial_text);
}
-4
View File
@@ -10,10 +10,6 @@
<attribute name="label" translatable="yes">_Help</attribute>
<attribute name="action">app.help</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Help</attribute>
<attribute name="action">app.help</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Inspector</attribute>
<attribute name="action">app.inspector</attribute>
+10 -6
View File
@@ -322,12 +322,16 @@ stroke bounds of the path.
### text
| property | syntax | default | printed |
| -------- | ------------------- | ------------------- | ----------- |
| color | `<color>` | black | non-default |
| font | `<string>` `<url>`? | "Cantarell 11" | always |
| glyphs | `<glyphs>` | "Hello" | always |
| offset | `<point>` | 0 0 | non-default |
| property | syntax | default | printed |
| ------------ | ------------------- | ------------------- | ----------- |
| color | `<color>` | black | non-default |
| font | `<string>` `<url>`? | "Cantarell 11" | always |
| glyphs | `<glyphs>` | "Hello" | always |
| offset | `<point>` | 0 0 | non-default |
| hint-metrics | `<hint metrics>` | off | non-default |
| hint-style | `<hint style>` | slight | non-default |
| antialias | `<antialias>` | on | non-default |
| dpi | `<number>` | 96 | non-default |
Creates a node like `gsk_text_node_new()` with the given properties.
+2
View File
@@ -25,6 +25,8 @@ base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/"
[extra]
content_images = [
"../images/favicon.svg",
"../images/favicon-192x192.png",
"images/gtk-logo.svg",
]
urlmap_file = "urlmap.js"
+2
View File
@@ -24,6 +24,8 @@ base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/"
[extra]
content_images = [
"../images/favicon.svg",
"../images/favicon-192x192.png",
"images/gtk-logo.svg",
]
urlmap_file = "urlmap.js"
+2
View File
@@ -67,6 +67,8 @@ content_files = [
"macos.md",
]
content_images = [
"../images/favicon.svg",
"../images/favicon-192x192.png",
"images/gtk-logo.svg",
"images/rotated-text.png",
"images/default_cursor.png",
+2
View File
@@ -36,6 +36,8 @@ content_files = [
"paths.md",
]
content_images = [
"../images/favicon.svg",
"../images/favicon-192x192.png",
"gtk-logo.svg",
"images/arc-dark.png",
"images/arc-light.png",
+2
View File
@@ -85,6 +85,8 @@ content_files = [
"visual_index.md",
]
content_images = [
"../images/favicon.svg",
"../images/favicon-192x192.png",
"images/aboutdialog.png",
"images/action-bar.png",
"images/appchooserbutton.png",
+9 -2
View File
@@ -220,8 +220,8 @@ A number of options affect behavior instead of logging:
`gl-disable`
: Disable OpenGL support
`gl-fractional`
: Enable fractional scaling for OpenGL. This is experimental
`gl-no-fractional`
: Disable fractional scaling for OpenGL.
`gl-debug`
: Insert debugging information in OpenGL
@@ -460,6 +460,13 @@ disable certain optimizations of the "ngl" and "vulkan" renderer.
The special value `all` can be used to turn on all values. The special
value `help` can be used to obtain a list of all supported values.
### `GSK_CACHE_TIMEOUT`
Overrides the timeout for cache GC in the "ngl" and "vulkan" renderers.
The value can be -1 to disable GC entirely, 0 to force GC to happen
before every frame, or a positive number to do GC in a timeout every
n seconds. The default timeout is 15 seconds.
### `GSK_MAX_TEXTURE_SIZE`
Limit texture size to the minimum of this value and the OpenGL limit
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="88.572334" height="96.050743" id="svg6843">
<defs id="defs6845"/>
<g transform="translate(-19.822308,-16.115941)" id="layer1">
<path d="M 20.88413,30.82696 53.816977,55.527708 107.33282,39.060543 70.587303,17.177763 20.88413,30.82696 z" id="path6976" style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
<path d="m 22.94243,82.287118 -2.0583,-51.460158 32.932847,24.700748 0,55.577152 L 22.94243,82.287118 z" id="path6978" style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
<path d="m 53.816977,111.10486 49.399213,-20.58416 4.11663,-51.460157 -53.515843,16.467165 0,55.577152 z" id="path6980" style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
<path d="M 23.216626,81.319479 70.48573,67.361442 103.38422,90.444516" id="path6982" style="fill:none;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
<path d="m 70.434539,17.875593 0,49.109284" id="path6984" style="fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

+2 -4
View File
@@ -123,7 +123,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals" },
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals" },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
{ "gl-fractional", GDK_DEBUG_GL_FRACTIONAL, "Enable fractional scaling for OpenGL (experimental)" },
{ "gl-no-fractional", GDK_DEBUG_GL_NO_FRACTIONAL, "Disable fractional scaling for OpenGL" },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
{ "gl-disable-gl", GDK_DEBUG_GL_DISABLE_GL, "Only allow OpenGL GLES API" },
{ "gl-disable-gles", GDK_DEBUG_GL_DISABLE_GLES, "Don't allow OpenGL GLES API" },
@@ -222,7 +222,6 @@ gdk_parse_debug_var (const char *variable,
}
else
{
char *val = g_strndup (p, q - p);
for (i = 0; i < nkeys; i++)
{
if (strlen (keys[i].key) == q - p &&
@@ -233,8 +232,7 @@ gdk_parse_debug_var (const char *variable,
}
}
if (i == nkeys)
fprintf (stderr, "Unrecognized value \"%s\". Try %s=help\n", val, variable);
g_free (val);
fprintf (stderr, "Unrecognized value \"%.*s\". Try %s=help\n", (int) (q - p), p, variable);
}
p = q;
+1 -1
View File
@@ -43,7 +43,7 @@ typedef enum {
GDK_DEBUG_PORTALS = 1 << 14,
GDK_DEBUG_NO_PORTALS = 1 << 15,
GDK_DEBUG_GL_DISABLE = 1 << 16,
GDK_DEBUG_GL_FRACTIONAL = 1 << 17,
GDK_DEBUG_GL_NO_FRACTIONAL= 1 << 17,
GDK_DEBUG_GL_DISABLE_GL = 1 << 19,
GDK_DEBUG_GL_DISABLE_GLES = 1 << 20,
+62 -6
View File
@@ -77,6 +77,7 @@ enum
PROP_0,
PROP_COMPOSITED,
PROP_RGBA,
PROP_SHADOW_WIDTH,
PROP_INPUT_SHAPES,
PROP_DMABUF_FORMATS,
LAST_PROP
@@ -111,6 +112,7 @@ struct _GdkDisplayPrivate {
guint rgba : 1;
guint composited : 1;
guint shadow_width: 1;
guint input_shapes : 1;
GdkDebugFlags debug_flags;
@@ -144,6 +146,10 @@ gdk_display_get_property (GObject *object,
g_value_set_boolean (value, gdk_display_is_rgba (display));
break;
case PROP_SHADOW_WIDTH:
g_value_set_boolean (value, gdk_display_supports_shadow_width (display));
break;
case PROP_INPUT_SHAPES:
g_value_set_boolean (value, gdk_display_supports_input_shapes (display));
break;
@@ -243,6 +249,18 @@ gdk_display_class_init (GdkDisplayClass *class)
TRUE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
* GdkDisplay:shadow-width: (attributes org.gtk.Property.get=gdk_display_supports_shadow_width)
*
* %TRUE if the display supports extensible frames.
*
* Since: 4.14
*/
props[PROP_SHADOW_WIDTH] =
g_param_spec_boolean ("shadow-width", NULL, NULL,
TRUE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
* GdkDisplay:input-shapes: (attributes org.gtk.Property.get=gdk_display_supports_input_shapes)
*
@@ -391,6 +409,7 @@ gdk_display_init (GdkDisplay *display)
priv->composited = TRUE;
priv->rgba = TRUE;
priv->shadow_width = TRUE;
priv->input_shapes = TRUE;
}
@@ -1363,7 +1382,7 @@ gdk_display_init_gl (GdkDisplay *self)
return;
}
gdk_profiler_end_mark (before2, "realize OpenGL context", NULL);
gdk_profiler_end_mark (before2, "Realize OpenGL context", NULL);
/* Only assign after realize, so GdkGLContext::realize() can use
* gdk_display_get_gl_context() == NULL to differentiate between
@@ -1373,7 +1392,7 @@ gdk_display_init_gl (GdkDisplay *self)
gdk_gl_backend_use (GDK_GL_CONTEXT_GET_CLASS (context)->backend_type);
gdk_profiler_end_mark (before, "initialize OpenGL", NULL);
gdk_profiler_end_mark (before, "Init OpenGL", NULL);
}
/**
@@ -1768,7 +1787,6 @@ gdk_display_init_egl (GdkDisplay *self,
{
GdkDisplayPrivate *priv = gdk_display_get_instance_private (self);
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
G_GNUC_UNUSED gint64 start_time2;
int major, minor;
if (!gdk_gl_backend_can_be_used (GDK_GL_EGL, error))
@@ -1795,7 +1813,6 @@ gdk_display_init_egl (GdkDisplay *self,
return FALSE;
}
start_time2 = GDK_PROFILER_CURRENT_TIME;
if (!eglInitialize (priv->egl_display, &major, &minor))
{
priv->egl_display = NULL;
@@ -1804,7 +1821,6 @@ gdk_display_init_egl (GdkDisplay *self,
_("Could not initialize EGL display"));
return FALSE;
}
gdk_profiler_end_mark (start_time2, "eglInitialize", NULL);
if (major < GDK_EGL_MIN_VERSION_MAJOR ||
(major == GDK_EGL_MIN_VERSION_MAJOR && minor < GDK_EGL_MIN_VERSION_MINOR))
@@ -1894,7 +1910,7 @@ gdk_display_init_egl (GdkDisplay *self,
g_free (ext);
}
gdk_profiler_end_mark (start_time, "init EGL", NULL);
gdk_profiler_end_mark (start_time, "Init EGL", NULL);
return TRUE;
}
@@ -2125,6 +2141,46 @@ gdk_display_set_rgba (GdkDisplay *display,
g_object_notify_by_pspec (G_OBJECT (display), props[PROP_RGBA]);
}
/**
* gdk_display_supports_shadow_width: (attributes org.gtk.Method.get_property=shadow-width)
* @display: a `GdkDisplay`
*
* Returns whether it's possible for a surface to draw outside of the window area.
*
* If %TRUE is returned the application decides if it wants to draw shadows.
* If %FALSE is returned, the compositor decides if it wants to draw shadows.
*
* Returns: %TRUE if surfaces can draw shadows or
* %FALSE if the display does not support this functionality.
*
* Since: 4.14
*/
gboolean
gdk_display_supports_shadow_width (GdkDisplay *display)
{
GdkDisplayPrivate *priv = gdk_display_get_instance_private (display);
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
return priv->shadow_width;
}
void
gdk_display_set_shadow_width (GdkDisplay *display,
gboolean shadow_width)
{
GdkDisplayPrivate *priv = gdk_display_get_instance_private (display);
g_return_if_fail (GDK_IS_DISPLAY (display));
if (priv->shadow_width == shadow_width)
return;
priv->shadow_width = shadow_width;
g_object_notify_by_pspec (G_OBJECT (display), props[PROP_SHADOW_WIDTH]);
}
static void
device_removed_cb (GdkSeat *seat,
GdkDevice *device,
+2
View File
@@ -63,6 +63,8 @@ GDK_AVAILABLE_IN_ALL
gboolean gdk_display_is_composited (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_is_rgba (GdkDisplay *display);
GDK_AVAILABLE_IN_4_14
gboolean gdk_display_supports_shadow_width (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
+2
View File
@@ -257,6 +257,8 @@ void gdk_display_set_composited (GdkDisplay *display
gboolean composited);
void gdk_display_set_input_shapes (GdkDisplay *display,
gboolean input_shapes);
void gdk_display_set_shadow_width (GdkDisplay *display,
gboolean shadow_width);
void gdk_display_add_seat (GdkDisplay *display,
GdkSeat *seat);
+5 -5
View File
@@ -687,7 +687,7 @@ _gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
g_signal_emit (frame_clock, signals[UPDATE], 0);
gdk_profiler_end_mark (before, "frameclock update", NULL);
gdk_profiler_end_mark (before, "Frameclock update", NULL);
}
void
@@ -699,7 +699,7 @@ _gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
g_signal_emit (frame_clock, signals[LAYOUT], 0);
gdk_profiler_end_mark (before, "frameclock layout", NULL);
gdk_profiler_end_mark (before, "Frameclock layout", NULL);
}
void
@@ -711,7 +711,7 @@ _gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock)
g_signal_emit (frame_clock, signals[PAINT], 0);
gdk_profiler_end_mark (before, "frameclock paint", NULL);
gdk_profiler_end_mark (before, "Frameclock paint", NULL);
}
void
@@ -811,12 +811,12 @@ _gdk_frame_clock_add_timings_to_profiler (GdkFrameClock *clock,
{
if (timings->drawn_time != 0)
{
gdk_profiler_add_mark (1000 * timings->drawn_time, 0, "drawn window", NULL);
gdk_profiler_add_mark (1000 * timings->drawn_time, 0, "Drawn window", NULL);
}
if (timings->presentation_time != 0)
{
gdk_profiler_add_mark (1000 * timings->presentation_time, 0, "presented window", NULL);
gdk_profiler_add_mark (1000 * timings->presentation_time, 0, "Presented window", NULL);
}
gdk_profiler_set_counter (fps_counter, gdk_frame_clock_get_fps (clock));
+1 -1
View File
@@ -694,7 +694,7 @@ gdk_frame_clock_paint_idle (void *data)
if (!gdk_frame_clock_idle_is_frozen (clock_idle))
priv->sleep_serial = get_sleep_serial ();
gdk_profiler_end_mark (before, "frameclock cycle", NULL);
gdk_profiler_end_mark (before, "Frameclock cycle", NULL);
return FALSE;
}
+3 -12
View File
@@ -386,7 +386,7 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
gdk_profiler_end_mark (start_time, "Create EGL context", NULL);
return api;
}
@@ -593,7 +593,7 @@ gdk_gl_context_get_scale (GdkGLContext *self)
scale = gdk_surface_get_scale (surface);
display = gdk_gl_context_get_display (self);
if (!(gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_FRACTIONAL))
if (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_NO_FRACTIONAL)
scale = ceil (scale);
return scale;
@@ -669,7 +669,7 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
egl_surface = gdk_surface_get_egl_surface (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "EGL", "swap buffers");
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "EGL swap buffers", NULL);
if (priv->eglSwapBuffersWithDamage)
{
@@ -2042,15 +2042,6 @@ gdk_gl_context_has_sync (GdkGLContext *self)
return priv->has_sync;
}
/* Return if GL_BGRA works with glTexImage2D */
gboolean
gdk_gl_context_has_bgra (GdkGLContext *self)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
return priv->has_bgra;
}
/* Return if glGenVertexArrays, glBindVertexArray and glDeleteVertexArrays
* can be used
*/
-2
View File
@@ -171,8 +171,6 @@ gboolean gdk_gl_context_has_vertex_half_float (GdkGLContext
gboolean gdk_gl_context_has_sync (GdkGLContext *self) G_GNUC_PURE;
gboolean gdk_gl_context_has_bgra (GdkGLContext *self) G_GNUC_PURE;
gboolean gdk_gl_context_has_vertex_arrays (GdkGLContext *self) G_GNUC_PURE;
double gdk_gl_context_get_scale (GdkGLContext *self);
+7 -6
View File
@@ -32,6 +32,7 @@
#include "version/gdkversionmacros.h"
#include "gdkframeclockprivate.h"
#define CATEGORY "GTK"
gboolean
gdk_profiler_is_running (void)
@@ -50,7 +51,7 @@ void
const char *message)
{
#ifdef HAVE_SYSPROF
sysprof_collector_mark (begin_time, duration, "gtk", name, message);
sysprof_collector_mark (begin_time, duration, CATEGORY, name, message);
#endif
}
@@ -60,7 +61,7 @@ void
const char *message)
{
#ifdef HAVE_SYSPROF
sysprof_collector_mark (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, "gtk", name, message);
sysprof_collector_mark (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, CATEGORY, name, message);
#endif
}
@@ -74,7 +75,7 @@ void
#ifdef HAVE_SYSPROF
va_list args;
va_start (args, message_format);
sysprof_collector_mark_vprintf (begin_time, duration, "gtk", name, message_format, args);
sysprof_collector_mark_vprintf (begin_time, duration, CATEGORY, name, message_format, args);
va_end (args);
#endif /* HAVE_SYSPROF */
}
@@ -88,7 +89,7 @@ void
#ifdef HAVE_SYSPROF
va_list args;
va_start (args, message_format);
sysprof_collector_mark_vprintf (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, "gtk", name, message_format, args);
sysprof_collector_mark_vprintf (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, CATEGORY, name, message_format, args);
va_end (args);
#endif /* HAVE_SYSPROF */
}
@@ -103,7 +104,7 @@ guint
counter.id = sysprof_collector_request_counters (1);
counter.type = SYSPROF_CAPTURE_COUNTER_DOUBLE;
counter.value.vdbl = 0.0;
g_strlcpy (counter.category, "gtk", sizeof counter.category);
g_strlcpy (counter.category, CATEGORY, sizeof counter.category);
g_strlcpy (counter.name, name, sizeof counter.name);
g_strlcpy (counter.description, description, sizeof counter.name);
@@ -125,7 +126,7 @@ guint
counter.id = sysprof_collector_request_counters (1);
counter.type = SYSPROF_CAPTURE_COUNTER_INT64;
counter.value.v64 = 0;
g_strlcpy (counter.category, "gtk", sizeof counter.category);
g_strlcpy (counter.category, CATEGORY, sizeof counter.category);
g_strlcpy (counter.name, name, sizeof counter.name);
g_strlcpy (counter.description, description, sizeof counter.name);
+2 -2
View File
@@ -2839,7 +2839,7 @@ add_event_mark (GdkEvent *event,
class = g_type_class_ref (GDK_TYPE_EVENT_TYPE);
value = g_enum_get_value (class, event_type);
g_type_class_unref (class);
kind = value ? value->value_nick : "event";
kind = value ? value->value_nick : "Event";
switch ((int) event_type)
{
@@ -2909,7 +2909,7 @@ add_event_mark (GdkEvent *event,
break;
}
gdk_profiler_add_mark (time, end_time - time, "event", message ? message : kind);
gdk_profiler_add_mark (time, end_time - time, "Event", message ? message : kind);
g_free (message);
#endif
+3
View File
@@ -142,6 +142,9 @@ gdk_toplevel_size_set_min_size (GdkToplevelSize *size,
* The shadow width corresponds to the part of the computed surface size
* that would consist of the shadow margin surrounding the window, would
* there be any.
*
* Shadow width should only be set if
* [method@Gtk.Display.supports_shadow_width] is %TRUE.
*/
void
gdk_toplevel_size_set_shadow_width (GdkToplevelSize *size,
+1 -1
View File
@@ -237,7 +237,7 @@ gdk_load_jpeg (GBytes *input_bytes,
g_bytes_unref (bytes);
gdk_profiler_end_mark (before, "jpeg load", NULL);
gdk_profiler_end_mark (before, "Load jpeg", NULL);
return texture;
}
+1 -1
View File
@@ -304,7 +304,7 @@ gdk_load_png (GBytes *bytes,
{
gint64 end = GDK_PROFILER_CURRENT_TIME;
if (end - before > 500000)
gdk_profiler_add_mark (before, end - before, "png load", NULL);
gdk_profiler_add_mark (before, end - before, "Load png", NULL);
}
return texture;
+1 -1
View File
@@ -504,7 +504,7 @@ gdk_load_tiff (GBytes *input_bytes,
{
gint64 end = GDK_PROFILER_CURRENT_TIME;
if (end - before > 500000)
gdk_profiler_add_mark (before, end - before, "tiff load", NULL);
gdk_profiler_add_mark (before, end - before, "Load tiff", NULL);
}
return texture;
+14 -6
View File
@@ -398,8 +398,7 @@ typedef NSString *CALayerContentsGravity;
* in from a display-side change. We need to request a layout in
* addition to the configure event.
*/
if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface) &&
GDK_MACOS_TOPLEVEL_SURFACE (gdk_surface)->decorated)
if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface))
gdk_surface_request_layout (GDK_SURFACE (gdk_surface));
}
@@ -875,12 +874,21 @@ typedef NSString *CALayerContentsGravity;
{
NSWindowStyleMask style_mask = [self styleMask];
[self setHasShadow:decorated];
if (decorated)
style_mask |= NSWindowStyleMaskTitled;
{
style_mask &= ~NSWindowStyleMaskFullSizeContentView;
[self setTitleVisibility:NSWindowTitleVisible];
}
else
style_mask &= ~NSWindowStyleMaskTitled;
{
style_mask |= NSWindowStyleMaskFullSizeContentView;
[self setTitleVisibility:NSWindowTitleHidden];
}
[self setTitlebarAppearsTransparent:!decorated];
[[self standardWindowButton:NSWindowCloseButton] setHidden:!decorated];
[[self standardWindowButton:NSWindowMiniaturizeButton] setHidden:!decorated];
[[self standardWindowButton:NSWindowZoomButton] setHidden:!decorated];
[self setStyleMask:style_mask];
}
+1
View File
@@ -625,6 +625,7 @@ gdk_macos_display_init (GdkMacosDisplay *self)
gdk_display_set_composited (GDK_DISPLAY (self), TRUE);
gdk_display_set_input_shapes (GDK_DISPLAY (self), FALSE);
gdk_display_set_rgba (GDK_DISPLAY (self), TRUE);
gdk_display_set_shadow_width (GDK_DISPLAY (self), FALSE);
}
GdkDisplay *
+2 -2
View File
@@ -186,7 +186,7 @@ gdk_wayland_cairo_context_end_frame (GdkDrawContext *draw_context,
gdk_wayland_surface_attach_image (surface, self->paint_surface, painted);
gdk_wayland_surface_request_frame (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
gdk_wayland_surface_commit (surface);
gdk_wayland_surface_notify_committed (surface);
@@ -206,7 +206,7 @@ gdk_wayland_cairo_context_empty_frame (GdkDrawContext *draw_context)
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
gdk_wayland_surface_commit (surface);
gdk_wayland_surface_notify_committed (surface);
}
+1 -1
View File
@@ -1253,7 +1253,7 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland)
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (display_wayland), name, size);
g_value_unset (&v);
gdk_profiler_end_mark (before, "wayland", "load cursor theme");
gdk_profiler_end_mark (before, "Wayland cursor theme load", NULL);
}
+1 -2
View File
@@ -87,9 +87,8 @@ static void
gdk_wayland_gl_context_empty_frame (GdkDrawContext *draw_context)
{
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (impl->has_pending_subsurface_commits)
if (gdk_wayland_surface_needs_commit (surface))
{
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
+1 -1
View File
@@ -1012,7 +1012,7 @@ gdk_wayland_surface_create_xdg_popup (GdkWaylandPopup *wayland_popup,
}
}
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
wl_surface_commit (impl->display_server.wl_surface);
if (GDK_IS_POPUP (surface))
+1
View File
@@ -129,6 +129,7 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
guint *next_image_delay);
void gdk_wayland_surface_sync (GdkSurface *surface);
gboolean gdk_wayland_surface_needs_commit (GdkSurface *surface);
void gdk_wayland_surface_commit (GdkSurface *surface);
void gdk_wayland_surface_notify_committed (GdkSurface *surface);
void gdk_wayland_surface_request_frame (GdkSurface *surface);
+21 -9
View File
@@ -199,20 +199,20 @@ get_egl_window_size (GdkSurface *surface,
GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_FRACTIONAL))
{
GDK_DISPLAY_DEBUG (display, OPENGL, "Using fractional scale %g for EGL window", gdk_fractional_scale_to_double (&impl->scale));
*width = gdk_fractional_scale_scale (&impl->scale, surface->width),
*height = gdk_fractional_scale_scale (&impl->scale, surface->height);
}
else
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_NO_FRACTIONAL))
{
GDK_DISPLAY_DEBUG (display, OPENGL, "Using integer scale %d for EGL window", gdk_fractional_scale_to_int (&impl->scale));
*width = surface->width * gdk_fractional_scale_to_int (&impl->scale);
*height = surface->height * gdk_fractional_scale_to_int (&impl->scale);
}
else
{
GDK_DISPLAY_DEBUG (display, OPENGL, "Using fractional scale %g for EGL window", gdk_fractional_scale_to_double (&impl->scale));
*width = gdk_fractional_scale_scale (&impl->scale, surface->width),
*height = gdk_fractional_scale_scale (&impl->scale, surface->height);
}
}
void
@@ -274,7 +274,7 @@ gdk_wayland_surface_frame_callback (GdkSurface *surface,
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
GdkFrameTimings *timings;
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "frame event");
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland frame event", NULL);
GDK_DISPLAY_DEBUG (GDK_DISPLAY (display_wayland), EVENTS, "frame %p", surface);
g_clear_pointer (&impl->frame_callback, wl_callback_destroy);
@@ -746,6 +746,18 @@ gdk_wayland_surface_sync (GdkSurface *surface)
gdk_wayland_surface_sync_viewport (surface);
}
gboolean
gdk_wayland_surface_needs_commit (GdkSurface *surface)
{
GdkWaylandSurface *self = GDK_WAYLAND_SURFACE (surface);
return self->has_pending_subsurface_commits ||
self->opaque_region_dirty ||
self->input_region_dirty ||
self->buffer_scale_dirty ||
self->viewport_dirty;
}
static void
gdk_wayland_surface_fractional_scale_preferred_scale_cb (void *data,
struct wp_fractional_scale_v1 *fractional_scale,
+1 -1
View File
@@ -830,7 +830,7 @@ gdk_wayland_surface_create_xdg_toplevel (GdkWaylandToplevel *wayland_toplevel)
maybe_set_gtk_surface_dbus_properties (wayland_toplevel);
maybe_set_gtk_surface_modal (wayland_toplevel);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
wl_surface_commit (wayland_surface->display_server.wl_surface);
}
+1
View File
@@ -1064,6 +1064,7 @@ gdk_win32_display_check_composited (GdkWin32Display *display)
}
gdk_display_set_composited (GDK_DISPLAY (display), composited);
gdk_display_set_shadow_width (GDK_DISPLAY (display), composited);
}
static void
+5
View File
@@ -1429,6 +1429,7 @@ gdk_x11_display_open (const char *display_name)
int ignore;
int maj, min;
char *cm_name;
gboolean frame_extents;
XInitThreads ();
@@ -1643,6 +1644,10 @@ gdk_x11_display_open (const char *display_name)
gdk_x11_get_xatom_by_name_for_display (display, cm_name)) != None);
g_free (cm_name);
frame_extents = gdk_x11_screen_supports_net_wm_hint (gdk_x11_display_get_screen (display),
g_intern_static_string ("_GTK_FRAME_EXTENTS"));
gdk_display_set_shadow_width (display, frame_extents);
gdk_display_emit_opened (display);
return display;
+4 -4
View File
@@ -1608,8 +1608,8 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
if (gdk_profiler_is_running ())
{
gdk_profiler_add_markf (start_time, GDK_PROFILER_CURRENT_TIME-start_time,
"Download Texture chunk",
gdk_profiler_end_markf (start_time,
"Download texture chunk",
"Tile %dx%d Size %dx%d", x, y, width, height);
start_time = GDK_PROFILER_CURRENT_TIME;
}
@@ -1654,8 +1654,8 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
g_bytes_unref (bytes);
if (gdk_profiler_is_running ())
gdk_profiler_add_markf (start_time, GDK_PROFILER_CURRENT_TIME-start_time,
"Upload Texture chunk",
gdk_profiler_end_markf (start_time,
"Upload texture chunk",
"Tile %dx%d Size %dx%d", x, y, width, height);
}
+2 -2
View File
@@ -424,7 +424,7 @@ gsk_gl_driver_load_programs (GskGLDriver *self,
failure:
g_clear_object (&compiler);
gdk_profiler_end_mark (start_time, "load programs", NULL);
gdk_profiler_end_mark (start_time, "Load GL programs", NULL);
return ret;
}
@@ -477,7 +477,7 @@ gsk_gl_driver_new (GskGLCommandQueue *command_queue,
self->icons_library = gsk_gl_icon_library_new (self);
self->shadows_library = gsk_gl_shadow_library_new (self);
gdk_profiler_end_mark (before, "create GskGLDriver", NULL);
gdk_profiler_end_mark (before, "Create GL driver", NULL);
return g_steal_pointer (&self);
}
+2 -6
View File
@@ -119,11 +119,7 @@ gsk_gl_glyph_library_init_atlas (GskGLTextureLibrary *self,
memset (pixel_data, 255, sizeof pixel_data);
if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())
#if G_BYTE_ORDER == G_BIG_ENDIAN
|| gdk_gl_context_get_use_es (gdk_gl_context_get_current ())
#endif
)
if (gdk_gl_context_get_use_es (gdk_gl_context_get_current ()))
{
gl_format = GL_RGBA;
gl_type = GL_UNSIGNED_BYTE;
@@ -380,7 +376,7 @@ gsk_gl_glyph_library_upload_glyph (GskGLGlyphLibrary *self,
{
char message[64];
g_snprintf (message, sizeof message, "Size %dx%d", width, height);
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload Glyph", message);
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload glyph", message);
}
}
+1 -1
View File
@@ -211,6 +211,6 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self,
{
char message[64];
g_snprintf (message, sizeof message, "Size %dx%d", width, height);
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload Icon", message);
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload icon", message);
}
}
+31 -31
View File
@@ -830,8 +830,8 @@ rounded_rect_scale_corners (const GskRoundedRect *rect,
{
for (guint i = 0; i < G_N_ELEMENTS (out_rect->corner); i++)
{
out_rect->corner[i].width = rect->corner[i].width * fabs (scale_x);
out_rect->corner[i].height = rect->corner[i].height * fabs (scale_y);
out_rect->corner[i].width = rect->corner[i].width * fabsf (scale_x);
out_rect->corner[i].height = rect->corner[i].height * fabsf (scale_y);
}
if (scale_x < 0)
@@ -1173,8 +1173,8 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
{
float scale_x = job->scale_x;
float scale_y = job->scale_y;
int surface_width = ceilf (node->bounds.size.width * fabs (scale_x));
int surface_height = ceilf (node->bounds.size.height * fabs (scale_y));
int surface_width = ceilf (node->bounds.size.width * fabsf (scale_x));
int surface_height = ceilf (node->bounds.size.height * fabsf (scale_y));
GdkTexture *texture;
cairo_surface_t *surface;
cairo_surface_t *rendered_surface;
@@ -1203,7 +1203,7 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
surface_width,
surface_height);
cairo_surface_set_device_scale (rendered_surface, fabs (scale_x), fabs (scale_y));
cairo_surface_set_device_scale (rendered_surface, fabsf (scale_x), fabsf (scale_y));
cr = cairo_create (rendered_surface);
cairo_save (cr);
@@ -1217,16 +1217,16 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
surface_width,
surface_height);
cairo_surface_set_device_scale (surface, fabs (scale_x), fabs (scale_y));
cairo_surface_set_device_scale (surface, fabsf (scale_x), fabsf (scale_y));
cr = cairo_create (surface);
/* We draw upside down here, so it matches what GL does. */
cairo_save (cr);
cairo_scale (cr, scale_x < 0 ? -1 : 1, scale_y < 0 ? 1 : -1);
cairo_translate (cr, scale_x < 0 ? - surface_width / fabs (scale_x) : 0,
scale_y < 0 ? 0 : - surface_height / fabs (scale_y));
cairo_translate (cr, scale_x < 0 ? - surface_width / fabsf (scale_x) : 0,
scale_y < 0 ? 0 : - surface_height / fabsf (scale_y));
cairo_set_source_surface (cr, rendered_surface, 0, 0);
cairo_rectangle (cr, 0, 0, surface_width / fabs (scale_x), surface_height / fabs (scale_y));
cairo_rectangle (cr, 0, 0, surface_width / fabsf (scale_x), surface_height / fabsf (scale_y));
cairo_fill (cr);
cairo_restore (cr);
cairo_destroy (cr);
@@ -1432,10 +1432,10 @@ blur_node (GskGLRenderJob *job,
offscreen->texture_id = blur_offscreen (job,
offscreen,
texture_width * fabs (scale_x),
texture_height * fabs (scale_y),
blur_radius * fabs (scale_x),
blur_radius * fabs (scale_y));
texture_width * fabsf (scale_x),
texture_height * fabsf (scale_y),
blur_radius * fabsf (scale_x),
blur_radius * fabsf (scale_y));
init_full_texture_region (offscreen);
}
@@ -2019,9 +2019,9 @@ result_is_axis_aligned (GskTransform *transform,
for (guint i = 0; i < 4; i++)
{
p = graphene_quad_get_point (&q, i);
if (fabs (p->x - b1.x) > FLT_EPSILON && fabs (p->x - b2.x) > FLT_EPSILON)
if (fabsf (p->x - b1.x) > FLT_EPSILON && fabsf (p->x - b2.x) > FLT_EPSILON)
return FALSE;
if (fabs (p->y - b1.y) > FLT_EPSILON && fabs (p->y - b2.y) > FLT_EPSILON)
if (fabsf (p->y - b1.y) > FLT_EPSILON && fabsf (p->y - b2.y) > FLT_EPSILON)
return FALSE;
}
@@ -2304,8 +2304,8 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
&offscreen,
texture_width,
texture_height,
blur_radius * fabs (scale_x),
blur_radius * fabs (scale_y));
blur_radius * fabsf (scale_x),
blur_radius * fabsf (scale_y));
gsk_gl_driver_release_render_target (job->driver, render_target, TRUE);
@@ -2501,8 +2501,8 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
do_slicing = TRUE;
}
texture_width = (int)ceil ((scaled_outline.bounds.size.width + blur_extra) * scale_x);
texture_height = (int)ceil ((scaled_outline.bounds.size.height + blur_extra) * scale_y);
texture_width = (int)ceilf ((scaled_outline.bounds.size.width + blur_extra) * scale_x);
texture_height = (int)ceilf ((scaled_outline.bounds.size.height + blur_extra) * scale_y);
scaled_outline.bounds.origin.x = extra_blur_pixels_x;
scaled_outline.bounds.origin.y = extra_blur_pixels_y;
@@ -2577,8 +2577,8 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
&offscreen,
texture_width,
texture_height,
blur_radius * fabs (scale_x),
blur_radius * fabs (scale_y));
blur_radius * fabsf (scale_x),
blur_radius * fabsf (scale_y));
gsk_gl_shadow_library_insert (job->driver->shadows_library,
&scaled_outline,
@@ -2834,7 +2834,7 @@ gsk_gl_render_job_visit_cross_fade_node (GskGLRenderJob *job,
offscreen_end.reset_clip = TRUE;
offscreen_end.bounds = &node->bounds;
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabsf (job->scale_x), fabsf (job->scale_y)));
if (!gsk_gl_render_job_visit_node_with_offscreen (job, start_node, &offscreen_start))
{
@@ -2964,7 +2964,7 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
const PangoFont *font = gsk_text_node_get_font (node);
const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
const graphene_point_t *offset = gsk_text_node_get_offset (node);
float text_scale = MAX (fabs (job->scale_x), fabs (job->scale_y)); /* TODO: Fix for uneven scales? */
float text_scale = MAX (fabsf (job->scale_x), fabsf (job->scale_y)); /* TODO: Fix for uneven scales? */
guint num_glyphs = gsk_text_node_get_num_glyphs (node);
float x = offset->x + job->offset_x;
float y = offset->y + job->offset_y;
@@ -3263,7 +3263,7 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
bottom_offscreen.force_offscreen = TRUE;
bottom_offscreen.reset_clip = TRUE;
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabsf (job->scale_x), fabsf (job->scale_y)));
/* TODO: We create 2 textures here as big as the blend node, but both the
* start and the end node might be a lot smaller than that. */
@@ -3344,8 +3344,8 @@ gsk_gl_render_job_texture_mask_for_color (GskGLRenderJob *job,
gboolean use_mipmap;
guint16 cc[4];
use_mipmap = (scale_x * fabs (job->scale_x)) < 0.5 ||
(scale_y * fabs (job->scale_y)) < 0.5;
use_mipmap = (scale_x * fabsf (job->scale_x)) < 0.5 ||
(scale_y * fabsf (job->scale_y)) < 0.5;
rgba_to_half (rgba, cc);
gsk_gl_render_job_upload_texture (job, texture, use_mipmap, &offscreen);
@@ -3396,7 +3396,7 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
mask_offscreen.reset_clip = TRUE;
mask_offscreen.do_not_cache = TRUE;
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabsf (job->scale_x), fabsf (job->scale_y)));
/* TODO: We create 2 textures here as big as the mask node, but both
* nodes might be a lot smaller than that.
@@ -3664,8 +3664,8 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob *job,
float scale_y = bounds->size.height / texture->height;
gboolean use_mipmap;
use_mipmap = (scale_x * fabs (job->scale_x)) < 0.5 ||
(scale_y * fabs (job->scale_y)) < 0.5;
use_mipmap = (scale_x * fabsf (job->scale_x)) < 0.5 ||
(scale_y * fabsf (job->scale_y)) < 0.5;
if G_LIKELY (texture->width <= max_texture_size &&
texture->height <= max_texture_size)
@@ -4544,7 +4544,7 @@ gsk_gl_render_job_render (GskGLRenderJob *job,
gsk_gl_render_job_visit_node (job, root);
gdk_gl_context_pop_debug_group (job->command_queue->context);
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Build GL command queue", "");
gdk_profiler_end_mark (start_time, "Build GL command queue", "");
#if 0
/* At this point the atlases have uploaded content while we processed
@@ -4562,7 +4562,7 @@ gsk_gl_render_job_render (GskGLRenderJob *job,
gdk_gl_context_push_debug_group (job->command_queue->context, "Executing command queue");
gsk_gl_command_queue_execute (job->command_queue, surface_height, scale, job->region, job->default_framebuffer);
gdk_gl_context_pop_debug_group (job->command_queue->context);
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Execute GL command queue", "");
gdk_profiler_end_mark (start_time, "Execute GL command queue", "");
}
static int
+2 -4
View File
@@ -117,9 +117,8 @@ gsk_gl_texture_library_real_compact (GskGLTextureLibrary *self,
g_hash_table_iter_remove (&iter);
dropped++;
}
if (periodic_scan)
entry->accessed = FALSE;
else if (periodic_scan)
entry->accessed = FALSE;
}
}
@@ -440,7 +439,6 @@ gsk_gl_texture_library_pack (GskGLTextureLibrary *self,
entry->texture = texture;
entry->is_atlased = FALSE;
entry->accessed = TRUE;
entry->area.x = padding / (float) (padding + width + padding);
entry->area.y = padding / (float) (padding + height + padding);
entry->area.x2 = (padding + width) / (float) (padding + width + padding);
+7
View File
@@ -125,6 +125,12 @@ gsk_gl_device_create_atlas_image (GskGpuDevice *device,
height);
}
static void
gsk_gl_device_make_current (GskGpuDevice *device)
{
gdk_gl_context_make_current (gdk_display_get_gl_context (gsk_gpu_device_get_display (device)));
}
static void
gsk_gl_device_finalize (GObject *object)
{
@@ -151,6 +157,7 @@ gsk_gl_device_class_init (GskGLDeviceClass *klass)
gpu_device_class->create_atlas_image = gsk_gl_device_create_atlas_image;
gpu_device_class->create_upload_image = gsk_gl_device_create_upload_image;
gpu_device_class->create_download_image = gsk_gl_device_create_download_image;
gpu_device_class->make_current = gsk_gl_device_make_current;
object_class->finalize = gsk_gl_device_finalize;
}
+9 -1
View File
@@ -43,7 +43,7 @@ gsk_gl_image_finalize (GObject *object)
{
GskGLImage *self = GSK_GL_IMAGE (object);
if (self->framebuffer_id)
if (self->texture_id && self->framebuffer_id)
glDeleteFramebuffers (1, &self->framebuffer_id);
if (self->owns_texture)
@@ -70,6 +70,7 @@ gsk_gl_image_init (GskGLImage *self)
GskGpuImage *
gsk_gl_image_new_backbuffer (GskGLDevice *device,
GdkGLContext *context,
GdkMemoryFormat format,
gsize width,
gsize height)
@@ -95,6 +96,13 @@ gsk_gl_image_new_backbuffer (GskGLDevice *device,
/* texture_id == 0 means backbuffer */
/* Check for non-standard framebuffer binding as we might not be using
* the default framebuffer on systems like macOS where we've bound an
* IOSurface to a GL_TEXTURE_RECTANGLE. Otherwise, no scissor clip will
* be applied in the command queue causing overdrawing.
*/
self->framebuffer_id = GDK_GL_CONTEXT_GET_CLASS (context)->get_default_framebuffer (context);
return GSK_GPU_IMAGE (self);
}
+1
View File
@@ -11,6 +11,7 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GskGLImage, gsk_gl_image, GSK, GL_IMAGE, GskGpuImage)
GskGpuImage * gsk_gl_image_new_backbuffer (GskGLDevice *device,
GdkGLContext *context,
GdkMemoryFormat format,
gsize width,
gsize height);
+325 -68
View File
@@ -3,10 +3,14 @@
#include "gskgpudeviceprivate.h"
#include "gskgpuframeprivate.h"
#include "gskgpuimageprivate.h"
#include "gskgpuuploadopprivate.h"
#include "gdk/gdkdisplayprivate.h"
#include "gdk/gdktextureprivate.h"
#include "gdk/gdkprofilerprivate.h"
#include "gsk/gskdebugprivate.h"
#define MAX_SLICES_PER_ATLAS 64
@@ -14,6 +18,13 @@
#define MAX_ATLAS_ITEM_SIZE 256
#define MAX_DEAD_PIXELS (ATLAS_SIZE * ATLAS_SIZE / 2)
#define CACHE_TIMEOUT 15 /* seconds */
G_STATIC_ASSERT (MAX_ATLAS_ITEM_SIZE < ATLAS_SIZE);
G_STATIC_ASSERT (MAX_DEAD_PIXELS < ATLAS_SIZE * ATLAS_SIZE);
typedef struct _GskGpuCached GskGpuCached;
typedef struct _GskGpuCachedClass GskGpuCachedClass;
typedef struct _GskGpuCachedAtlas GskGpuCachedAtlas;
@@ -29,11 +40,14 @@ struct _GskGpuDevicePrivate
GskGpuCached *first_cached;
GskGpuCached *last_cached;
guint cache_gc_source;
int cache_timeout; /* in seconds, or -1 to disable gc */
GHashTable *texture_cache;
GHashTable *glyph_cache;
GskGpuCachedAtlas *current_atlas;
/* atomic */ gsize dead_texture_pixels;
};
G_DEFINE_TYPE_WITH_PRIVATE (GskGpuDevice, gsk_gpu_device, G_TYPE_OBJECT)
@@ -54,12 +68,34 @@ struct _GskGpuCachedClass
struct _GskGpuCached
{
const GskGpuCachedClass *class;
GskGpuCachedAtlas *atlas;
GskGpuCached *next;
GskGpuCached *prev;
gint64 timestamp;
gboolean stale;
guint pixels; /* For glyphs and textures, pixels. For atlases, dead pixels */
};
static inline void
mark_as_stale (GskGpuCached *cached,
gboolean stale)
{
if (cached->stale != stale)
{
cached->stale = stale;
if (cached->atlas)
{
if (stale)
((GskGpuCached *) cached->atlas)->pixels += cached->pixels;
else
((GskGpuCached *) cached->atlas)->pixels -= cached->pixels;
}
}
}
static void
gsk_gpu_cached_free (GskGpuDevice *device,
GskGpuCached *cached)
@@ -75,6 +111,8 @@ gsk_gpu_cached_free (GskGpuDevice *device,
else
priv->first_cached = cached->next;
mark_as_stale (cached, TRUE);
cached->class->free (device, cached);
}
@@ -114,7 +152,21 @@ gsk_gpu_cached_use (GskGpuDevice *device,
GskGpuCached *cached,
gint64 timestamp)
{
/* FIXME */
cached->timestamp = timestamp;
mark_as_stale (cached, FALSE);
}
static inline gboolean
gsk_gpu_cached_is_old (GskGpuDevice *device,
GskGpuCached *cached,
gint64 timestamp)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
if (priv->cache_timeout < 0)
return FALSE;
else
return timestamp - cached->timestamp > priv->cache_timeout * G_TIME_SPAN_SECOND;
}
/* }}} */
@@ -137,10 +189,23 @@ static void
gsk_gpu_cached_atlas_free (GskGpuDevice *device,
GskGpuCached *cached)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
GskGpuCachedAtlas *self = (GskGpuCachedAtlas *) cached;
GskGpuCached *c, *next;
/* Free all remaining glyphs on this atlas */
for (c = priv->first_cached; c != NULL; c = next)
{
next = c->next;
if (c->atlas == self)
gsk_gpu_cached_free (device, c);
}
if (priv->current_atlas == self)
priv->current_atlas = NULL;
g_object_unref (self->image);
g_free (self);
}
@@ -149,8 +214,7 @@ gsk_gpu_cached_atlas_should_collect (GskGpuDevice *device,
GskGpuCached *cached,
gint64 timestamp)
{
/* FIXME */
return FALSE;
return cached->pixels > MAX_DEAD_PIXELS;
}
static const GskGpuCachedClass GSK_GPU_CACHED_ATLAS_CLASS =
@@ -178,7 +242,14 @@ struct _GskGpuCachedTexture
{
GskGpuCached parent;
/* atomic */ GdkTexture *texture;
/* atomic */ int use_count; /* We count the use by the device (via the linked
* list) and by the texture (via render data or
* weak ref.
*/
gsize *dead_pixels_counter;
GdkTexture *texture;
GskGpuImage *image;
};
@@ -186,14 +257,37 @@ static void
gsk_gpu_cached_texture_free (GskGpuDevice *device,
GskGpuCached *cached)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
GskGpuCachedTexture *self = (GskGpuCachedTexture *) cached;
gboolean texture_still_alive;
gpointer key, value;
texture_still_alive = g_atomic_pointer_exchange (&self->texture, NULL) != NULL;
g_object_unref (self->image);
if (!texture_still_alive)
g_free (self);
g_clear_object (&self->image);
if (g_hash_table_steal_extended (priv->texture_cache, self->texture, &key, &value))
{
/* If the texture has been reused already, we put the entry back */
if ((GskGpuCached *) value != cached)
g_hash_table_insert (priv->texture_cache, key, value);
}
/* If the cached item itself is still in use by the texture, we leave
* it to the weak ref or render data to free it.
*/
if (g_atomic_int_dec_and_test (&self->use_count))
{
g_free (self);
return;
}
}
static inline gboolean
gsk_gpu_cached_texture_is_invalid (GskGpuCachedTexture *self)
{
/* If the use count is less than 2, the orignal texture has died,
* and the memory may have been reused for a new texture, so we
* can't hand out the image that is for the original texture.
*/
return g_atomic_int_get (&self->use_count) < 2;
}
static gboolean
@@ -201,8 +295,10 @@ gsk_gpu_cached_texture_should_collect (GskGpuDevice *device,
GskGpuCached *cached,
gint64 timestamp)
{
/* FIXME */
return FALSE;
GskGpuCachedTexture *self = (GskGpuCachedTexture *) cached;
return gsk_gpu_cached_is_old (device, cached, timestamp) ||
gsk_gpu_cached_texture_is_invalid (self);
}
static const GskGpuCachedClass GSK_GPU_CACHED_TEXTURE_CLASS =
@@ -212,16 +308,19 @@ static const GskGpuCachedClass GSK_GPU_CACHED_TEXTURE_CLASS =
gsk_gpu_cached_texture_should_collect
};
/* Note: this function can run in an arbitrary thread, so it can
* only access things atomically
*/
static void
gsk_gpu_cached_texture_destroy_cb (gpointer data)
{
GskGpuCachedTexture *cache = data;
gboolean cache_still_alive;
GskGpuCachedTexture *self = data;
cache_still_alive = g_atomic_pointer_exchange (&cache->texture, NULL) != NULL;
if (!gsk_gpu_cached_texture_is_invalid (self))
g_atomic_pointer_add (self->dead_pixels_counter, ((GskGpuCached *) self)->pixels);
if (!cache_still_alive)
g_free (cache);
if (g_atomic_int_dec_and_test (&self->use_count))
g_free (self);
}
static GskGpuCachedTexture *
@@ -235,18 +334,19 @@ gsk_gpu_cached_texture_new (GskGpuDevice *device,
if (gdk_texture_get_render_data (texture, device))
gdk_texture_clear_render_data (texture);
else if ((self = g_hash_table_lookup (priv->texture_cache, texture)))
{
g_hash_table_remove (priv->texture_cache, texture);
g_object_weak_unref (G_OBJECT (texture), (GWeakNotify) gsk_gpu_cached_texture_destroy_cb, self);
}
g_hash_table_remove (priv->texture_cache, texture);
self = gsk_gpu_cached_new (device, &GSK_GPU_CACHED_TEXTURE_CLASS, NULL);
self->texture = texture;
self->image = g_object_ref (image);
((GskGpuCached *)self)->pixels = gsk_gpu_image_get_width (image) * gsk_gpu_image_get_height (image);
self->dead_pixels_counter = &priv->dead_texture_pixels;
self->use_count = 2;
if (!gdk_texture_set_render_data (texture, device, self, gsk_gpu_cached_texture_destroy_cb))
{
g_object_weak_ref (G_OBJECT (texture), (GWeakNotify) gsk_gpu_cached_texture_destroy_cb, self);
g_hash_table_insert (priv->texture_cache, texture, self);
}
@@ -274,8 +374,11 @@ static void
gsk_gpu_cached_glyph_free (GskGpuDevice *device,
GskGpuCached *cached)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
GskGpuCachedGlyph *self = (GskGpuCachedGlyph *) cached;
g_hash_table_remove (priv->glyph_cache, self);
g_object_unref (self->font);
g_object_unref (self->image);
@@ -287,7 +390,15 @@ gsk_gpu_cached_glyph_should_collect (GskGpuDevice *device,
GskGpuCached *cached,
gint64 timestamp)
{
/* FIXME */
if (gsk_gpu_cached_is_old (device, cached, timestamp))
{
if (cached->atlas)
mark_as_stale (cached, TRUE);
else
return TRUE;
}
/* Glyphs are only collected when their atlas is freed */
return FALSE;
}
@@ -325,19 +436,127 @@ static const GskGpuCachedClass GSK_GPU_CACHED_GLYPH_CLASS =
/* }}} */
/* {{{ GskGpuDevice */
void
static void
print_cache_stats (GskGpuDevice *self)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
GskGpuCached *cached;
guint glyphs = 0;
guint stale_glyphs = 0;
guint textures = 0;
guint atlases = 0;
GString *ratios = g_string_new ("");
for (cached = priv->first_cached; cached != NULL; cached = cached->next)
{
if (cached->class == &GSK_GPU_CACHED_GLYPH_CLASS)
{
glyphs++;
if (cached->stale)
stale_glyphs++;
}
else if (cached->class == &GSK_GPU_CACHED_TEXTURE_CLASS)
{
textures++;
}
else if (cached->class == &GSK_GPU_CACHED_ATLAS_CLASS)
{
double ratio;
atlases++;
ratio = (double) cached->pixels / (double) (ATLAS_SIZE * ATLAS_SIZE);
if (ratios->len == 0)
g_string_append (ratios, " (ratios ");
else
g_string_append (ratios, ", ");
g_string_append_printf (ratios, "%.2f", ratio);
}
}
if (ratios->len > 0)
g_string_append (ratios, ")");
gdk_debug_message ("Cached items\n"
" glyphs: %5u (%u stale)\n"
" textures: %5u (%u in hash)\n"
" atlases: %5u%s",
glyphs, stale_glyphs,
textures, g_hash_table_size (priv->texture_cache),
atlases, ratios->str);
g_string_free (ratios, TRUE);
}
static void
gsk_gpu_device_gc (GskGpuDevice *self,
gint64 timestamp)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
GskGpuCached *cached, *next;
GskGpuCached *cached, *prev;
gint64 before G_GNUC_UNUSED = GDK_PROFILER_CURRENT_TIME;
for (cached = priv->first_cached; cached != NULL; cached = next)
gsk_gpu_device_make_current (self);
/* We walk the cache from the end so we don't end up with prev
* being a leftover glyph on the atlas we are freeing
*/
for (cached = priv->last_cached; cached != NULL; cached = prev)
{
next = cached->next;
prev = cached->prev;
if (gsk_gpu_cached_should_collect (self, cached, timestamp))
gsk_gpu_cached_free (self, cached);
}
g_atomic_pointer_set (&priv->dead_texture_pixels, 0);
if (GSK_DEBUG_CHECK (GLYPH_CACHE))
print_cache_stats (self);
gdk_profiler_end_mark (before, "Glyph cache GC", NULL);
}
static gboolean
cache_gc_cb (gpointer data)
{
GskGpuDevice *self = data;
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
GSK_DEBUG (GLYPH_CACHE, "Periodic GC");
gsk_gpu_device_gc (self, g_get_monotonic_time ());
priv->cache_gc_source = 0;
return G_SOURCE_REMOVE;
}
void
gsk_gpu_device_maybe_gc (GskGpuDevice *self)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
gsize dead_texture_pixels;
if (priv->cache_timeout < 0)
return;
dead_texture_pixels = GPOINTER_TO_SIZE (g_atomic_pointer_get (&priv->dead_texture_pixels));
if (priv->cache_timeout == 0 || dead_texture_pixels > 1000000)
{
GSK_DEBUG (GLYPH_CACHE, "Pre-frame GC (%lu dead pixels)", dead_texture_pixels);
gsk_gpu_device_gc (self, g_get_monotonic_time ());
}
}
void
gsk_gpu_device_queue_gc (GskGpuDevice *self)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
if (priv->cache_timeout > 0 && !priv->cache_gc_source)
priv->cache_gc_source = g_timeout_add_seconds (priv->cache_timeout, cache_gc_cb, self);
}
static void
@@ -357,8 +576,9 @@ gsk_gpu_device_clear_cache (GskGpuDevice *self)
g_assert (cached->next->prev == cached);
}
while (priv->first_cached)
gsk_gpu_cached_free (self, priv->first_cached);
/* We clear the cache from the end so glyphs get freed before their atlas */
while (priv->last_cached)
gsk_gpu_cached_free (self, priv->last_cached);
g_assert (priv->last_cached == NULL);
}
@@ -372,6 +592,7 @@ gsk_gpu_device_dispose (GObject *object)
gsk_gpu_device_clear_cache (self);
g_hash_table_unref (priv->glyph_cache);
g_hash_table_unref (priv->texture_cache);
g_clear_handle_id (&priv->cache_gc_source, g_source_remove);
G_OBJECT_CLASS (gsk_gpu_device_parent_class)->dispose (object);
}
@@ -413,9 +634,38 @@ gsk_gpu_device_setup (GskGpuDevice *self,
gsize max_image_size)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
const char *str;
priv->display = g_object_ref (display);
priv->max_image_size = max_image_size;
priv->cache_timeout = CACHE_TIMEOUT;
str = g_getenv ("GSK_CACHE_TIMEOUT");
if (str != NULL)
{
gint64 value;
GError *error = NULL;
if (!g_ascii_string_to_signed (str, 10, -1, G_MAXINT, &value, &error))
{
g_warning ("Failed to parse GSK_CACHE_TIMEOUT: %s", error->message);
g_error_free (error);
}
else
{
priv->cache_timeout = (int) value;
}
}
if (GSK_DEBUG_CHECK (GLYPH_CACHE))
{
if (priv->cache_timeout < 0)
gdk_debug_message ("Cache GC disabled");
else if (priv->cache_timeout == 0)
gdk_debug_message ("Cache GC before every frame");
else
gdk_debug_message ("Cache GC timeout: %d seconds", priv->cache_timeout);
}
}
GdkDisplay *
@@ -454,6 +704,12 @@ gsk_gpu_device_create_upload_image (GskGpuDevice *self,
return GSK_GPU_DEVICE_GET_CLASS (self)->create_upload_image (self, with_mipmap, format, width, height);
}
void
gsk_gpu_device_make_current (GskGpuDevice *self)
{
GSK_GPU_DEVICE_GET_CLASS (self)->make_current (self);
}
GskGpuImage *
gsk_gpu_device_create_download_image (GskGpuDevice *self,
GdkMemoryDepth depth,
@@ -517,15 +773,21 @@ gsk_gpu_cached_atlas_allocate (GskGpuCachedAtlas *atlas,
if (best_slice >= i && i == atlas->n_slices)
{
gsize slice_height;
if (!can_add_slice)
return FALSE;
slice_height = round_up_atlas_size (MAX (height, 4));
if (slice_height > ATLAS_SIZE - y)
return FALSE;
atlas->n_slices++;
if (atlas->n_slices == MAX_SLICES_PER_ATLAS)
atlas->slices[i].height = ATLAS_SIZE - y;
else
atlas->slices[i].height = round_up_atlas_size (MAX (height, 4));
slice_height = ATLAS_SIZE - y;
atlas->slices[i].width = 0;
atlas->slices[i].height = slice_height;
best_y = y;
best_slice = i;
}
@@ -541,8 +803,7 @@ gsk_gpu_cached_atlas_allocate (GskGpuCachedAtlas *atlas,
static void
gsk_gpu_device_ensure_atlas (GskGpuDevice *self,
gboolean recreate,
gint64 timestamp)
gboolean recreate)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
@@ -557,14 +818,13 @@ gsk_gpu_device_get_atlas_image (GskGpuDevice *self)
{
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
gsk_gpu_device_ensure_atlas (self, FALSE, g_get_monotonic_time ());
gsk_gpu_device_ensure_atlas (self, FALSE);
return priv->current_atlas->image;
}
static GskGpuImage *
gsk_gpu_device_add_atlas_image (GskGpuDevice *self,
gint64 timestamp,
gsize width,
gsize height,
gsize *out_x,
@@ -575,21 +835,15 @@ gsk_gpu_device_add_atlas_image (GskGpuDevice *self,
if (width > MAX_ATLAS_ITEM_SIZE || height > MAX_ATLAS_ITEM_SIZE)
return NULL;
gsk_gpu_device_ensure_atlas (self, FALSE, timestamp);
if (gsk_gpu_cached_atlas_allocate (priv->current_atlas, width, height, out_x, out_y))
{
gsk_gpu_cached_use (self, (GskGpuCached *) priv->current_atlas, timestamp);
return priv->current_atlas->image;
}
gsk_gpu_device_ensure_atlas (self, TRUE, timestamp);
gsk_gpu_device_ensure_atlas (self, FALSE);
if (gsk_gpu_cached_atlas_allocate (priv->current_atlas, width, height, out_x, out_y))
{
gsk_gpu_cached_use (self, (GskGpuCached *) priv->current_atlas, timestamp);
return priv->current_atlas->image;
}
return priv->current_atlas->image;
gsk_gpu_device_ensure_atlas (self, TRUE);
if (gsk_gpu_cached_atlas_allocate (priv->current_atlas, width, height, out_x, out_y))
return priv->current_atlas->image;
return NULL;
}
@@ -606,12 +860,12 @@ gsk_gpu_device_lookup_texture_image (GskGpuDevice *self,
if (cache == NULL)
cache = g_hash_table_lookup (priv->texture_cache, texture);
if (cache)
{
return g_object_ref (cache->image);
}
if (!cache || !cache->image || gsk_gpu_cached_texture_is_invalid (cache))
return NULL;
return NULL;
gsk_gpu_cached_use (self, (GskGpuCached *) cache, timestamp);
return g_object_ref (cache->image);
}
void
@@ -650,6 +904,7 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
graphene_point_t origin;
GskGpuImage *image;
gsize atlas_x, atlas_y, padding;
float subpixel_x, subpixel_y;
cache = g_hash_table_lookup (priv->glyph_cache, &lookup);
if (cache)
@@ -661,15 +916,16 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
return cache->image;
}
subpixel_x = (flags & 3) / 4.f;
subpixel_y = ((flags >> 2) & 3) / 4.f;
pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL);
origin.x = floor (ink_rect.x * scale / PANGO_SCALE);
origin.y = floor (ink_rect.y * scale / PANGO_SCALE);
rect.size.width = ceil ((ink_rect.x + ink_rect.width) * scale / PANGO_SCALE) - origin.x;
rect.size.height = ceil ((ink_rect.y + ink_rect.height) * scale / PANGO_SCALE) - origin.y;
origin.x = floor (ink_rect.x * scale / PANGO_SCALE + subpixel_x);
origin.y = floor (ink_rect.y * scale / PANGO_SCALE + subpixel_y);
rect.size.width = ceil ((ink_rect.x + ink_rect.width) * scale / PANGO_SCALE + subpixel_x) - origin.x;
rect.size.height = ceil ((ink_rect.y + ink_rect.height) * scale / PANGO_SCALE + subpixel_y) - origin.y;
padding = 1;
image = gsk_gpu_device_add_atlas_image (self,
gsk_gpu_frame_get_timestamp (frame),
rect.size.width + 2 * padding, rect.size.height + 2 * padding,
&atlas_x, &atlas_y);
if (image)
@@ -688,14 +944,15 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
cache = gsk_gpu_cached_new (self, &GSK_GPU_CACHED_GLYPH_CLASS, NULL);
}
cache->font = g_object_ref (font),
cache->glyph = glyph,
cache->flags = flags,
cache->scale = scale,
cache->bounds = rect,
cache->image = image,
cache->origin = GRAPHENE_POINT_INIT (- origin.x + (flags & 3) / 4.f,
- origin.y + ((flags >> 2) & 3) / 4.f);
cache->font = g_object_ref (font);
cache->glyph = glyph;
cache->flags = flags;
cache->scale = scale;
cache->bounds = rect;
cache->image = image;
cache->origin = GRAPHENE_POINT_INIT (- origin.x + subpixel_x,
- origin.y + subpixel_y);
((GskGpuCached *) cache)->pixels = (rect.size.width + 2 * padding) * (rect.size.height + 2 * padding);
gsk_gpu_upload_glyph_op (frame,
cache->image,
+5 -4
View File
@@ -41,6 +41,8 @@ struct _GskGpuDeviceClass
GdkMemoryDepth depth,
gsize width,
gsize height);
void (* make_current) (GskGpuDevice *self);
};
GType gsk_gpu_device_get_type (void) G_GNUC_CONST;
@@ -48,9 +50,8 @@ GType gsk_gpu_device_get_type (void) G
void gsk_gpu_device_setup (GskGpuDevice *self,
GdkDisplay *display,
gsize max_image_size);
void gsk_gpu_device_gc (GskGpuDevice *self,
gint64 timestamp);
void gsk_gpu_device_maybe_gc (GskGpuDevice *self);
void gsk_gpu_device_queue_gc (GskGpuDevice *self);
GdkDisplay * gsk_gpu_device_get_display (GskGpuDevice *self);
gsize gsk_gpu_device_get_max_image_size (GskGpuDevice *self);
GskGpuImage * gsk_gpu_device_get_atlas_image (GskGpuDevice *self);
@@ -69,7 +70,7 @@ GskGpuImage * gsk_gpu_device_create_download_image (GskGpuD
GdkMemoryDepth depth,
gsize width,
gsize height);
void gsk_gpu_device_make_current (GskGpuDevice *self);
GskGpuImage * gsk_gpu_device_lookup_texture_image (GskGpuDevice *self,
GdkTexture *texture,
gint64 timestamp);
+1 -1
View File
@@ -220,7 +220,7 @@ gsk_gpu_frame_seal_ops (GskGpuFrame *self)
{
GskGpuFramePrivate *priv = gsk_gpu_frame_get_instance_private (self);
GskGpuOp *last, *op;
guint i;
gsize i;
priv->first_op = (GskGpuOp *) gsk_gpu_ops_index (&priv->ops, 0);
+49 -21
View File
@@ -322,8 +322,8 @@ rect_round_to_pixels (const graphene_rect_t *src,
*dest = GRAPHENE_RECT_INIT (
x * inv_xscale - pixel_offset->x,
y * inv_yscale - pixel_offset->y,
(ceil ((src->origin.x + pixel_offset->x + src->size.width) * xscale) - x) * inv_xscale,
(ceil ((src->origin.y + pixel_offset->y + src->size.height) * yscale) - y) * inv_yscale);
(ceilf ((src->origin.x + pixel_offset->x + src->size.width) * xscale) - x) * inv_xscale,
(ceilf ((src->origin.y + pixel_offset->y + src->size.height) * yscale) - y) * inv_yscale);
}
static GskGpuImage *
@@ -338,8 +338,8 @@ gsk_gpu_node_processor_init_draw (GskGpuNodeProcessor *self,
area.x = 0;
area.y = 0;
area.width = ceil (graphene_vec2_get_x (scale) * viewport->size.width);
area.height = ceil (graphene_vec2_get_y (scale) * viewport->size.height);
area.width = ceilf (graphene_vec2_get_x (scale) * viewport->size.width);
area.height = ceilf (graphene_vec2_get_y (scale) * viewport->size.height);
image = gsk_gpu_device_create_offscreen_image (gsk_gpu_frame_get_device (frame),
FALSE,
@@ -994,8 +994,8 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
if (!gsk_rect_intersection (rect, &clip_rect, &intermediate_rect))
return;
width = ceil (graphene_vec2_get_x (&self->scale) * intermediate_rect.size.width);
height = ceil (graphene_vec2_get_y (&self->scale) * intermediate_rect.size.height);
width = ceilf (graphene_vec2_get_x (&self->scale) * intermediate_rect.size.width);
height = ceilf (graphene_vec2_get_y (&self->scale) * intermediate_rect.size.height);
intermediate = gsk_gpu_device_create_offscreen_image (gsk_gpu_frame_get_device (self->frame),
FALSE,
@@ -1814,10 +1814,10 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
if (shader_clip != GSK_GPU_SHADER_CLIP_NONE)
{
gsk_rounded_rect_get_largest_cover (&self->clip.rect, &clipped, &cover);
int_clipped.x = ceil (cover.origin.x * scale_x);
int_clipped.y = ceil (cover.origin.y * scale_y);
int_clipped.width = floor ((cover.origin.x + cover.size.width) * scale_x) - int_clipped.x;
int_clipped.height = floor ((cover.origin.y + cover.size.height) * scale_y) - int_clipped.y;
int_clipped.x = ceilf (cover.origin.x * scale_x);
int_clipped.y = ceilf (cover.origin.y * scale_y);
int_clipped.width = floorf ((cover.origin.x + cover.size.width) * scale_x) - int_clipped.x;
int_clipped.height = floorf ((cover.origin.y + cover.size.height) * scale_y) - int_clipped.y;
if (int_clipped.width == 0 || int_clipped.height == 0)
{
gsk_gpu_color_op (self->frame,
@@ -2978,6 +2978,7 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
guint i, num_glyphs;
float scale, inv_scale;
GdkRGBA color;
gboolean glyph_align;
if (self->opacity < 1.0 &&
gsk_text_node_has_color_glyphs (node))
@@ -2986,6 +2987,8 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
return;
}
glyph_align = gsk_gpu_frame_should_optimize (self->frame, GSK_GPU_OPTIMIZE_GLYPH_ALIGN) &&
gsk_transform_get_category (self->modelview) >= GSK_TRANSFORM_CATEGORY_2D;
device = gsk_gpu_frame_get_device (self->frame);
color = *gsk_text_node_get_color (node);
color.alpha *= self->opacity;
@@ -3003,22 +3006,39 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
{
GskGpuImage *image;
graphene_rect_t glyph_bounds, glyph_tex_rect;
graphene_point_t glyph_offset;
graphene_point_t glyph_offset, glyph_origin;
guint32 descriptor;
GskGpuGlyphLookupFlags flags;
glyph_origin = GRAPHENE_POINT_INIT (offset.x + (float) glyphs[i].geometry.x_offset / PANGO_SCALE,
offset.y + (float) glyphs[i].geometry.y_offset / PANGO_SCALE);
if (glyph_align)
{
glyph_origin.x = roundf (glyph_origin.x * scale * 4);
glyph_origin.y = roundf (glyph_origin.y * scale * 4);
flags = ((int) glyph_origin.x & 3) |
(((int) glyph_origin.y & 3) << 2);
glyph_origin.x = 0.25 * inv_scale * glyph_origin.x;
glyph_origin.y = 0.25 * inv_scale * glyph_origin.y;
}
else
{
flags = 0;
}
image = gsk_gpu_device_lookup_glyph_image (device,
self->frame,
font,
glyphs[i].glyph,
0,
flags,
scale,
&glyph_bounds,
&glyph_offset);
graphene_rect_scale (&GRAPHENE_RECT_INIT (-glyph_bounds.origin.x, -glyph_bounds.origin.y, gsk_gpu_image_get_width (image), gsk_gpu_image_get_height (image)), inv_scale, inv_scale, &glyph_tex_rect);
graphene_rect_scale (&GRAPHENE_RECT_INIT(0, 0, glyph_bounds.size.width, glyph_bounds.size.height), inv_scale, inv_scale, &glyph_bounds);
glyph_offset = GRAPHENE_POINT_INIT (offset.x - glyph_offset.x * inv_scale + (float) glyphs[i].geometry.x_offset / PANGO_SCALE,
offset.y - glyph_offset.y * inv_scale + (float) glyphs[i].geometry.y_offset / PANGO_SCALE);
gsk_rect_scale (&GRAPHENE_RECT_INIT (-glyph_bounds.origin.x, -glyph_bounds.origin.y, gsk_gpu_image_get_width (image), gsk_gpu_image_get_height (image)), inv_scale, inv_scale, &glyph_tex_rect);
gsk_rect_scale (&GRAPHENE_RECT_INIT(0, 0, glyph_bounds.size.width, glyph_bounds.size.height), inv_scale, inv_scale, &glyph_bounds);
glyph_origin = GRAPHENE_POINT_INIT (glyph_origin.x - glyph_offset.x * inv_scale,
glyph_origin.y - glyph_offset.y * inv_scale);
descriptor = gsk_gpu_node_processor_add_image (self, image, GSK_GPU_SAMPLER_DEFAULT);
if (glyphs[i].attr.is_color)
gsk_gpu_texture_op (self->frame,
@@ -3026,7 +3046,7 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
self->desc,
descriptor,
&glyph_bounds,
&glyph_offset,
&glyph_origin,
&glyph_tex_rect);
else
gsk_gpu_colorize_op (self->frame,
@@ -3034,7 +3054,7 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
self->desc,
descriptor,
&glyph_bounds,
&glyph_offset,
&glyph_origin,
&glyph_tex_rect,
&color);
@@ -3247,8 +3267,8 @@ gsk_gpu_node_processor_repeat_tile (GskGpuNodeProcessor *self,
rect,
&self->offset,
&GRAPHENE_RECT_INIT (
clipped_child_bounds.origin.x - x * child_bounds->size.width,
clipped_child_bounds.origin.y - y * child_bounds->size.height,
clipped_child_bounds.origin.x + x * child_bounds->size.width,
clipped_child_bounds.origin.y + y * child_bounds->size.height,
clipped_child_bounds.size.width,
clipped_child_bounds.size.height
));
@@ -3913,9 +3933,11 @@ gsk_gpu_node_processor_add_node (GskGpuNodeProcessor *self,
GskRenderNodeType node_type;
/* This catches the corner cases of empty nodes, so after this check
* there's quaranteed to be at least 1 pixel that needs to be drawn */
* there's quaranteed to be at least 1 pixel that needs to be drawn
*/
if (node->bounds.size.width == 0 || node->bounds.size.height == 0)
return;
if (!gsk_gpu_clip_may_intersect_rect (&self->clip, &self->offset, &node->bounds))
return;
@@ -3960,6 +3982,12 @@ gsk_gpu_node_processor_create_node_pattern (GskGpuPatternWriter *self,
if (!gsk_gpu_frame_should_optimize (self->frame, GSK_GPU_OPTIMIZE_UBER))
return FALSE;
/* This catches the corner cases of empty nodes, so after this check
* there's quaranteed to be at least 1 pixel that needs to be drawn
*/
if (node->bounds.size.width == 0 || node->bounds.size.height == 0)
return TRUE;
node_type = gsk_render_node_get_node_type (node);
if (node_type >= G_N_ELEMENTS (nodes_vtable))
{
+14 -4
View File
@@ -30,6 +30,7 @@ static const GdkDebugKey gsk_gpu_optimization_keys[] = {
{ "blit", GSK_GPU_OPTIMIZE_BLIT, "Use shaders instead of vkCmdBlit()/glBlitFramebuffer()" },
{ "gradients", GSK_GPU_OPTIMIZE_GRADIENTS, "Don't supersample gradients" },
{ "mipmap", GSK_GPU_OPTIMIZE_MIPMAP, "Avoid creating mipmaps" },
{ "glyph-align", GSK_GPU_OPTIMIZE_GLYPH_ALIGN, "Never align glyphs to the subpixel grid" },
{ "gl-baseinstance", GSK_GPU_OPTIMIZE_GL_BASE_INSTANCE, "Assume no ARB/EXT_base_instance support" },
};
@@ -118,7 +119,7 @@ gsk_gpu_renderer_dmabuf_downloader_download (GdkDmabufDownloader *downloader,
frame = gsk_gpu_renderer_create_frame (self);
gsk_gpu_frame_download_texture (frame,
g_get_monotonic_time(),
g_get_monotonic_time (),
GDK_TEXTURE (texture),
format,
data,
@@ -300,7 +301,7 @@ gsk_gpu_renderer_fallback_render_texture (GskGpuRenderer *self,
frame = gsk_gpu_renderer_create_frame (self);
gsk_gpu_frame_render (frame,
g_get_monotonic_time(),
g_get_monotonic_time (),
image,
NULL,
root,
@@ -342,6 +343,8 @@ gsk_gpu_renderer_render_texture (GskRenderer *renderer,
GdkTexture *texture;
graphene_rect_t rounded_viewport;
gsk_gpu_device_maybe_gc (priv->device);
gsk_gpu_renderer_make_current (self);
rounded_viewport = GRAPHENE_RECT_INIT (viewport->origin.x,
@@ -352,6 +355,7 @@ gsk_gpu_renderer_render_texture (GskRenderer *renderer,
gsk_render_node_get_preferred_depth (root),
rounded_viewport.size.width,
rounded_viewport.size.height);
if (image == NULL)
return gsk_gpu_renderer_fallback_render_texture (self, root, &rounded_viewport);
@@ -359,7 +363,7 @@ gsk_gpu_renderer_render_texture (GskRenderer *renderer,
texture = NULL;
gsk_gpu_frame_render (frame,
g_get_monotonic_time(),
g_get_monotonic_time (),
image,
NULL,
root,
@@ -369,6 +373,8 @@ gsk_gpu_renderer_render_texture (GskRenderer *renderer,
g_object_unref (frame);
g_object_unref (image);
gsk_gpu_device_queue_gc (priv->device);
/* check that callback setting texture was actually called, as its technically async */
g_assert (texture);
@@ -397,6 +403,8 @@ gsk_gpu_renderer_render (GskRenderer *renderer,
gsk_render_node_get_preferred_depth (root),
region);
gsk_gpu_device_maybe_gc (priv->device);
gsk_gpu_renderer_make_current (self);
backbuffer = GSK_GPU_RENDERER_GET_CLASS (self)->get_backbuffer (self);
@@ -406,7 +414,7 @@ gsk_gpu_renderer_render (GskRenderer *renderer,
surface = gdk_draw_context_get_surface (priv->context);
gsk_gpu_frame_render (frame,
g_get_monotonic_time(),
g_get_monotonic_time (),
backbuffer,
render_region,
root,
@@ -417,6 +425,8 @@ gsk_gpu_renderer_render (GskRenderer *renderer,
),
NULL);
gsk_gpu_device_queue_gc (priv->device);
gdk_draw_context_end_frame (priv->context);
g_clear_pointer (&render_region, cairo_region_destroy);
+2 -1
View File
@@ -117,7 +117,8 @@ typedef enum {
GSK_GPU_OPTIMIZE_BLIT = 1 << 3,
GSK_GPU_OPTIMIZE_GRADIENTS = 1 << 4,
GSK_GPU_OPTIMIZE_MIPMAP = 1 << 5,
GSK_GPU_OPTIMIZE_GLYPH_ALIGN = 1 << 6,
/* These require hardware support */
GSK_GPU_OPTIMIZE_GL_BASE_INSTANCE = 1 << 6,
GSK_GPU_OPTIMIZE_GL_BASE_INSTANCE = 1 << 7,
} GskGpuOptimizations;
+1
View File
@@ -99,6 +99,7 @@ gsk_ngl_renderer_get_backbuffer (GskGpuRenderer *renderer)
{
gsk_ngl_renderer_free_backbuffer (self);
self->backbuffer = gsk_gl_image_new_backbuffer (GSK_GL_DEVICE (gsk_gpu_renderer_get_device (renderer)),
GDK_GL_CONTEXT (context),
GDK_MEMORY_DEFAULT /* FIXME */,
ceil (gdk_surface_get_width (surface) * scale),
ceil (gdk_surface_get_height (surface) * scale));
+6
View File
@@ -425,6 +425,11 @@ gsk_vulkan_device_create_download_image (GskGpuDevice *device,
return image;
}
static void
gsk_vulkan_device_make_current (GskGpuDevice *device)
{
}
static void
gsk_vulkan_device_finalize (GObject *object)
{
@@ -493,6 +498,7 @@ gsk_vulkan_device_class_init (GskVulkanDeviceClass *klass)
gpu_device_class->create_atlas_image = gsk_vulkan_device_create_atlas_image;
gpu_device_class->create_upload_image = gsk_vulkan_device_create_upload_image;
gpu_device_class->create_download_image = gsk_vulkan_device_create_download_image;
gpu_device_class->make_current = gsk_vulkan_device_make_current;
object_class->finalize = gsk_vulkan_device_finalize;
}
+2 -2
View File
@@ -1,6 +1,6 @@
precision highp float;
#if defined(GSK_GLES) && __VERSION__ < 310
#if __VERSION__ < 420 || (defined(GSK_GLES) && __VERSION__ < 310)
layout(std140)
#else
layout(std140, binding = 0)
@@ -17,7 +17,7 @@ uniform PushConstants
#define GSK_GLOBAL_CLIP_RECT push.clip[0]
#define GSK_GLOBAL_SCALE push.scale
#if defined(GSK_GLES) && __VERSION__ < 310
#if __VERSION__ < 420 || (defined(GSK_GLES) && __VERSION__ < 310)
layout(std140)
#else
layout(std140, binding = 1)
+33 -2
View File
@@ -18,37 +18,68 @@ vec4
compute_color (void)
{
uint triangle_index = uint (GSK_VERTEX_INDEX) / 3u;
uint index;
uint index, fallback;
switch (triangle_index)
{
case 2u * SLICE_TOP_LEFT + 1u:
index = TOP;
fallback = LEFT;
break;
case 2u * SLICE_TOP:
case 2u * SLICE_TOP + 1u:
index = TOP;
fallback = TOP;
break;
case 2u * SLICE_TOP_RIGHT:
index = TOP;
fallback = RIGHT;
break;
case 2u * SLICE_TOP_RIGHT + 1u:
index = RIGHT;
fallback = TOP;
break;
case 2u * SLICE_RIGHT:
case 2u * SLICE_RIGHT + 1u:
index = RIGHT;
fallback = RIGHT;
break;
case 2u * SLICE_BOTTOM_RIGHT:
index = RIGHT;
fallback = BOTTOM;
break;
case 2u * SLICE_BOTTOM_RIGHT + 1u:
index = BOTTOM;
fallback = RIGHT;
break;
case 2u * SLICE_BOTTOM:
case 2u * SLICE_BOTTOM + 1u:
index = BOTTOM;
fallback = BOTTOM;
break;
case 2u * SLICE_BOTTOM_LEFT:
index = BOTTOM;
fallback = LEFT;
break;
case 2u * SLICE_BOTTOM_LEFT + 1u:
index = LEFT;
fallback = BOTTOM;
break;
case 2u * SLICE_LEFT:
case 2u * SLICE_LEFT + 1u:
index = LEFT;
fallback = LEFT;
break;
case 2u * SLICE_TOP_LEFT:
index = LEFT;
fallback = TOP;
break;
}
return color_premultiply (in_border_colors[index]);
if (in_border_widths[index] > 0.0)
return color_premultiply (in_border_colors[index]);
else
return color_premultiply (in_border_colors[fallback]);
}
void
+17
View File
@@ -132,3 +132,20 @@ gsk_rect_round_larger (graphene_rect_t *rect)
ceil (rect->origin.y + rect->size.height) - y);
}
static inline void
gsk_rect_scale (const graphene_rect_t *r,
float sx,
float sy,
graphene_rect_t *res)
{
if (G_UNLIKELY (sx < 0 || sy < 0))
{
graphene_rect_scale (r, sx, sy, res);
return;
}
res->origin.x = r->origin.x * sx;
res->origin.y = r->origin.y * sy;
res->size.width = r->size.width * sx;
res->size.height = r->size.height * sy;
}
+8 -1
View File
@@ -632,7 +632,7 @@ get_renderer_for_backend (GdkSurface *surface)
static GType
get_renderer_for_gl (GdkSurface *surface)
{
return GSK_TYPE_GL_RENDERER;
return gsk_ngl_renderer_get_type ();
}
static GType
@@ -645,6 +645,12 @@ get_renderer_for_vulkan (GdkSurface *surface)
#endif
}
static GType
get_renderer_for_gles2 (GdkSurface *surface)
{
return GSK_TYPE_GL_RENDERER;
}
static GType
get_renderer_fallback (GdkSurface *surface)
{
@@ -658,6 +664,7 @@ static struct {
{ get_renderer_for_env_var },
{ get_renderer_for_backend },
{ get_renderer_for_gl },
{ get_renderer_for_gles2 },
{ get_renderer_for_vulkan },
{ get_renderer_fallback },
};
+7
View File
@@ -3335,6 +3335,7 @@ gsk_container_node_new (GskRenderNode **children,
self->children = g_malloc_n (n_children, sizeof (GskRenderNode *));
self->children[0] = gsk_render_node_ref (children[0]);
node->offscreen_for_opacity = children[0]->offscreen_for_opacity;
gsk_rect_init_from_rect (&bounds, &(children[0]->bounds));
node->preferred_depth = gdk_memory_depth_merge (node->preferred_depth,
gsk_render_node_get_preferred_depth (children[0]));
@@ -4091,6 +4092,7 @@ gsk_repeat_node_draw_tiled (cairo_t *cr,
const graphene_rect_t *child_bounds)
{
cairo_pattern_t *pattern;
cairo_matrix_t matrix;
cairo_save (cr);
/* reset the clip so we get an unclipped pattern for repeating */
@@ -4107,6 +4109,11 @@ gsk_repeat_node_draw_tiled (cairo_t *cr,
cairo_restore (cr);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
cairo_pattern_get_matrix (pattern, &matrix);
cairo_matrix_translate (&matrix,
- x * child_bounds->size.width,
- y * child_bounds->size.height);
cairo_pattern_set_matrix (pattern, &matrix);
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
+339 -144
View File
@@ -46,7 +46,9 @@
#include <cairo-script-interpreter.h>
#endif
#include <cairo-gobject.h>
#include <pango/pangocairo.h>
#ifdef HAVE_PANGOFT
#include <pango/pangofc-fontmap.h>
#endif
@@ -86,6 +88,39 @@ context_finish (Context *context)
g_clear_object (&context->fontmap);
}
static gboolean
parse_enum (GtkCssParser *parser,
GType type,
gpointer out_value)
{
GEnumClass *class;
GEnumValue *v;
char *enum_name;
enum_name = gtk_css_parser_consume_ident (parser);
if (enum_name == NULL)
return FALSE;
class = g_type_class_ref (type);
v = g_enum_get_value_by_nick (class, enum_name);
if (v == NULL)
{
gtk_css_parser_error_value (parser, "Unknown value \"%s\" for enum \"%s\"",
enum_name, g_type_name (type));
g_free (enum_name);
g_type_class_unref (class);
return FALSE;
}
*(int*)out_value = v->value;
g_free (enum_name);
g_type_class_unref (class);
return TRUE;
}
static gboolean
parse_rect (GtkCssParser *parser,
Context *context,
@@ -854,7 +889,8 @@ parse_mask_mode (GtkCssParser *parser,
static PangoFont *
font_from_string (PangoFontMap *fontmap,
const char *string)
const char *string,
gboolean allow_fallback)
{
PangoFontDescription *desc;
PangoContext *ctx;
@@ -865,7 +901,7 @@ font_from_string (PangoFontMap *fontmap,
font = pango_font_map_load_font (fontmap, ctx, desc);
g_object_unref (ctx);
if (font)
if (font && !allow_fallback)
{
PangoFontDescription *desc2;
const char *family, *family2;
@@ -886,6 +922,77 @@ font_from_string (PangoFontMap *fontmap,
return font;
}
static double
font_get_dpi (PangoFont *font)
{
#ifdef HAVE_PANGOFT
if (PANGO_IS_FC_FONT (font))
{
FcPattern *pattern;
double dpi;
pattern = pango_fc_font_get_pattern (PANGO_FC_FONT (font));
if (FcPatternGetDouble (pattern, FC_DPI, 0, &dpi) == FcResultMatch)
return dpi;
}
#endif
/* FIXME, needs pango api */
return 96.0;
}
static PangoFont *
recreate_font_with_options (PangoFont *font,
cairo_hint_metrics_t hint_metrics,
cairo_hint_style_t hint_style,
cairo_antialias_t antialias,
double dpi)
{
PangoFontMap *fontmap;
PangoFontDescription *desc;
PangoContext *ctx;
cairo_scaled_font_t *sf;
cairo_font_options_t *options;
PangoFont *new_font;
options = cairo_font_options_create ();
sf = pango_cairo_font_get_scaled_font (PANGO_CAIRO_FONT (font));
cairo_scaled_font_get_font_options (sf, options);
if (cairo_font_options_get_hint_metrics (options) == hint_metrics &&
cairo_font_options_get_hint_style (options) == hint_style &&
cairo_font_options_get_antialias (options) == antialias &&
font_get_dpi (font) == dpi)
{
cairo_font_options_destroy (options);
return font;
}
cairo_font_options_set_hint_metrics (options, hint_metrics);
cairo_font_options_set_hint_style (options, hint_style);
cairo_font_options_set_antialias (options, antialias);
desc = pango_font_describe (font);
fontmap = pango_font_get_font_map (font);
ctx = pango_font_map_create_context (fontmap);
pango_cairo_context_set_font_options (ctx, options);
pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (fontmap), dpi);
new_font = pango_font_map_load_font (fontmap, ctx, desc);
g_object_unref (ctx);
pango_font_description_free (desc);
cairo_font_options_destroy (options);
g_object_unref (font);
return new_font;
}
#define MIN_ASCII_GLYPH 32
#define MAX_ASCII_GLYPH 127 /* exclusive */
#define N_ASCII_GLYPHS (MAX_ASCII_GLYPH - MIN_ASCII_GLYPH)
@@ -981,7 +1088,7 @@ ensure_fontmap (Context *context)
g_object_set_data_full (G_OBJECT (context->fontmap), "font-files", files, (GDestroyNotify) g_ptr_array_unref);
}
static void
static gboolean
add_font_from_file (Context *context,
const char *path,
GError **error)
@@ -997,7 +1104,7 @@ add_font_from_file (Context *context,
GTK_CSS_PARSER_ERROR,
GTK_CSS_PARSER_ERROR_FAILED,
"Custom fonts are not implemented for %s", G_OBJECT_TYPE_NAME (context->fontmap));
return;
return FALSE;
}
config = pango_fc_font_map_get_config (PANGO_FC_FONT_MAP (context->fontmap));
@@ -1006,18 +1113,20 @@ add_font_from_file (Context *context,
{
g_set_error (error,
GTK_CSS_PARSER_ERROR,
GTK_CSS_PARSER_ERROR_FAILED,
"Failed to add %s to FcConfig", path);
return;
GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
"Failed to load font");
return FALSE;
}
files = (GPtrArray *) g_object_get_data (G_OBJECT (context->fontmap), "font-files");
g_ptr_array_add (files, g_strdup (path));
pango_fc_font_map_config_changed (PANGO_FC_FONT_MAP (context->fontmap));
return TRUE;
}
static void
static gboolean
add_font_from_bytes (Context *context,
GBytes *bytes,
GError **error)
@@ -1025,10 +1134,11 @@ add_font_from_bytes (Context *context,
GFile *file;
GIOStream *iostream;
GOutputStream *ostream;
gboolean result;
file = g_file_new_tmp ("gtk4-font-XXXXXX.ttf", (GFileIOStream **) &iostream, error);
if (!file)
return;
return FALSE;
ostream = g_io_stream_get_output_stream (iostream);
if (g_output_stream_write_bytes (ostream, bytes, NULL, error) == -1)
@@ -1036,20 +1146,22 @@ add_font_from_bytes (Context *context,
g_object_unref (file);
g_object_unref (iostream);
return;
return FALSE;
}
g_io_stream_close (iostream, NULL, NULL);
g_object_unref (iostream);
add_font_from_file (context, g_file_peek_path (file), error);
result = add_font_from_file (context, g_file_peek_path (file), error);
g_object_unref (file);
return result;
}
#else /* !HAVE_PANGOFT */
static void
static gboolean
add_font_from_bytes (Context *context,
GBytes *bytes,
GError **error)
@@ -1058,6 +1170,7 @@ add_font_from_bytes (Context *context,
GTK_CSS_PARSER_ERROR,
GTK_CSS_PARSER_ERROR_FAILED,
"Not implemented");
return FALSE;
}
#endif
@@ -1068,94 +1181,105 @@ parse_font (GtkCssParser *parser,
gpointer out_font)
{
PangoFont *font = NULL;
char *s;
GtkCssLocation start_location;
PangoFontMap *fontmap;
char *font_name;
fontmap = pango_cairo_font_map_get_default ();
s = gtk_css_parser_consume_string (parser);
if (s == NULL)
font_name = gtk_css_parser_consume_string (parser);
if (font_name == NULL)
return FALSE;
start_location = *gtk_css_parser_get_start_location (parser);
if (context->fontmap)
font = font_from_string (context->fontmap, font_name, FALSE);
if (gtk_css_parser_try_token (parser, GTK_CSS_TOKEN_URL) ||
gtk_css_parser_has_function (parser, "url"))
if (gtk_css_parser_has_url (parser))
{
char *url;
char *scheme;
GBytes *bytes = NULL;
GError *error = NULL;
/* If we have a url, it is a bug if the font already exists in our custom fontmap */
if (context->fontmap)
if (font != NULL)
{
font = font_from_string (context->fontmap, s);
if (font)
gtk_css_parser_error_value (parser, "A font with this name already exists.");
/* consume the url to avoid more errors */
url = gtk_css_parser_consume_url (parser);
g_free (url);
}
else
{
char *scheme;
GBytes *bytes;
GError *error = NULL;
GtkCssLocation start_location;
gboolean success = FALSE;
start_location = *gtk_css_parser_get_start_location (parser);
url = gtk_css_parser_consume_url (parser);
if (url != NULL)
{
g_object_unref (font);
gtk_css_parser_error_value (parser, "This font already exists.");
return FALSE;
scheme = g_uri_parse_scheme (url);
if (scheme && g_ascii_strcasecmp (scheme, "data") == 0)
{
bytes = gtk_css_data_url_parse (url, NULL, &error);
}
else
{
GFile *file;
file = g_file_new_for_uri (url);
bytes = g_file_load_bytes (file, NULL, NULL, &error);
g_object_unref (file);
}
g_free (scheme);
g_free (url);
if (bytes != NULL)
{
success = add_font_from_bytes (context, bytes, &error);
g_bytes_unref (bytes);
}
if (!success)
{
gtk_css_parser_emit_error (parser,
&start_location,
gtk_css_parser_get_end_location (parser),
error);
}
}
if (success)
{
font = font_from_string (context->fontmap, font_name, FALSE);
if (!font)
{
gtk_css_parser_error (parser,
GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
&start_location,
gtk_css_parser_get_end_location (parser),
"The given url does not define a font named \"%s\"",
font_name);
}
}
}
}
else
{
if (!font)
font = font_from_string (pango_cairo_font_map_get_default (), font_name, TRUE);
url = gtk_css_parser_consume_url (parser);
scheme = g_uri_parse_scheme (url);
if (scheme && g_ascii_strcasecmp (scheme, "data") == 0)
{
bytes = gtk_css_data_url_parse (url, NULL, &error);
}
else
{
GFile *file;
file = g_file_new_for_uri (url);
bytes = g_file_load_bytes (file, NULL, NULL, &error);
g_object_unref (file);
}
g_free (scheme);
g_free (url);
if (bytes)
{
add_font_from_bytes (context, bytes, &error);
g_bytes_unref (bytes);
fontmap = context->fontmap;
}
else
{
g_assert (error != NULL);
gtk_css_parser_emit_error (parser,
&start_location,
gtk_css_parser_get_end_location (parser),
error);
g_clear_error (&error);
return FALSE;
}
if (!font)
gtk_css_parser_error_value (parser, "The font \"%s\" does not exist", font_name);
}
font = font_from_string (fontmap, s);
g_free (font_name);
if (!font && context->fontmap && fontmap != context->fontmap)
font = font_from_string (context->fontmap, s);
if (!font)
if (font)
{
*((PangoFont**)out_font) = font;
return TRUE;
}
else
{
gtk_css_parser_error_value (parser, "This font does not exist.");
return FALSE;
}
*((PangoFont**)out_font) = font;
g_free (s);
return TRUE;
}
static void
@@ -2199,6 +2323,60 @@ unpack_glyphs (PangoFont *font,
return TRUE;
}
static gboolean
parse_hint_metrics (GtkCssParser *parser,
Context *context,
gpointer out)
{
if (!parse_enum (parser, CAIRO_GOBJECT_TYPE_HINT_METRICS, out))
return FALSE;
if (*(cairo_hint_metrics_t *) out == CAIRO_HINT_METRICS_DEFAULT)
{
gtk_css_parser_error_value (parser, "Unknown value \"default\" for enum \"%s\"",
g_type_name (CAIRO_GOBJECT_TYPE_HINT_METRICS));
return FALSE;
}
return TRUE;
}
static gboolean
parse_hint_style (GtkCssParser *parser,
Context *context,
gpointer out)
{
if (!parse_enum (parser, CAIRO_GOBJECT_TYPE_HINT_STYLE, out))
return FALSE;
if (*(cairo_hint_style_t *) out == CAIRO_HINT_STYLE_DEFAULT)
{
gtk_css_parser_error_value (parser, "Unknown value \"default\" for enum \"%s\"",
g_type_name (CAIRO_GOBJECT_TYPE_HINT_STYLE));
return FALSE;
}
return TRUE;
}
static gboolean
parse_antialias (GtkCssParser *parser,
Context *context,
gpointer out)
{
if (!parse_enum (parser, CAIRO_GOBJECT_TYPE_ANTIALIAS, out))
return FALSE;
if (*(cairo_antialias_t *) out == CAIRO_ANTIALIAS_DEFAULT)
{
gtk_css_parser_error_value (parser, "Unknown value \"default\" for enum \"%s\"",
g_type_name (CAIRO_GOBJECT_TYPE_ANTIALIAS));
return FALSE;
}
return TRUE;
}
static GskRenderNode *
parse_text_node (GtkCssParser *parser,
Context *context)
@@ -2207,11 +2385,19 @@ parse_text_node (GtkCssParser *parser,
graphene_point_t offset = GRAPHENE_POINT_INIT (0, 0);
GdkRGBA color = GDK_RGBA("000000");
PangoGlyphString *glyphs = NULL;
cairo_hint_metrics_t hint_metrics = CAIRO_HINT_METRICS_OFF;
cairo_hint_style_t hint_style = CAIRO_HINT_STYLE_SLIGHT;
cairo_antialias_t antialias = CAIRO_ANTIALIAS_GRAY;
double dpi = 96.0;
const Declaration declarations[] = {
{ "font", parse_font, clear_font, &font },
{ "offset", parse_point, NULL, &offset },
{ "color", parse_color, NULL, &color },
{ "glyphs", parse_glyphs, clear_glyphs, &glyphs }
{ "glyphs", parse_glyphs, clear_glyphs, &glyphs },
{ "hint-metrics", parse_hint_metrics, NULL, &hint_metrics },
{ "hint-style", parse_hint_style, NULL, &hint_style },
{ "antialias", parse_antialias, NULL, &antialias },
{ "dpi", parse_positive_double, NULL, &dpi },
};
GskRenderNode *result;
@@ -2219,10 +2405,12 @@ parse_text_node (GtkCssParser *parser,
if (font == NULL)
{
font = font_from_string (pango_cairo_font_map_get_default (), "Cantarell 11");
font = font_from_string (pango_cairo_font_map_get_default (), "Cantarell 11", TRUE);
g_assert (font);
}
font = recreate_font_with_options (font, hint_metrics, hint_style, antialias, dpi);
if (!glyphs)
{
const char *text = "Hello";
@@ -2411,39 +2599,6 @@ clear_dash (gpointer inout_array)
g_clear_pointer ((GArray **) inout_array, g_array_unref);
}
static gboolean
parse_enum (GtkCssParser *parser,
GType type,
gpointer out_value)
{
GEnumClass *class;
GEnumValue *v;
char *enum_name;
enum_name = gtk_css_parser_consume_ident (parser);
if (enum_name == NULL)
return FALSE;
class = g_type_class_ref (type);
v = g_enum_get_value_by_nick (class, enum_name);
if (v == NULL)
{
gtk_css_parser_error_value (parser, "Unknown value \"%s\" for enum \"%s\"",
enum_name, g_type_name (type));
g_free (enum_name);
g_type_class_unref (class);
return FALSE;
}
*(int*)out_value = v->value;
g_free (enum_name);
g_type_class_unref (class);
return TRUE;
}
static gboolean
parse_fill_rule (GtkCssParser *parser,
Context *context,
@@ -3230,6 +3385,33 @@ append_string_param (Printer *p,
g_string_append_c (p->str, '\n');
}
static const char *
enum_to_nick (GType type,
int value)
{
GEnumClass *class;
GEnumValue *v;
class = g_type_class_ref (type);
v = g_enum_get_value (class, value);
g_type_class_unref (class);
return v->value_nick;
}
static void
append_enum_param (Printer *p,
const char *param_name,
GType type,
int value)
{
_indent (p);
g_string_append_printf (p->str, "%s: ", param_name);
g_string_append (p->str, enum_to_nick (type, value));
g_string_append_c (p->str, ';');
g_string_append_c (p->str, '\n');
}
static void
append_vec4_param (Printer *p,
const char *param_name,
@@ -3497,6 +3679,43 @@ gsk_text_node_serialize_font (GskRenderNode *node,
#endif
}
static void
gsk_text_node_serialize_font_options (GskRenderNode *node,
Printer *p)
{
PangoFont *font = gsk_text_node_get_font (node);
cairo_scaled_font_t *sf = pango_cairo_font_get_scaled_font (PANGO_CAIRO_FONT (font));
cairo_font_options_t *options;
cairo_hint_metrics_t hint_metrics;
cairo_hint_style_t hint_style;
cairo_antialias_t antialias;
options = cairo_font_options_create ();
cairo_scaled_font_get_font_options (sf, options);
hint_metrics = cairo_font_options_get_hint_metrics (options);
hint_style = cairo_font_options_get_hint_style (options);
antialias = cairo_font_options_get_antialias (options);
cairo_font_options_destroy (options);
if (hint_metrics != CAIRO_HINT_METRICS_OFF && hint_metrics != CAIRO_HINT_METRICS_DEFAULT)
append_enum_param (p, "hint-metrics", CAIRO_GOBJECT_TYPE_HINT_METRICS, hint_metrics);
if (hint_style != CAIRO_HINT_STYLE_SLIGHT && hint_style != CAIRO_HINT_STYLE_DEFAULT)
append_enum_param (p, "hint-style", CAIRO_GOBJECT_TYPE_HINT_STYLE, hint_style);
if (antialias != CAIRO_ANTIALIAS_GRAY && antialias != CAIRO_ANTIALIAS_DEFAULT)
append_enum_param (p, "antialias", CAIRO_GOBJECT_TYPE_ANTIALIAS, antialias);
}
static void
gsk_text_node_serialize_font_dpi (GskRenderNode *node,
Printer *p)
{
PangoFont *font = gsk_text_node_get_font (node);
append_float_param (p, "dpi", font_get_dpi (font), 96.f);
}
void
gsk_text_node_serialize_glyphs (GskRenderNode *node,
GString *p)
@@ -3578,33 +3797,6 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
pango_glyph_string_free (ascii);
}
static const char *
enum_to_nick (GType type,
int value)
{
GEnumClass *class;
GEnumValue *v;
class = g_type_class_ref (type);
v = g_enum_get_value (class, value);
g_type_class_unref (class);
return v->value_nick;
}
static void
append_enum_param (Printer *p,
const char *param_name,
GType type,
int value)
{
_indent (p);
g_string_append_printf (p->str, "%s: ", param_name);
g_string_append (p->str, enum_to_nick (type, value));
g_string_append_c (p->str, ';');
g_string_append_c (p->str, '\n');
}
static void
append_path_param (Printer *p,
const char *param_name,
@@ -4069,6 +4261,9 @@ render_node_print (Printer *p,
if (!graphene_point_equal (offset, graphene_point_zero ()))
append_point_param (p, "offset", offset);
gsk_text_node_serialize_font_options (node, p);
gsk_text_node_serialize_font_dpi (node, p);
end_node (p);
}
break;
+2 -2
View File
@@ -311,8 +311,8 @@ gsk_rounded_rect_scale_affine (GskRoundedRect *dest,
graphene_rect_scale (&src->bounds, scale_x, scale_y, &dest->bounds);
graphene_rect_offset (&dest->bounds, dx, dy);
scale_x = fabs (scale_x);
scale_y = fabs (scale_y);
scale_x = fabsf (scale_x);
scale_y = fabsf (scale_y);
for (guint i = 0; i < 4; i++)
{
-9
View File
@@ -1401,14 +1401,6 @@ gtk_at_spi_context_finalize (GObject *gobject)
G_OBJECT_CLASS (gtk_at_spi_context_parent_class)->finalize (gobject);
}
static void
gtk_at_spi_context_constructed (GObject *gobject)
{
GtkAtSpiContext *self G_GNUC_UNUSED = GTK_AT_SPI_CONTEXT (gobject);
G_OBJECT_CLASS (gtk_at_spi_context_parent_class)->constructed (gobject);
}
static const char *get_bus_address (GdkDisplay *display);
static void
@@ -1516,7 +1508,6 @@ gtk_at_spi_context_class_init (GtkAtSpiContextClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkATContextClass *context_class = GTK_AT_CONTEXT_CLASS (klass);
gobject_class->constructed = gtk_at_spi_context_constructed;
gobject_class->finalize = gtk_at_spi_context_finalize;
context_class->realize = gtk_at_spi_context_realize;
+1 -1
View File
@@ -96,7 +96,7 @@ gtk_at_spi_root_finalize (GObject *gobject)
g_free (self->desktop_name);
g_free (self->desktop_path);
G_OBJECT_CLASS (gtk_at_spi_root_parent_class)->dispose (gobject);
G_OBJECT_CLASS (gtk_at_spi_root_parent_class)->finalize (gobject);
}
static void
+8
View File
@@ -957,6 +957,14 @@ gtk_css_parser_parse_url_arg (GtkCssParser *parser,
return 1;
}
gboolean
gtk_css_parser_has_url (GtkCssParser *self)
{
return gtk_css_parser_has_token (self, GTK_CSS_TOKEN_URL)
|| gtk_css_parser_has_token (self, GTK_CSS_TOKEN_BAD_URL)
|| gtk_css_parser_has_function (self, "url");
}
/**
* gtk_css_parser_consume_url:
* @self: a `GtkCssParser`
+1
View File
@@ -116,6 +116,7 @@ gboolean gtk_css_parser_has_token (GtkCssParser
GtkCssTokenType token_type);
gboolean gtk_css_parser_has_ident (GtkCssParser *self,
const char *ident);
gboolean gtk_css_parser_has_url (GtkCssParser *self);
gboolean gtk_css_parser_has_number (GtkCssParser *self);
gboolean gtk_css_parser_has_integer (GtkCssParser *self);
gboolean gtk_css_parser_has_function (GtkCssParser *self,
+1 -1
View File
@@ -403,7 +403,7 @@ gtk_file_chooser_set_current_folder (GtkFileChooser *chooser,
GError **error)
{
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), FALSE);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (file == NULL || G_IS_FILE (file), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return GTK_FILE_CHOOSER_GET_IFACE (chooser)->set_current_folder (chooser, file, error);
+90
View File
@@ -1149,6 +1149,96 @@ gtk_accessible_get_bounds (GtkAccessible *self,
return GTK_ACCESSIBLE_GET_IFACE (self)->get_bounds (self, x, y, width, height);
}
struct _GtkAccessibleList
{
GList *objects;
};
/**
* gtk_accessible_list_new_from_list:
* @list: (element-type GtkAccessible): a reference to a `GList` containing a list of accessible values
*
* Allocates a new `GtkAccessibleList`, doing a shallow copy of the
* passed list of `GtkAccessible` instances.
*
* Returns: (transfer full): the list of accessible instances
*
* Since: 4.14
*/
GtkAccessibleList *
gtk_accessible_list_new_from_list (GList *list)
{
GtkAccessibleList *accessible_list = g_new (GtkAccessibleList, 1);
accessible_list->objects = g_list_copy (list);
return accessible_list;
}
/**
* gtk_accessible_list_new_from_array:
* @accessibles: (array length=n_accessibles): array of GtkAccessible
* @n_accessibles: length of @accessibles array
*
* Allocates a new list of accessible instances.
*
* Returns: (transfer full): the newly created list of accessible instances
*
* Since: 4.14
*/
GtkAccessibleList *
gtk_accessible_list_new_from_array (GtkAccessible **accessibles,
gsize n_accessibles)
{
GtkAccessibleList *accessible_list;
GList *list = NULL;
g_return_val_if_fail (accessibles == NULL || n_accessibles == 0, NULL);
accessible_list = g_new (GtkAccessibleList, 1);
for (gsize i = 0; i < n_accessibles; i++)
{
list = g_list_prepend (list, accessibles[i]);
}
accessible_list->objects = g_list_reverse (list);
return accessible_list;
}
static void
gtk_accessible_list_free (GtkAccessibleList *accessible_list)
{
g_free (accessible_list->objects);
g_free (accessible_list);
}
static GtkAccessibleList *
gtk_accessible_list_copy (GtkAccessibleList *accessible_list)
{
return gtk_accessible_list_new_from_list (accessible_list->objects);
}
/**
* gtk_accessible_list_get_objects:
*
* Gets the list of objects this boxed type holds
*
* Returns: (transfer container) (element-type GtkAccessible): a shallow copy of the objects
*
* Since: 4.14
*/
GList *
gtk_accessible_list_get_objects (GtkAccessibleList *accessible_list)
{
return g_list_copy (accessible_list->objects);
}
G_DEFINE_BOXED_TYPE (GtkAccessibleList, gtk_accessible_list,
gtk_accessible_list_copy,
gtk_accessible_list_free)
/*< private >
* gtk_accessible_should_present:
* @self: a `GtkAccessible`
+24
View File
@@ -154,6 +154,15 @@ struct _GtkAccessibleInterface
int *height);
};
/**
* GtkAccessibleList:
*
* A boxed type which wraps a list of references to GtkAccessible objects.
*
* Since: 4.14
*/
typedef struct _GtkAccessibleList GtkAccessibleList;
GDK_AVAILABLE_IN_ALL
GtkATContext * gtk_accessible_get_at_context (GtkAccessible *self);
@@ -236,4 +245,19 @@ GDK_AVAILABLE_IN_ALL
void gtk_accessible_relation_init_value (GtkAccessibleRelation relation,
GValue *value);
#define GTK_ACCESSIBLE_LIST (gtk_accessible_list_get_type())
GDK_AVAILABLE_IN_4_14
GType gtk_accessible_list_get_type (void);
GDK_AVAILABLE_IN_4_14
GList * gtk_accessible_list_get_objects (GtkAccessibleList *accessible_list);
GDK_AVAILABLE_IN_4_14
GtkAccessibleList * gtk_accessible_list_new_from_list (GList *list);
GDK_AVAILABLE_IN_4_14
GtkAccessibleList * gtk_accessible_list_new_from_array (GtkAccessible **accessibles,
gsize n_accessibles);
G_END_DECLS
+12 -1
View File
@@ -1332,7 +1332,18 @@ gtk_accessible_value_collect_value (const GtkAccessibleCollect *cstate,
GtkAccessibleValueRefListCtor ctor =
(GtkAccessibleValueRefListCtor) cstate->ctor;
GList *value = g_value_get_pointer (value_);
GList *value;
if (g_type_is_a (G_VALUE_TYPE(value_), GTK_ACCESSIBLE_LIST))
{
GtkAccessibleList *boxed = g_value_get_boxed (value_);
value = gtk_accessible_list_get_objects (boxed);
}
else
{
value = g_value_get_pointer (value_);
}
if (ctor == NULL)
{
+2 -2
View File
@@ -257,14 +257,14 @@ gtk_application_startup (GApplication *g_application)
before2 = GDK_PROFILER_CURRENT_TIME;
gtk_init ();
gdk_profiler_end_mark (before2, "gtk init", NULL);
gdk_profiler_end_mark (before2, "gtk_init", NULL);
priv->impl = gtk_application_impl_new (application, gdk_display_get_default ());
gtk_application_impl_startup (priv->impl, priv->register_session);
gtk_application_load_resources (application);
gdk_profiler_end_mark (before, "gtk application startup", NULL);
gdk_profiler_end_mark (before, "Application startup", NULL);
}
static void
+5 -11
View File
@@ -604,14 +604,10 @@ static const struct {
GtkAccessible *accessible,
GdkDisplay *display);
} a11y_backends[] = {
#if defined(GDK_WINDOWING_WAYLAND)
{ "AT-SPI (Wayland)", "atspi", gtk_at_spi_create_context },
#endif
#if defined(GDK_WINDOWING_X11)
{ "AT-SPI (X11)", "atspi", gtk_at_spi_create_context },
#if defined(GDK_WINDOWING_WAYLAND) || defined(GDK_WINDOWING_X11)
{ "AT-SPI", "atspi", gtk_at_spi_create_context },
#endif
{ "Test", "test", gtk_test_at_context_new },
{ NULL, NULL, NULL },
};
/**
@@ -634,6 +630,7 @@ gtk_at_context_create (GtkAccessibleRole accessible_role,
GdkDisplay *display)
{
static const char *gtk_a11y_env;
GtkATContext *res = NULL;
if (gtk_a11y_env == NULL)
{
@@ -661,12 +658,9 @@ gtk_at_context_create (GtkAccessibleRole accessible_role,
if (g_ascii_strcasecmp (gtk_a11y_env, "none") == 0)
return NULL;
GtkATContext *res = NULL;
for (guint i = 0; i < G_N_ELEMENTS (a11y_backends); i++)
for (size_t i = 0; i < G_N_ELEMENTS (a11y_backends); i++)
{
if (a11y_backends[i].name == NULL)
break;
g_assert (a11y_backends[i].name != NULL);
if (a11y_backends[i].create_context != NULL &&
(*gtk_a11y_env == '0' || g_ascii_strcasecmp (a11y_backends[i].env_name, gtk_a11y_env) == 0))
+1 -1
View File
@@ -2251,7 +2251,7 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
guint64 after = GDK_PROFILER_CURRENT_TIME;
if (after - before > 500000) /* half a millisecond */
{
gdk_profiler_add_mark (before, after - before, "builder load", filename);
gdk_profiler_add_mark (before, after - before, "Builder load", filename);
}
}
}
+1 -1
View File
@@ -1363,7 +1363,7 @@ gtk_css_node_validate (GtkCssNode *cssnode)
if (GDK_PROFILER_IS_RUNNING)
{
gdk_profiler_end_mark (before, "css validation", "");
gdk_profiler_end_mark (before, "Validate CSS", "");
gdk_profiler_set_int_counter (invalidated_nodes_counter, invalidated_nodes);
gdk_profiler_set_int_counter (created_styles_counter, created_styles);
invalidated_nodes = 0;
+2 -2
View File
@@ -1016,7 +1016,7 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
}
#endif
gdk_profiler_end_mark (before, "create selector tree", NULL);
gdk_profiler_end_mark (before, "Create CSS selector tree", NULL);
}
static void
@@ -1081,7 +1081,7 @@ gtk_css_provider_load_internal (GtkCssProvider *self,
if (GDK_PROFILER_IS_RUNNING)
{
char *uri = g_file_get_uri (file);
gdk_profiler_end_mark (before, "theme load", uri);
gdk_profiler_end_mark (before, "CSS theme load", uri);
g_free (uri);
}
}
+2 -2
View File
@@ -75,7 +75,7 @@
*
* // This widget accepts two types of drop types: GFile objects
* // and GdkPixbuf objects
* gtk_drop_target_set_gtypes (target, (GTypes [2]) {
* gtk_drop_target_set_gtypes (target, (GType [2]) {
* G_TYPE_FILE,
* GDK_TYPE_PIXBUF,
* }, 2);
@@ -935,7 +935,7 @@ gtk_drop_target_get_formats (GtkDropTarget *self)
* that can be dropped on the target
* @n_types: number of @types
*
* Sets the supported `GTypes` for this drop target.
* Sets the supported `GType`s for this drop target.
*/
void
gtk_drop_target_set_gtypes (GtkDropTarget *self,
+2 -2
View File
@@ -761,7 +761,7 @@ populate_emoji_chooser (gpointer data)
now = g_get_monotonic_time ();
if (now > start + 200) /* 2 ms */
{
gdk_profiler_add_mark (start * 1000, (now - start) * 1000, "emojichooser", "populate");
gdk_profiler_add_mark (start * 1000, (now - start) * 1000, "Emojichooser populate", NULL);
return G_SOURCE_CONTINUE;
}
}
@@ -771,7 +771,7 @@ populate_emoji_chooser (gpointer data)
chooser->box = NULL;
chooser->populate_idle = 0;
gdk_profiler_end_mark (start, "emojichooser", "populate (finish)");
gdk_profiler_end_mark (start, "Emojichooser populate (finish)", NULL);
return G_SOURCE_REMOVE;
}
+9
View File
@@ -44,6 +44,15 @@ void gtk_graphics_offload_set_child (GtkGraphicsOffload *
GDK_AVAILABLE_IN_4_14
GtkWidget * gtk_graphics_offload_get_child (GtkGraphicsOffload *self);
/**
* GtkGraphicsOffloadEnabled:
* @GTK_GRAPHICS_OFFLOAD_ENABLED: Graphics offloading is enabled.
* @GTK_GRAPHICS_OFFLOAD_DISABLED: Graphics offloading is disabled.
*
* Represents the state of graphics offlodading.
*
* Since: 4.14
*/
typedef enum
{
GTK_GRAPHICS_OFFLOAD_ENABLED,
+2 -2
View File
@@ -2069,7 +2069,7 @@ ensure_valid_themes (GtkIconTheme *self,
load_themes (self);
gdk_profiler_end_mark (before, "icon theme load", self->current_theme);
gdk_profiler_end_mark (before, "Icon theme load", self->current_theme);
if (was_valid)
queue_theme_changed (self);
@@ -3822,7 +3822,7 @@ icon_ensure_texture__locked (GtkIconPaintable *icon,
/* Don't report quick (< 0.5 msec) parses */
if (end - before > 500000 || !in_thread)
{
gdk_profiler_add_markf (before, (end - before), in_thread ? "icon load (thread)" : "icon load" ,
gdk_profiler_add_markf (before, (end - before), in_thread ? "Icon load (thread)" : "Icon load" ,
"%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale);
}
}
+1 -1
View File
@@ -353,7 +353,7 @@ init_compose_table_thread_cb (GTask *task,
g_task_return_boolean (task, TRUE);
gdk_profiler_end_mark (before, "im compose table load (thread)", NULL);
gdk_profiler_end_mark (before, "Compose table load (thread)", NULL);
}
static void
+18 -3
View File
@@ -117,7 +117,6 @@ gtk_list_item_change_release (GtkListItemChange *change,
if (!g_hash_table_replace (change->deleted_items, gtk_list_item_base_get_item (GTK_LIST_ITEM_BASE (widget)), widget))
{
g_warning ("Duplicate item detected in list. Picking one randomly.");
gtk_list_item_change_recycle (change, widget);
}
}
@@ -968,10 +967,26 @@ gtk_list_item_manager_add_items (GtkListItemManager *self,
if (section != NULL && section->type == GTK_LIST_TILE_HEADER)
{
guint start, end;
GtkListTile *footer = gtk_list_tile_get_footer (self, section);
GtkListTile *previous_footer = gtk_list_tile_get_previous_skip (section);
gtk_section_model_get_section (GTK_SECTION_MODEL (self->model), position, &start, &end);
if (previous_footer != NULL && previous_footer->type == GTK_LIST_TILE_FOOTER &&
position > start && position < end)
{
gtk_list_item_change_clear_header (change, &section->widget);
gtk_list_tile_set_type (section, GTK_LIST_TILE_REMOVED);
gtk_list_tile_set_type (previous_footer, GTK_LIST_TILE_REMOVED);
section = gtk_list_tile_get_header (self, previous_footer);
}
gtk_list_item_change_clear_header (change, &section->widget);
gtk_list_tile_set_type (section,
GTK_LIST_TILE_UNMATCHED_HEADER);
gtk_list_tile_set_type (gtk_list_tile_get_footer (self, section),
gtk_list_tile_set_type (footer,
GTK_LIST_TILE_UNMATCHED_FOOTER);
}
}
@@ -1610,7 +1625,7 @@ gtk_list_item_manager_model_sections_changed_cb (GListModel *model,
gtk_list_item_change_clear_header (&change, &header->widget);
gtk_list_tile_set_type (header, GTK_LIST_TILE_UNMATCHED_HEADER);
n_items -= MIN (n_items, position - offset);
n_items += offset;
while (n_items > 0)
{
switch (tile->type)
+3 -3
View File
@@ -549,7 +549,7 @@ do_post_parse_initialization (void)
gsk_render_node_init_types ();
_gtk_ensure_resources ();
gdk_profiler_end_mark (before, "basic initialization", NULL);
gdk_profiler_end_mark (before, "Basic initialization", NULL);
gtk_initialized = TRUE;
@@ -559,13 +559,13 @@ do_post_parse_initialization (void)
#endif
gtk_im_modules_init ();
gtk_media_file_extension_init ();
gdk_profiler_end_mark (before, "init modules", NULL);
gdk_profiler_end_mark (before, "Init modules", NULL);
before = GDK_PROFILER_CURRENT_TIME;
display_manager = gdk_display_manager_get ();
if (gdk_display_manager_get_default_display (display_manager) != NULL)
default_display_notify_cb (display_manager);
gdk_profiler_end_mark (before, "create display", NULL);
gdk_profiler_end_mark (before, "Create display", NULL);
g_signal_connect (display_manager, "notify::default-display",
G_CALLBACK (default_display_notify_cb),
+2 -2
View File
@@ -11956,7 +11956,7 @@ gtk_widget_render (GtkWidget *widget,
if (GDK_PROFILER_IS_RUNNING)
{
before_render = GDK_PROFILER_CURRENT_TIME;
gdk_profiler_add_mark (before_snapshot, (before_render - before_snapshot), "widget snapshot", "");
gdk_profiler_add_mark (before_snapshot, (before_render - before_snapshot), "Widget snapshot", "");
}
if (root != NULL)
@@ -11972,7 +11972,7 @@ gtk_widget_render (GtkWidget *widget,
gsk_render_node_unref (root);
gdk_profiler_end_mark (before_render, "widget render", "");
gdk_profiler_end_mark (before_render, "Widget render", "");
}
}
+27 -23
View File
@@ -2949,6 +2949,17 @@ unset_titlebar (GtkWindow *window)
}
}
static gboolean
gtk_window_is_composited (GtkWindow *window)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GdkDisplay *display;
display = priv->display;
return gdk_display_is_rgba (display) && gdk_display_is_composited (display);
}
static gboolean
gtk_window_supports_client_shadow (GtkWindow *window)
{
@@ -2957,22 +2968,7 @@ gtk_window_supports_client_shadow (GtkWindow *window)
display = priv->display;
if (!gdk_display_is_rgba (display))
return FALSE;
if (!gdk_display_is_composited (display))
return FALSE;
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
if (!gdk_x11_screen_supports_net_wm_hint (gdk_x11_display_get_screen (display),
g_intern_static_string ("_GTK_FRAME_EXTENTS")))
return FALSE;
}
#endif
return TRUE;
return gdk_display_supports_shadow_width (display);
}
static void
@@ -2981,11 +2977,15 @@ gtk_window_enable_csd (GtkWindow *window)
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *widget = GTK_WIDGET (window);
/* We need a visual with alpha for client shadows */
if (priv->use_client_shadow)
gtk_widget_add_css_class (widget, "csd");
/* We need a visual with alpha for rounded corners */
if (gtk_window_is_composited (window))
{
gtk_widget_add_css_class (widget, "csd");
}
else
gtk_widget_add_css_class (widget, "solid-csd");
{
gtk_widget_add_css_class (widget, "solid-csd");
}
priv->client_decorated = TRUE;
}
@@ -3044,8 +3044,8 @@ gtk_window_set_titlebar (GtkWindow *window,
else
{
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
gtk_window_enable_csd (window);
priv->titlebar = titlebar;
priv->title_box = titlebar;
gtk_widget_insert_before (priv->title_box, widget, NULL);
@@ -4298,9 +4298,9 @@ gtk_window_realize (GtkWidget *widget)
/* Create default title bar */
if (!priv->client_decorated && gtk_window_should_use_csd (window))
{
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
if (priv->use_client_shadow)
if (gtk_window_is_composited (window))
{
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
gtk_window_enable_csd (window);
if (priv->title_box == NULL)
@@ -4314,6 +4314,8 @@ gtk_window_realize (GtkWidget *widget)
update_window_actions (window);
}
else
priv->use_client_shadow = FALSE;
}
surface = gdk_surface_new_toplevel (gtk_widget_get_display (widget));
@@ -4453,6 +4455,8 @@ gtk_window_unrealize (GtkWidget *widget)
gdk_surface_set_widget (surface, NULL);
g_clear_pointer (&priv->surface, gdk_surface_destroy);
priv->use_client_shadow = FALSE;
}
static void
+3
View File
@@ -447,6 +447,9 @@ drag_gesture_update_cb (GtkGestureDrag *gesture,
p.x += native_x;
p.y += native_y;
if (GTK_IS_WINDOW (native))
gtk_window_unfullscreen (GTK_WINDOW (native));
surface = gtk_native_get_surface (native);
if (GDK_IS_TOPLEVEL (surface))
gdk_toplevel_begin_move (GDK_TOPLEVEL (surface),
+1 -1
View File
@@ -159,7 +159,7 @@
</object>
</child>
<child>
<object class="GtkCheckButton" id="verboe">
<object class="GtkCheckButton" id="verbose">
<property name="label">Verbose</property>
<signal name="toggled" handler="flag_toggled"/>
</object>
+3
View File
@@ -1,5 +1,8 @@
#! /bin/sh
export LIBGL_ALWAYS_SOFTWARE=1
export GDK_VULKAN_DEVICE=1
version=$(head -5 meson.build | grep version | sed -e "s/[^']*'//" -e "s/'.*$//")
release_build_dir="release_build"
branch=$(git branch --show-current)
+1 -1
View File
@@ -1,5 +1,5 @@
project('gtk', 'c',
version: '4.13.6',
version: '4.13.7',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
+3
View File
@@ -115,12 +115,15 @@ gtk_gst_paintable_video_renderer_create_video_sink (GstPlayerVideoRenderer *rend
GstPlayer *player)
{
GtkGstPaintable *self = GTK_GST_PAINTABLE (renderer);
GdkDmabufFormats *dmabuf_formats;
GstElement *sink;
GdkGLContext *ctx;
dmabuf_formats = gdk_display_get_dmabuf_formats (gdk_display_get_default ());
sink = g_object_new (GTK_TYPE_GST_SINK,
"paintable", self,
"gl-context", self->context,
"dmabuf-formats", dmabuf_formats,
NULL);
if (self->context != NULL)
+160 -3
View File
@@ -52,10 +52,16 @@
#include <gst/gl/gstglfuncs.h>
#ifdef HAVE_GSTREAMER_DRM
#include <drm_fourcc.h>
#include <gst/allocators/gstdmabuf.h>
#endif
enum {
PROP_0,
PROP_PAINTABLE,
PROP_GL_CONTEXT,
PROP_DMABUF_FORMATS,
N_PROPS,
};
@@ -71,7 +77,11 @@ static GstStaticPadTemplate gtk_gst_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), "
GST_STATIC_CAPS (
#ifdef HAVE_GSTREAMER_DRM
GST_VIDEO_DMA_DRM_CAPS_MAKE "; "
#endif
"video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), "
"format = (string) RGBA, "
"width = " GST_VIDEO_SIZE_RANGE ", "
"height = " GST_VIDEO_SIZE_RANGE ", "
@@ -116,6 +126,42 @@ gtk_gst_sink_get_times (GstBaseSink *bsink,
}
}
#ifdef HAVE_GSTREAMER_DRM
static void
add_drm_formats_and_modifiers (GstCaps *caps,
GdkDmabufFormats *dmabuf_formats)
{
GValue dmabuf_list = G_VALUE_INIT;
size_t i;
g_value_init (&dmabuf_list, GST_TYPE_LIST);
for (i = 0; i < gdk_dmabuf_formats_get_n_formats (dmabuf_formats); i++)
{
GValue value = G_VALUE_INIT;
gchar *drm_format_string;
guint32 fmt;
guint64 mod;
gdk_dmabuf_formats_get_format (dmabuf_formats, i, &fmt, &mod);
if (mod == DRM_FORMAT_MOD_INVALID)
continue;
drm_format_string = gst_video_dma_drm_fourcc_to_string (fmt, mod);
if (!drm_format_string)
continue;
g_value_init (&value, G_TYPE_STRING);
g_value_take_string (&value, drm_format_string);
gst_value_list_append_and_take_value (&dmabuf_list, &value);
}
gst_structure_take_value (gst_caps_get_structure (caps, 0), "drm-format",
&dmabuf_list);
}
#endif
static GstCaps *
gtk_gst_sink_get_caps (GstBaseSink *bsink,
GstCaps *filter)
@@ -127,6 +173,13 @@ gtk_gst_sink_get_caps (GstBaseSink *bsink,
if (self->gst_context)
{
tmp = gst_pad_get_pad_template_caps (GST_BASE_SINK_PAD (bsink));
#ifdef HAVE_GSTREAMER_DRM
if (self->dmabuf_formats)
{
tmp = gst_caps_make_writable (tmp);
add_drm_formats_and_modifiers (tmp, self->dmabuf_formats);
}
#endif
}
else
{
@@ -159,8 +212,24 @@ gtk_gst_sink_set_caps (GstBaseSink *bsink,
GST_DEBUG_OBJECT (self, "set caps with %" GST_PTR_FORMAT, caps);
if (!gst_video_info_from_caps (&self->v_info, caps))
return FALSE;
#ifdef HAVE_GSTREAMER_DRM
if (gst_video_is_dma_drm_caps (caps)) {
if (!gst_video_info_dma_drm_from_caps (&self->drm_info, caps))
return FALSE;
if (!gst_video_info_dma_drm_to_video_info (&self->drm_info, &self->v_info))
return FALSE;
GST_INFO_OBJECT (self, "using DMABuf, passthrough possible");
} else {
gst_video_info_dma_drm_init (&self->drm_info);
#endif
if (!gst_video_info_from_caps (&self->v_info, caps))
return FALSE;
#ifdef HAVE_GSTREAMER_DRM
}
#endif
return TRUE;
}
@@ -202,6 +271,14 @@ gtk_gst_sink_propose_allocation (GstBaseSink *bsink,
return FALSE;
}
#ifdef HAVE_GSTREAMER_DRM
if (gst_caps_features_contains (gst_caps_get_features (caps, 0), GST_CAPS_FEATURE_MEMORY_DMABUF))
{
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
return TRUE;
}
#endif
if (!gst_caps_features_contains (gst_caps_get_features (caps, 0), GST_CAPS_FEATURE_MEMORY_GL_MEMORY))
return FALSE;
@@ -287,6 +364,66 @@ gtk_gst_sink_texture_from_buffer (GtkGstSink *self,
GstVideoFrame *frame = g_new (GstVideoFrame, 1);
GdkTexture *texture;
#ifdef HAVE_GSTREAMER_DRM
if (gst_is_dmabuf_memory (gst_buffer_peek_memory (buffer, 0)))
{
g_autoptr (GdkDmabufTextureBuilder) builder = NULL;
const GstVideoMeta *vmeta = gst_buffer_get_video_meta (buffer);
GError *error = NULL;
int i;
/* We don't map dmabufs */
g_clear_pointer (&frame, g_free);
g_return_val_if_fail (vmeta, NULL);
g_return_val_if_fail (self->gdk_context, NULL);
g_return_val_if_fail (self->drm_info.drm_fourcc != DRM_FORMAT_INVALID, NULL);
builder = gdk_dmabuf_texture_builder_new ();
gdk_dmabuf_texture_builder_set_display (builder, gdk_gl_context_get_display (self->gdk_context));
gdk_dmabuf_texture_builder_set_fourcc (builder, self->drm_info.drm_fourcc);
gdk_dmabuf_texture_builder_set_modifier (builder, self->drm_info.drm_modifier);
// Padded width/height is set into the vmeta, perhaps we should import using these ?
gdk_dmabuf_texture_builder_set_width (builder, GST_VIDEO_INFO_WIDTH (&self->v_info));
gdk_dmabuf_texture_builder_set_height (builder, GST_VIDEO_INFO_HEIGHT (&self->v_info));
gdk_dmabuf_texture_builder_set_n_planes (builder, vmeta->n_planes);
for (i = 0; i < vmeta->n_planes; i++)
{
GstMemory *mem;
guint mem_idx, length;
gsize skip;
if (!gst_buffer_find_memory (buffer,
vmeta->offset[i],
1,
&mem_idx,
&length,
&skip))
{
GST_ERROR_OBJECT (self, "Buffer data is bogus");
return NULL;
}
mem = gst_buffer_peek_memory (buffer, mem_idx);
gdk_dmabuf_texture_builder_set_fd (builder, i, gst_dmabuf_memory_get_fd (mem));
gdk_dmabuf_texture_builder_set_offset (builder, i, mem->offset + skip);
gdk_dmabuf_texture_builder_set_stride (builder, i, vmeta->stride[i]);
}
texture = gdk_dmabuf_texture_builder_build (builder,
(GDestroyNotify) gst_buffer_unref,
gst_buffer_ref (buffer),
&error);
if (!texture)
GST_ERROR_OBJECT (self, "Failed to create dmabuf texture: %s", error->message);
*pixel_aspect_ratio = ((double) GST_VIDEO_INFO_PAR_N (&self->v_info) /
(double) GST_VIDEO_INFO_PAR_D (&self->v_info));
}
else
#endif
if (self->gdk_context &&
gst_video_frame_map (frame, &self->v_info, buffer, GST_MAP_READ | GST_MAP_GL))
{
@@ -593,6 +730,10 @@ gtk_gst_sink_set_property (GObject *object,
g_clear_object (&self->gdk_context);
break;
case PROP_DMABUF_FORMATS:
self->dmabuf_formats = g_value_get_boxed (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -615,6 +756,9 @@ gtk_gst_sink_get_property (GObject *object,
case PROP_GL_CONTEXT:
g_value_set_object (value, self->gdk_context);
break;
case PROP_DMABUF_FORMATS:
g_value_set_boxed (value, self->dmabuf_formats);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -675,6 +819,19 @@ gtk_gst_sink_class_init (GtkGstSinkClass * klass)
GDK_TYPE_GL_CONTEXT,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
/**
* GtkGstSink:dmabuf-formats:
*
* The #GdkDmabufFormats that are supported by the #GdkDisplay and can be used
* with #GdkDmabufTextureBuilder.
*
* Since: 4.14
*/
properties[PROP_DMABUF_FORMATS] =
g_param_spec_boxed ("dmabuf-formats", NULL, NULL,
GDK_TYPE_DMABUF_FORMATS,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, N_PROPS, properties);
gst_element_class_set_metadata (gstelement_class,
+5
View File
@@ -47,11 +47,16 @@ struct _GtkGstSink
GstVideoSink parent;
GstVideoInfo v_info;
#ifdef HAVE_GSTREAMER_DRM
GstVideoInfoDmaDrm drm_info;
#endif
GtkGstPaintable * paintable;
GdkGLContext * gdk_context;
GstGLDisplay * gst_display;
GstGLContext * gst_gdk_context;
GstGLContext * gst_context;
GdkDmabufFormats * dmabuf_formats;
};
struct _GtkGstSinkClass
+10 -1
View File
@@ -43,6 +43,8 @@ gstplayer_dep = dependency('gstreamer-player-1.0', version: '>= 1.12.3',
required: get_option('media-gstreamer'))
gstgl_dep = dependency('gstreamer-gl-1.0', version: '>= 1.12.3',
required: get_option('media-gstreamer'))
gstdrm_dep = dependency('gstreamer-allocators-1.0', version: '>= 1.23',
required: false)
if gstplayer_dep.found() and gstgl_dep.found()
extra_win_cflags = []
@@ -54,6 +56,13 @@ if gstplayer_dep.found() and gstgl_dep.found()
media_backends += 'gstreamer'
cdata.set('HAVE_GSTREAMER', 1)
media_gst_deps = [ libm, libgtk_dep, gstplayer_dep, gstgl_dep ]
if dmabuf_dep.found() and gstdrm_dep.found()
cdata.set('HAVE_GSTREAMER_DRM', 1)
media_gst_deps += [ gstdrm_dep ]
endif
shared_module('media-gstreamer',
sources: [
'gtkgstmediafile.c',
@@ -61,7 +70,7 @@ if gstplayer_dep.found() and gstgl_dep.found()
'gtkgstsink.c',
],
c_args: extra_c_args + extra_win_cflags,
dependencies: [ libm, libgtk_dep, gstplayer_dep, gstgl_dep ],
dependencies: media_gst_deps,
name_suffix: module_suffix,
install_dir: media_install_dir,
install: true,
+86 -78
View File
@@ -22,9 +22,9 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2023-09-19 01:36+0000\n"
"POT-Creation-Date: 2023-11-18 03:13+0000\n"
"PO-Revision-Date: 2023-09-19 18:38+0200\n"
"Last-Translator: Guillaume Bernard <associations@guillaume-bernard.fr>\n"
"Last-Translator: AesirIvy <aesir.ivy@gmx.com>\n"
"Language-Team: GNOME French Team <gnomefr@traduc.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
@@ -61,59 +61,59 @@ msgstr "Impossible de fournir le contenu comme « %s »"
msgid "Cannot provide contents as %s"
msgstr "Impossible de fournir le contenu comme %s"
#: gdk/gdkdisplay.c:156 gdk/gdkglcontext.c:442
#: gdk/gdkdisplay.c:156 gdk/gdkglcontext.c:443
msgid "The current backend does not support OpenGL"
msgstr "Le moteur actuel ne gère pas OpenGL"
#: gdk/gdkdisplay.c:1245 gdk/gdksurface.c:1252
#: gdk/gdkdisplay.c:1244 gdk/gdksurface.c:1252
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "Prise en charge de Vulkan désactivée via GDK_DEBUG"
#: gdk/gdkdisplay.c:1277
#: gdk/gdkdisplay.c:1276
msgid "GL support disabled via GDK_DEBUG"
msgstr "Prise en charge de GL désactivée via GDK_DEBUG"
#: gdk/gdkdisplay.c:1575
#: gdk/gdkdisplay.c:1574
msgid "No EGL configuration available"
msgstr "Aucune configuration EGL disponible"
#: gdk/gdkdisplay.c:1583
#: gdk/gdkdisplay.c:1582
msgid "Failed to get EGL configurations"
msgstr "Impossible dobtenir les configurations EGL"
#: gdk/gdkdisplay.c:1613
#: gdk/gdkdisplay.c:1612
msgid "No EGL configuration with required features found"
msgstr ""
"Aucune configuration EGL avec les fonctionnalités requises na été trouvée"
#: gdk/gdkdisplay.c:1620
#: gdk/gdkdisplay.c:1619
msgid "No perfect EGL configuration found"
msgstr "Aucune configuration EGL idéale trouvée"
#: gdk/gdkdisplay.c:1662
#: gdk/gdkdisplay.c:1661
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
msgstr[0] "Lextension %s manque dans limplémentation EGL"
msgstr[1] "%2$d extensions manquent dans limplémentation EGL : %1$s"
#: gdk/gdkdisplay.c:1695
#: gdk/gdkdisplay.c:1694
msgid "libEGL not available in this sandbox"
msgstr "libEGL nest pas disponible dans ce bac à sable"
#: gdk/gdkdisplay.c:1696
#: gdk/gdkdisplay.c:1695
msgid "libEGL not available"
msgstr "libEGL non disponible"
#: gdk/gdkdisplay.c:1706
#: gdk/gdkdisplay.c:1705
msgid "Failed to create EGL display"
msgstr "Impossible de créer laffichage EGL"
#: gdk/gdkdisplay.c:1716
#: gdk/gdkdisplay.c:1715
msgid "Could not initialize EGL display"
msgstr "Impossible dinitialiser laffichage EGL"
#: gdk/gdkdisplay.c:1727
#: gdk/gdkdisplay.c:1726
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "La version %d.%d dEGL est trop ancienne. GTK requiert %d.%d"
@@ -127,33 +127,33 @@ msgstr ""
msgid "No compatible formats to transfer contents."
msgstr "Aucun format compatible pour le transfert du contenu."
#: gdk/gdkglcontext.c:401 gdk/x11/gdkglcontext-glx.c:642
#: gdk/gdkglcontext.c:402 gdk/x11/gdkglcontext-glx.c:642
msgid "No GL API allowed."
msgstr "Aucune API GL autorisée."
#: gdk/gdkglcontext.c:425 gdk/win32/gdkglcontext-win32-wgl.c:387
#: gdk/gdkglcontext.c:426 gdk/win32/gdkglcontext-win32-wgl.c:387
#: gdk/win32/gdkglcontext-win32-wgl.c:530
#: gdk/win32/gdkglcontext-win32-wgl.c:574 gdk/x11/gdkglcontext-glx.c:691
msgid "Unable to create a GL context"
msgstr "Impossible de créer un contexte GL"
#: gdk/gdkglcontext.c:1280
#: gdk/gdkglcontext.c:1281
msgid "Anything but OpenGL ES disabled via GDK_DEBUG"
msgstr "Tout sauf OpenGL ES est désactivé via GTK_DEBUG"
#: gdk/gdkglcontext.c:1289
#: gdk/gdkglcontext.c:1290
#, c-format
msgid "Application does not support %s API"
msgstr "Lapplication ne prend pas en charge lAPI %s"
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:1864
#: gdk/gdkglcontext.c:1899
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "Tentative dutilisation de %s, mais %s est déjà utilisé"
#: gdk/gdktexture.c:528
#: gdk/gdktexture.c:530
msgid "Unknown image format."
msgstr "Format dimage inconnu."
@@ -752,8 +752,7 @@ msgstr "Aucune implémentation GL disponible"
#: gdk/win32/gdkglcontext-win32-wgl.c:396
#, c-format
msgid "WGL version %d.%d is too low, need at least %d.%d"
msgstr ""
"La version %d.%d dEGL est trop basse, elle doit être au moins à %d.%d"
msgstr "La version %d.%d dEGL est trop basse, elle doit être au moins à %d.%d"
#: gdk/win32/gdkglcontext-win32-wgl.c:414
#, c-format
@@ -1084,18 +1083,18 @@ msgctxt "progress bar label"
msgid "%d%%"
msgstr "%d %%"
#: gtk/deprecated/gtkcolorbutton.c:183 gtk/deprecated/gtkcolorbutton.c:311
#: gtk/deprecated/gtkcolorbutton.c:183 gtk/deprecated/gtkcolorbutton.c:314
#: gtk/gtkcolordialog.c:411
msgid "Pick a Color"
msgstr "Choisissez une couleur"
#: gtk/deprecated/gtkcolorbutton.c:502 gtk/gtkcolorchooserwidget.c:313
#: gtk/deprecated/gtkcolorbutton.c:505 gtk/gtkcolorchooserwidget.c:313
#: gtk/gtkcolordialogbutton.c:335
#, c-format
msgid "Red %d%%, Green %d%%, Blue %d%%, Alpha %d%%"
msgstr "Rouge %d%%, Vert %d%%, Bleu %d%%, Alpha %d%%"
#: gtk/deprecated/gtkcolorbutton.c:508 gtk/gtkcolorchooserwidget.c:319
#: gtk/deprecated/gtkcolorbutton.c:511 gtk/gtkcolorchooserwidget.c:319
#: gtk/gtkcolordialogbutton.c:341
#, c-format
msgid "Red %d%%, Green %d%%, Blue %d%%"
@@ -1105,17 +1104,17 @@ msgstr "Rouge %d%%, Vert %d%%, Bleu %d%%"
msgid "Sans 12"
msgstr "Sans 12"
#: gtk/deprecated/gtkfontbutton.c:507 gtk/deprecated/gtkfontbutton.c:621
#: gtk/deprecated/gtkfontbutton.c:507 gtk/deprecated/gtkfontbutton.c:624
#: gtk/gtkfontdialog.c:596
msgid "Pick a Font"
msgstr "Choisissez une police"
#: gtk/deprecated/gtkfontbutton.c:597 gtk/gtkfilechooserwidget.c:3871
#: gtk/deprecated/gtkfontbutton.c:600 gtk/gtkfilechooserwidget.c:3871
#: gtk/gtkfontdialogbutton.c:126 gtk/inspector/visual.ui:169
msgid "Font"
msgstr "Police"
#: gtk/deprecated/gtkfontbutton.c:1152 gtk/gtkfontdialogbutton.c:652
#: gtk/deprecated/gtkfontbutton.c:1155 gtk/gtkfontdialogbutton.c:652
msgctxt "font"
msgid "None"
msgstr "Aucune"
@@ -2179,7 +2178,7 @@ msgstr "_Droite :"
msgid "Paper Margins"
msgstr "Marges du papier"
#: gtk/gtkentry.c:3673
#: gtk/gtkentry.c:3685
msgid "Insert Emoji"
msgstr "Insérer un émoji"
@@ -2249,7 +2248,7 @@ msgstr "Un fichier avec ce nom existe déjà"
#: gtk/gtkmessagedialog.c:179 gtk/gtkmountoperation.c:608
#: gtk/print/gtkpagesetupunixdialog.c:282 gtk/print/gtkprintbackend.c:638
#: gtk/print/gtkprintunixdialog.c:682 gtk/print/gtkprintunixdialog.c:839
#: gtk/gtkwindow.c:6242 gtk/ui/gtkappchooserdialog.ui:48
#: gtk/gtkwindow.c:6233 gtk/ui/gtkappchooserdialog.ui:48
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:36
#: gtk/ui/gtkfontchooserdialog.ui:27
msgid "_Cancel"
@@ -2339,7 +2338,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "Si vous supprimez un élément, il sera définitivement perdu."
#: gtk/gtkfilechooserwidget.c:1185 gtk/gtkfilechooserwidget.c:1815
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6145 gtk/gtktextview.c:9018
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
msgid "_Delete"
msgstr "_Supprimer"
@@ -2465,6 +2464,7 @@ msgid "Yesterday"
msgstr "Hier"
#: gtk/gtkfilechooserwidget.c:3823
#, c-format
msgid "%-e %b"
msgstr "%-e %b"
@@ -2677,19 +2677,19 @@ msgstr "Fermer"
msgid "Close the infobar"
msgstr "Fermer la barre dinformation"
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6133 gtk/gtktextview.c:9006
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
msgid "Cu_t"
msgstr "Co_uper"
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6137 gtk/gtktextview.c:9010
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
msgid "_Copy"
msgstr "_Copier"
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6141 gtk/gtktextview.c:9014
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
msgid "_Paste"
msgstr "C_oller"
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6154 gtk/gtktextview.c:9039
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
msgid "Select _All"
msgstr "_Tout sélectionner"
@@ -2772,7 +2772,7 @@ msgid "Play"
msgstr "Lecture"
#: gtk/gtkmessagedialog.c:162 gtk/gtkmessagedialog.c:180
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6243
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6234
msgid "_OK"
msgstr "_Valider"
@@ -3377,8 +3377,8 @@ msgstr ""
#. window
#: gtk/print/gtkprintoperation-portal.c:264
#: gtk/print/gtkprintoperation-portal.c:584
#: gtk/print/gtkprintoperation-portal.c:653 gtk/print/gtkprintunixdialog.c:3008
#: gtk/print/gtkprintoperation-portal.c:594
#: gtk/print/gtkprintoperation-portal.c:663 gtk/print/gtkprintunixdialog.c:3008
msgid "Print"
msgstr "Imprimer"
@@ -3553,7 +3553,7 @@ msgstr ""
"Impossible de trouver une application enregistrée sous le nom « %s » pour "
"l’élément dont lURI est « %s »"
#: gtk/gtksearchentry.c:758
#: gtk/gtksearchentry.c:767
msgid "Clear Entry"
msgstr "Efface la saisie"
@@ -3644,7 +3644,7 @@ msgctxt "accessibility"
msgid "Sidebar"
msgstr "Panneau latéral"
#: gtk/gtktext.c:6159 gtk/gtktextview.c:9044
#: gtk/gtktext.c:6161 gtk/gtktextview.c:9044
msgid "Insert _Emoji"
msgstr "Insérer un _émoji"
@@ -3656,12 +3656,12 @@ msgstr "Ann_uler"
msgid "_Redo"
msgstr "_Rétablir"
#: gtk/gtkwindow.c:6231
#: gtk/gtkwindow.c:6222
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "Voulez-vous utiliser lInspecteur GTK ?"
#: gtk/gtkwindow.c:6233
#: gtk/gtkwindow.c:6224
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify "
@@ -3672,7 +3672,7 @@ msgstr ""
"modifier les éléments internes de toute application GTK. Son utilisation "
"peut causer une interruption ou un plantage de lapplication."
#: gtk/gtkwindow.c:6238
#: gtk/gtkwindow.c:6229
msgid "Dont show this message again"
msgstr "Ne plus afficher ce message"
@@ -4024,8 +4024,8 @@ msgid "Surface"
msgstr "Surface"
#: gtk/inspector/misc-info.ui:365 gtk/inspector/misc-info.ui:400
#: gtk/inspector/misc-info.ui:435 gtk/inspector/prop-editor.c:1150
#: gtk/inspector/prop-editor.c:1533 gtk/inspector/window.ui:396
#: gtk/inspector/misc-info.ui:435 gtk/inspector/prop-editor.c:1153
#: gtk/inspector/prop-editor.c:1536 gtk/inspector/window.ui:396
msgid "Properties"
msgstr "Propriétés"
@@ -4077,7 +4077,7 @@ msgstr "Pointeur : %p"
#. Translators: %s is a type name, for example
#. * GtkPropertyExpression with value \"2.5\"
#.
#: gtk/inspector/prop-editor.c:824
#: gtk/inspector/prop-editor.c:827
#, c-format
msgid "%s with value \"%s\""
msgstr "%s avec valeur « %s »"
@@ -4085,7 +4085,7 @@ msgstr "%s avec valeur « %s »"
#. Translators: Both %s are type names, for example
#. * GtkPropertyExpression with type GObject
#.
#: gtk/inspector/prop-editor.c:835
#: gtk/inspector/prop-editor.c:838
#, c-format
msgid "%s with type %s"
msgstr "%s de type %s"
@@ -4093,7 +4093,7 @@ msgstr "%s de type %s"
#. Translators: Both %s are type names, for example
#. * GtkObjectExpression for GtkStringObject 0x23456789
#.
#: gtk/inspector/prop-editor.c:848
#: gtk/inspector/prop-editor.c:851
#, c-format
msgid "%s for %s %p"
msgstr "%s pour %s %p"
@@ -4101,71 +4101,71 @@ msgstr "%s pour %s %p"
#. Translators: Both %s are type names, for example
#. * GtkPropertyExpression with value type: gchararray
#.
#: gtk/inspector/prop-editor.c:878
#: gtk/inspector/prop-editor.c:881
#, c-format
msgid "%s with value type %s"
msgstr "%s avec type de valeur %s"
#: gtk/inspector/prop-editor.c:1227
#: gtk/inspector/prop-editor.c:1230
#, c-format
msgid "Uneditable property type: %s"
msgstr "Type de propriété non éditable : %s"
#: gtk/inspector/prop-editor.c:1385
#: gtk/inspector/prop-editor.c:1388
msgctxt "column number"
msgid "None"
msgstr "Aucun"
#: gtk/inspector/prop-editor.c:1422
#: gtk/inspector/prop-editor.c:1425
msgid "Attribute:"
msgstr "Attribut :"
#: gtk/inspector/prop-editor.c:1425
#: gtk/inspector/prop-editor.c:1428
msgid "Model"
msgstr "Modèle"
#: gtk/inspector/prop-editor.c:1430
#: gtk/inspector/prop-editor.c:1433
msgid "Column:"
msgstr "Colonne :"
#. Translators: %s is a type name, for example
#. * Action from 0x2345678 (GtkApplicationWindow)
#.
#: gtk/inspector/prop-editor.c:1529
#: gtk/inspector/prop-editor.c:1532
#, c-format
msgid "Action from: %p (%s)"
msgstr "Action de : %p (%s)"
#: gtk/inspector/prop-editor.c:1584
#: gtk/inspector/prop-editor.c:1587
msgid "Reset"
msgstr "Réinitialiser"
#: gtk/inspector/prop-editor.c:1592
#: gtk/inspector/prop-editor.c:1595
msgctxt "GtkSettings source"
msgid "Default"
msgstr "Par défaut"
#: gtk/inspector/prop-editor.c:1595
#: gtk/inspector/prop-editor.c:1598
msgctxt "GtkSettings source"
msgid "Theme"
msgstr "Thème"
#: gtk/inspector/prop-editor.c:1598
#: gtk/inspector/prop-editor.c:1601
msgctxt "GtkSettings source"
msgid "XSettings"
msgstr "Paramètres X"
#: gtk/inspector/prop-editor.c:1602
#: gtk/inspector/prop-editor.c:1605
msgctxt "GtkSettings source"
msgid "Application"
msgstr "Application"
#: gtk/inspector/prop-editor.c:1605
#: gtk/inspector/prop-editor.c:1608
msgctxt "GtkSettings source"
msgid "Unknown"
msgstr "Inconnue"
#: gtk/inspector/prop-editor.c:1608
#: gtk/inspector/prop-editor.c:1611
msgid "Source:"
msgstr "Source :"
@@ -7228,7 +7228,7 @@ msgstr ""
#: tools/gtk-builder-tool-enumerate.c:56 tools/gtk-builder-tool-preview.c:179
#: tools/gtk-builder-tool-preview.c:180 tools/gtk-builder-tool-screenshot.c:360
#: tools/gtk-builder-tool-simplify.c:2529 tools/gtk-builder-tool-validate.c:261
#: tools/gtk-rendernode-tool-info.c:200 tools/gtk-rendernode-tool-show.c:102
#: tools/gtk-rendernode-tool-info.c:202 tools/gtk-rendernode-tool-show.c:106
msgid "FILE"
msgstr "FICHIER"
@@ -7260,7 +7260,7 @@ msgid "Use style from CSS file"
msgstr "Utiliser le style dun fichier CSS"
#: tools/gtk-builder-tool-preview.c:187 tools/gtk-builder-tool-screenshot.c:370
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-show.c:109
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-show.c:113
#: tools/gtk-rendernode-tool-render.c:204
#, c-format
msgid "Could not initialize windowing system\n"
@@ -7515,47 +7515,50 @@ msgstr ""
" render Prendre une capture d’écran du nœud\n"
"\n"
#: tools/gtk-rendernode-tool-info.c:177
#: tools/gtk-rendernode-tool-info.c:179
#, c-format
msgid "Number of nodes: %u\n"
msgstr "Nombre de nœuds : %u\n"
#: tools/gtk-rendernode-tool-info.c:184
#: tools/gtk-rendernode-tool-info.c:186
#, c-format
msgid "Depth: %u\n"
msgstr "Profondeur : %u\n"
#: tools/gtk-rendernode-tool-info.c:187
#: tools/gtk-rendernode-tool-info.c:189
#, c-format
msgid "Bounds: %g x %g\n"
msgstr "Limites : %g × %g\n"
#: tools/gtk-rendernode-tool-info.c:188
#: tools/gtk-rendernode-tool-info.c:190
#, c-format
msgid "Origin: %g %g\n"
msgstr "Origine : %g %g\n"
#: tools/gtk-rendernode-tool-info.c:209
#: tools/gtk-rendernode-tool-info.c:211
msgid "Provide information about the render node."
msgstr "Fournir des informations sur le nœud de rendu."
#: tools/gtk-rendernode-tool-info.c:222 tools/gtk-rendernode-tool-show.c:130
#: tools/gtk-rendernode-tool-info.c:224 tools/gtk-rendernode-tool-show.c:134
#: tools/gtk-rendernode-tool-render.c:225
#, c-format
msgid "No .node file specified\n"
msgstr "Aucun fichier .node indiqué\n"
#: tools/gtk-rendernode-tool-info.c:228
#: tools/gtk-rendernode-tool-info.c:230
#, c-format
msgid "Can only accept a single .node file\n"
msgstr ""
"Naccepte quun unique fichier .node\n"
msgstr "Naccepte quun unique fichier .node\n"
#: tools/gtk-rendernode-tool-show.c:117
#: tools/gtk-rendernode-tool-show.c:105
msgid "Don't add a titlebar"
msgstr "Ne pas ajouter de barre de titre"
#: tools/gtk-rendernode-tool-show.c:121
msgid "Show the render node."
msgstr "Afficher le nœud de rendu."
#: tools/gtk-rendernode-tool-show.c:136
#: tools/gtk-rendernode-tool-show.c:140
#, c-format
msgid "Can only preview a single .node file\n"
msgstr "Ne peut afficher laperçu que dun unique fichier .node\n"
@@ -7590,14 +7593,19 @@ msgstr "Réaliser le rendu du fichier .node vers une image."
#, c-format
msgid "Can only render a single .node file to a single output file\n"
msgstr ""
"Ne peut effectuer le rendu que dun unique fichier .node vers un seul fichier "
"de sortie\n"
"Ne peut effectuer le rendu que dun unique fichier .node vers un seul "
"fichier de sortie\n"
#: tools/gtk-rendernode-tool-utils.c:51
#, c-format
msgid "Error at %s: %s\n"
msgstr "Erreur à %s : %s\n"
#: tools/gtk-rendernode-tool-utils.c:69
#, c-format
msgid "Failed to load node file: %s\n"
msgstr "Impossible de charger le fichier de nœud : %s\n"
#: tools/updateiconcache.c:1391
#, c-format
msgid "Failed to write header\n"
+508 -389
View File
File diff suppressed because it is too large Load Diff
+96 -69
View File
@@ -6,23 +6,23 @@
# Gil Osher <dolfin@rpg.org.il>, 2004.
# Yair Hershkovitz <yairhr@gmail.com>, 2006.
# Yaron Shahrabani <sh.yaron@gmail.com>, 2011, 2012.
# Yosef Or Boczko <yoseforb@gmail.com>, 2013-2023.
# Yosef Or Boczko <yoseforb@gmail.com>, 2013-2024.
#
msgid ""
msgstr ""
"Project-Id-Version: gtk+.HEAD.he\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2023-12-27 22:15+0000\n"
"PO-Revision-Date: 2023-12-28 13:40+0200\n"
"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
"Language-Team: Hebrew <yoseforb@gmail.com>\n"
"POT-Creation-Date: 2024-01-22 13:47+0000\n"
"PO-Revision-Date: 2024-01-25 13:34+0200\n"
"Last-Translator: Yosef Or Boczko <yoseforb@gmail.com>\n"
"Language-Team: Hebrew\n"
"Language: he\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n==2 ? 1 : n>10 && n%10==0 ? "
"2 : 3);\n"
"X-Generator: Poedit 3.4.1\n"
"2 : 3)\n"
"X-Generator: Gtranslator 45.3\n"
"X-Project-Style: default\n"
#: gdk/broadway/gdkbroadway-server.c:135
@@ -34,11 +34,11 @@ msgstr "סוג תצוגת ה־broadway אינה נתמכת: %s"
msgid "This clipboard cannot store data."
msgstr "לוח גזירים זה לא יכול לאחסן נתונים."
#: gdk/gdkclipboard.c:287 gdk/gdkclipboard.c:785 gdk/gdkclipboard.c:1085
#: gdk/gdkclipboard.c:287 gdk/gdkclipboard.c:786 gdk/gdkclipboard.c:1086
msgid "Cannot read from empty clipboard."
msgstr "אי אפשר לקרוא מלוח גזירים ריק."
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1135 gdk/gdkdrag.c:618
#: gdk/gdkclipboard.c:318 gdk/gdkclipboard.c:1136 gdk/gdkdrag.c:618
msgid "No compatible formats to transfer clipboard contents."
msgstr "אין תצורות תואמות להעברת תכני לוח גזירים."
@@ -57,31 +57,31 @@ msgstr "לא ניתן לספק תוכן בתור %s"
msgid "The current backend does not support OpenGL"
msgstr "המנשק הנוכחי אינו תומך ב־‏OpenGL"
#: gdk/gdkdisplay.c:1278 gdk/gdksurface.c:1268 gdk/gdkvulkancontext.c:1479
#: gdk/gdkdisplay.c:1296 gdk/gdkvulkancontext.c:1581
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "התמיכה ב־Vulkan מושבתת דרך GDK_DEBUG"
#: gdk/gdkdisplay.c:1310
#: gdk/gdkdisplay.c:1350
msgid "GL support disabled via GDK_DEBUG"
msgstr "התמיכה ב־GL הושבתה דרך GDK_DEBUG"
#: gdk/gdkdisplay.c:1606
#: gdk/gdkdisplay.c:1646
msgid "No EGL configuration available"
msgstr "אין תצורת EGL זמינה"
#: gdk/gdkdisplay.c:1614
#: gdk/gdkdisplay.c:1654
msgid "Failed to get EGL configurations"
msgstr "קבלת תצורות EGL נכשלה"
#: gdk/gdkdisplay.c:1644
#: gdk/gdkdisplay.c:1684
msgid "No EGL configuration with required features found"
msgstr "לא נמצאה תצורת EGL עם היכולות הנדרשות"
#: gdk/gdkdisplay.c:1651
#: gdk/gdkdisplay.c:1691
msgid "No perfect EGL configuration found"
msgstr "לא נמצאה תצורת EGL מושלמת"
#: gdk/gdkdisplay.c:1693
#: gdk/gdkdisplay.c:1733
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
@@ -90,23 +90,23 @@ msgstr[1] "למימוש ה־EGL חסרות שתי הרחבות: %1$s"
msgstr[2] "למימוש ה־EGL חסרות %2$d הרחבות: %1$s"
msgstr[3] "למימוש ה־EGL חסרות %2$d הרחבות: %1$s"
#: gdk/gdkdisplay.c:1743
#: gdk/gdkdisplay.c:1782
msgid "libEGL not available in this sandbox"
msgstr "libEGL אינו זמין בארגז חול זה"
#: gdk/gdkdisplay.c:1744
#: gdk/gdkdisplay.c:1783
msgid "libEGL not available"
msgstr "libEGL לא זמין"
#: gdk/gdkdisplay.c:1754
#: gdk/gdkdisplay.c:1793
msgid "Failed to create EGL display"
msgstr "יצירת תצוגת EGL נכשלה"
#: gdk/gdkdisplay.c:1764
#: gdk/gdkdisplay.c:1802
msgid "Could not initialize EGL display"
msgstr "לא ניתן להפעיל תצוגת EGL"
#: gdk/gdkdisplay.c:1775
#: gdk/gdkdisplay.c:1812
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "גרסת ה־EGL %d.%d ישנה מדי. GTK דורש %d.%d"
@@ -144,7 +144,7 @@ msgstr "היישום אינו תומך ב־API ‏%s"
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:2123
#: gdk/gdkglcontext.c:2115
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "מתבצע ניסיון להשתמש ב־%s אך %s כבר בשימוש"
@@ -542,7 +542,7 @@ msgstr "שגיאה בפענוח קובץ תמונת JPEG‏ (%s)"
msgid "Unsupported JPEG colorspace (%d)"
msgstr "מרחב הצבעים של ה־JPEG אינו נתמך (%d)"
#: gdk/loaders/gdkjpeg.c:203 gdk/loaders/gdkpng.c:280 gdk/loaders/gdktiff.c:472
#: gdk/loaders/gdkjpeg.c:203 gdk/loaders/gdkpng.c:286 gdk/loaders/gdktiff.c:472
#, c-format
msgid "Not enough memory for image size %ux%u"
msgstr "אין מספיק זיכרון לתמונה בגודל ‎%u×%u‎"
@@ -552,16 +552,22 @@ msgstr "אין מספיק זיכרון לתמונה בגודל ‎%u×%u‎"
msgid "Error reading png (%s)"
msgstr "שגיאה בקריאת png (%s)"
#: gdk/loaders/gdkpng.c:211
#: gdk/loaders/gdkpng.c:212
#, c-format
msgid "Unsupported depth %u in png image"
msgstr "העומק %u אינו נתמך בתמונות png"
#: gdk/loaders/gdkpng.c:261
#: gdk/loaders/gdkpng.c:262
#, c-format
msgid "Unsupported color type %u in png image"
msgstr "סוג הצבע %u אינו נתמך בתמונות png"
#: gdk/loaders/gdkpng.c:272
#, fuzzy, c-format
#| msgid "Not enough memory for image size %ux%u"
msgid "Image stride too large for image size %ux%u"
msgstr "אין מספיק זיכרון לתמונה בגודל ‎%u×%u‎"
#: gdk/loaders/gdktiff.c:358
msgid "Failed to load RGB data from TIFF file"
msgstr "טעינת נתוני RGB מקובץ TIFF נכשלה"
@@ -826,11 +832,16 @@ msgstr "תצורות שגויות בהמרת טקסט מרוכב."
msgid "Unsupported encoding “%s”"
msgstr "הקידוד „%s” אינו נתמך"
#: gsk/gl/gskglrenderer.c:210
#: gsk/gl/gskglrenderer.c:204
#, c-format
msgid "This GLES %d.%d implementation does not support half-float vertex data"
msgstr "מימוש זה של GLES %d.%d לא תומך בנתוני קודקודים עם נקודה חצי צפה"
#: gsk/gpu/gskgldevice.c:238
#, c-format
msgid "OpenGL ES 2.0 is not supported by this renderer."
msgstr ""
#: gtk/a11y/gtkatspiaction.c:239
msgctxt "accessibility"
msgid "Click"
@@ -1028,7 +1039,7 @@ msgid "Invalid"
msgstr "בלתי תקני"
#. This label is displayed in a treeview cell displaying an accelerator
#. * when the cell is clicked to change the acelerator.
#. * when the cell is clicked to change the accelerator.
#.
#: gtk/deprecated/gtkcellrendereraccel.c:436
#: gtk/deprecated/gtkcellrendereraccel.c:729
@@ -2374,7 +2385,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "אם פריט ימחק, הוא יאבד לצמיתות."
#: gtk/gtkfilechooserwidget.c:1183 gtk/gtkfilechooserwidget.c:1781
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
msgid "_Delete"
msgstr "מ_חיקה"
@@ -2703,7 +2714,7 @@ msgstr "מאפייני סגנון"
msgid "Character Variations"
msgstr "הגווני תו"
#: gtk/gtkglarea.c:305
#: gtk/gtkglarea.c:309
msgid "OpenGL context creation failed"
msgstr "יצירת הקשר OpenGL נכשלה"
@@ -2716,32 +2727,32 @@ msgstr "סגירה"
msgid "Close the infobar"
msgstr "סגירת פס המידע"
#: gtk/gtklabel.c:5692 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
#: gtk/gtklabel.c:5699 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
msgid "Cu_t"
msgstr "_גזירה"
#: gtk/gtklabel.c:5693 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
msgid "_Copy"
msgstr "ה_עתקה"
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
msgid "_Paste"
msgstr "ה_דבקה"
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
#: gtk/gtklabel.c:5707 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
msgid "Select _All"
msgstr "בחירה בה_כול"
#: gtk/gtklabel.c:5705
#: gtk/gtklabel.c:5712
msgid "_Open Link"
msgstr "_פתיחת קישור"
#: gtk/gtklabel.c:5709
#: gtk/gtklabel.c:5716
msgid "Copy _Link Address"
msgstr "העתקת כתובת ה_קישור"
# msgctxt "OpenType layout"
#: gtk/gtklabel.c:5753 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
#: gtk/gtklabel.c:5760 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
msgid "Context menu"
msgstr "תפריט הקשר"
@@ -3651,7 +3662,7 @@ msgstr "החלקה ימינה"
#. Translators: This is placeholder text for the search entry in the shortcuts window
#: gtk/gtkshortcutswindow.c:879 gtk/gtkshortcutswindow.c:946
#: gtk/gtkshortcutswindow.c:951
#: gtk/gtkshortcutswindow.c:952
msgid "Search Shortcuts"
msgstr "חיפוש קיצורי מקשים"
@@ -3665,12 +3676,12 @@ msgstr "צירופי מקשים"
msgid "Search Results"
msgstr "תוצאות חיפוש"
#: gtk/gtkshortcutswindow.c:1013 gtk/ui/gtkemojichooser.ui:349
#: gtk/gtkshortcutswindow.c:1014 gtk/ui/gtkemojichooser.ui:349
#: gtk/ui/gtkfilechooserwidget.ui:239
msgid "No Results Found"
msgstr "לא נמצאו תוצאות"
#: gtk/gtkshortcutswindow.c:1024 gtk/ui/gtkemojichooser.ui:362
#: gtk/gtkshortcutswindow.c:1025 gtk/ui/gtkemojichooser.ui:362
#: gtk/ui/gtkfilechooserwidget.ui:252 gtk/ui/gtkplacesview.ui:218
msgid "Try a different search"
msgstr "יש לנסות חיפוש שונה"
@@ -3884,37 +3895,37 @@ msgstr "מחלקות סגנון"
msgid "CSS Property"
msgstr "מאפיין CSS"
#: gtk/inspector/general.c:349
#: gtk/inspector/general.c:363
msgctxt "GL version"
msgid "None"
msgstr "ללא"
#: gtk/inspector/general.c:426
#: gtk/inspector/general.c:441
msgctxt "GL version"
msgid "Unknown"
msgstr "לא ידוע"
#: gtk/inspector/general.c:491
#: gtk/inspector/general.c:503
msgctxt "Vulkan device"
msgid "Disabled"
msgstr "מושבת"
#: gtk/inspector/general.c:492 gtk/inspector/general.c:493
#: gtk/inspector/general.c:504 gtk/inspector/general.c:505
msgctxt "Vulkan version"
msgid "Disabled"
msgstr "מושבת"
#: gtk/inspector/general.c:549
#: gtk/inspector/general.c:555
msgctxt "Vulkan device"
msgid "None"
msgstr "ללא"
#: gtk/inspector/general.c:550 gtk/inspector/general.c:551
#: gtk/inspector/general.c:556 gtk/inspector/general.c:557
msgctxt "Vulkan version"
msgid "None"
msgstr "ללא"
#: gtk/inspector/general.c:882
#: gtk/inspector/general.c:895
msgid "IM Context is hardcoded by GTK_IM_MODULE"
msgstr "IM Context קשיחה בקוד על ידי GTK_IM_MODULE"
@@ -3966,43 +3977,51 @@ msgstr "RGBA חזותי"
msgid "Composited"
msgstr "מורכב"
#: gtk/inspector/general.ui:559
#: gtk/inspector/general.ui:538
msgid "Protocols"
msgstr "פרוטוקולים"
#: gtk/inspector/general.ui:594
msgid "GL Version"
msgstr "גרסת GL"
#: gtk/inspector/general.ui:586
#: gtk/inspector/general.ui:621
msgid "GL Backend Version"
msgstr "גרסת מנגנון GL"
#: gtk/inspector/general.ui:636
#: gtk/inspector/general.ui:671
msgid "GL Backend Vendor"
msgstr "ספק מנגנון GL"
#: gtk/inspector/general.ui:663
#: gtk/inspector/general.ui:698
msgid "GL_VENDOR"
msgstr "GL_VENDOR"
#: gtk/inspector/general.ui:692
#: gtk/inspector/general.ui:727
msgid "GL_RENDERER"
msgstr "GL_RENDERER"
#: gtk/inspector/general.ui:721
#: gtk/inspector/general.ui:756
msgid "GL_VERSION"
msgstr "GL_VERSION"
#: gtk/inspector/general.ui:750
#: gtk/inspector/general.ui:785
msgid "GL_SHADING_LANGUAGE_VERSION"
msgstr "GL_SHADING_LANGUAGE_VERSION"
#: gtk/inspector/general.ui:789
#: gtk/inspector/general.ui:813 gtk/inspector/general.ui:929
msgid "Extensions"
msgstr "הרחבות"
#: gtk/inspector/general.ui:849
msgid "Vulkan Device"
msgstr "התקן Vulkan"
#: gtk/inspector/general.ui:816
#: gtk/inspector/general.ui:876
msgid "Vulkan API version"
msgstr "גרסת API של Vulkan"
#: gtk/inspector/general.ui:843
#: gtk/inspector/general.ui:903
msgid "Vulkan driver version"
msgstr "גרסת מנהל התקן של Vulkan"
@@ -7310,7 +7329,7 @@ msgid "Use style from CSS file"
msgstr "להשתמש בסגנון מקובץ CSS"
#: tools/gtk-builder-tool-preview.c:187 tools/gtk-builder-tool-screenshot.c:370
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-render.c:204
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-render.c:203
#: tools/gtk-rendernode-tool-show.c:113
#, c-format
msgid "Could not initialize windowing system\n"
@@ -7356,13 +7375,13 @@ msgstr ""
"Use --force to overwrite.\n"
#: tools/gtk-builder-tool-screenshot.c:332
#: tools/gtk-rendernode-tool-render.c:172
#: tools/gtk-rendernode-tool-render.c:171
#, c-format
msgid "Output written to %s.\n"
msgstr "Output written to %s.\n"
#: tools/gtk-builder-tool-screenshot.c:336
#: tools/gtk-rendernode-tool-render.c:176
#: tools/gtk-rendernode-tool-render.c:175
#, c-format
msgid "Failed to save %s: %s\n"
msgstr "Failed to save %s: %s\n"
@@ -7380,7 +7399,7 @@ msgid "Overwrite existing file"
msgstr "שכתוב קובץ קיים"
#: tools/gtk-builder-tool-screenshot.c:363
#: tools/gtk-rendernode-tool-render.c:197
#: tools/gtk-rendernode-tool-render.c:196
msgid "FILE…"
msgstr "FILE…"
@@ -7857,6 +7876,7 @@ msgid ""
"Perform various tasks on GTK render nodes.\n"
"\n"
"Commands:\n"
" benchmark Benchmark rendering of a node\n"
" info Provide information about the node\n"
" show Show the node\n"
" render Take a screenshot of the node\n"
@@ -7868,6 +7888,7 @@ msgstr ""
"Perform various tasks on GTK render nodes.\n"
"\n"
"Commands:\n"
" benchmark Benchmark rendering of a node\n"
" info Provide information about the node\n"
" show Show the node\n"
" render Take a screenshot of the node\n"
@@ -7897,7 +7918,7 @@ msgstr "מקור: %g %g\n"
msgid "Provide information about the render node."
msgstr "אספקת מידע על נקודת העיבוד החזותי."
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:225
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:224
#: tools/gtk-rendernode-tool-show.c:134
#, c-format
msgid "No .node file specified\n"
@@ -7922,19 +7943,25 @@ msgstr ""
msgid "Failed to generate SVG: %s\n"
msgstr "יצירת SVG נכשלה: %s\n"
#: tools/gtk-rendernode-tool-render.c:196
#: tools/gtk-rendernode-tool-render.c:150
#, fuzzy, c-format
#| msgid "Failed to rewrite header\n"
msgid "Failed to create renderer: %s\n"
msgstr "Failed to rewrite header\n"
#: tools/gtk-rendernode-tool-render.c:195
msgid "Renderer to use"
msgstr "עיבוד לשימוש"
#: tools/gtk-rendernode-tool-render.c:196
#: tools/gtk-rendernode-tool-render.c:195
msgid "RENDERER"
msgstr "מעבד תצוגה"
#: tools/gtk-rendernode-tool-render.c:212
#: tools/gtk-rendernode-tool-render.c:211
msgid "Render a .node file to an image."
msgstr "עיבוד קובץ .node לתמונה."
#: tools/gtk-rendernode-tool-render.c:231
#: tools/gtk-rendernode-tool-render.c:230
#, c-format
msgid "Can only render a single .node file to a single output file\n"
msgstr "יכול לעבד קובץ ,node יחיד בלבד לקובץ פלט יחיד\n"
@@ -7952,12 +7979,12 @@ msgstr "הצגת צומת מעבד התצוגה."
msgid "Can only preview a single .node file\n"
msgstr "יכול להציג תצוגה מקדימה של קובץ ‎.node יחיד בלבד\n"
#: tools/gtk-rendernode-tool-utils.c:51
#: tools/gtk-rendernode-tool-utils.c:54
#, c-format
msgid "Error at %s: %s\n"
msgstr "שגיאה ב־%s: %s\n"
#: tools/gtk-rendernode-tool-utils.c:69
#: tools/gtk-rendernode-tool-utils.c:72
#, c-format
msgid "Failed to load node file: %s\n"
msgstr "טעינת קובץ המצב נכשלה: %s\n"
@@ -8128,8 +8155,8 @@ msgstr ""
#~ msgid "Switch to list view"
#~ msgstr "החלפה לתצוגת רשימה"
msgid "default:LTR"
msgstr "default:RTL"
#~ msgid "default:LTR"
#~ msgstr "default:RTL"
#~ msgid "Other application…"
#~ msgstr "יישום אחר…"
+56 -45
View File
@@ -11,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2024-01-07 07:44+0000\n"
"PO-Revision-Date: 2024-01-08 05:11+0100\n"
"POT-Creation-Date: 2024-01-25 11:35+0000\n"
"PO-Revision-Date: 2024-01-27 18:13+0100\n"
"Last-Translator: Ekaterine Papava <papava.e@gtu.ge>\n"
"Language-Team: Georgian <http://mail.gnome.org/mailman/listinfo/gnome-ge-"
"list>\n"
@@ -55,53 +55,53 @@ msgstr "შემცველობის %s-ად გამოტანა შ
msgid "The current backend does not support OpenGL"
msgstr "მიმდინარე უკანაბოლოს OpenGL-ის მხარდაჭერა არ გააჩნია"
#: gdk/gdkdisplay.c:1292 gdk/gdksurface.c:1268 gdk/gdkvulkancontext.c:1581
#: gdk/gdkdisplay.c:1296 gdk/gdkvulkancontext.c:1581
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "Vulkan-ის მხარდაჭერა გამორთულია GDK_DEBUG-ით"
#: gdk/gdkdisplay.c:1335
#: gdk/gdkdisplay.c:1350
msgid "GL support disabled via GDK_DEBUG"
msgstr "GL-ის მხარდაჭერა გათიშულია GDK_DEBUG-ის მიერ"
#: gdk/gdkdisplay.c:1631
#: gdk/gdkdisplay.c:1646
msgid "No EGL configuration available"
msgstr "EGL-ის კონფიგურაცია მიუწვდომელია"
#: gdk/gdkdisplay.c:1639
#: gdk/gdkdisplay.c:1654
msgid "Failed to get EGL configurations"
msgstr "EGL-ის კონფიგურაციის მიღების შეცდოა"
#: gdk/gdkdisplay.c:1669
#: gdk/gdkdisplay.c:1684
msgid "No EGL configuration with required features found"
msgstr "მოთხოვნილი ფუნქციების მქონე EGL-ის კონფიგურაცია ნაპოვნი არაა"
#: gdk/gdkdisplay.c:1676
#: gdk/gdkdisplay.c:1691
msgid "No perfect EGL configuration found"
msgstr "EGL-ის მისაღები კონფიგურაცია ნაპოვნი არაა"
#: gdk/gdkdisplay.c:1718
#: gdk/gdkdisplay.c:1733
#, c-format
msgid "EGL implementation is missing extension %s"
msgid_plural "EGL implementation is missing %2$d extensions: %1$s"
msgstr[0] "EGL-ის განხორციელებას %2$d გაფართოება აკლია: %1$s"
#: gdk/gdkdisplay.c:1768
#: gdk/gdkdisplay.c:1782
msgid "libEGL not available in this sandbox"
msgstr "ამ იზოლირებულ გარემოში libEGL მიუწვდომელია"
#: gdk/gdkdisplay.c:1769
#: gdk/gdkdisplay.c:1783
msgid "libEGL not available"
msgstr "libEGL მიუწვდომელია"
#: gdk/gdkdisplay.c:1779
#: gdk/gdkdisplay.c:1793
msgid "Failed to create EGL display"
msgstr "EGL ეკრანის შექმნის შეცდომა"
#: gdk/gdkdisplay.c:1789
#: gdk/gdkdisplay.c:1802
msgid "Could not initialize EGL display"
msgstr "EGL ეკრანის ინიციალიზაციის შეცდომა"
#: gdk/gdkdisplay.c:1800
#: gdk/gdkdisplay.c:1812
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "EGL-ის ვერსია %d.%d ძალიან ძველია. GTK-ს ესაჭიროება %d.%d"
@@ -139,7 +139,7 @@ msgstr "აპლიკაციას %s-ის API-ის მხარდა
#. translators: This is about OpenGL backend names, like
#. * "Trying to use X11 GLX, but EGL is already in use"
#: gdk/gdkglcontext.c:2124
#: gdk/gdkglcontext.c:2115
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "%s გამოყენების მცდელობა, მაგრამ %s უკვე გამოიყენება"
@@ -852,13 +852,18 @@ msgstr "არასწორი ფორმატები შედგენ
msgid "Unsupported encoding “%s”"
msgstr "კოდირება \"%s\" მხარდაუჭერელია"
#: gsk/gl/gskglrenderer.c:210
#: gsk/gl/gskglrenderer.c:204
#, c-format
msgid "This GLES %d.%d implementation does not support half-float vertex data"
msgstr ""
"GLES %d.%d-ის ამ განხორციელებას ნახევრად-მცურავმძიმიანი წვეროების "
"მონაცემების მხარდაჭერა არ გააჩნია"
#: gsk/gpu/gskgldevice.c:238
#, c-format
msgid "OpenGL ES 2.0 is not supported by this renderer."
msgstr "OpenGL ES 2.0 ამ რენდერერის მიერ მხარდაჭერილი არაა."
#: gtk/a11y/gtkatspiaction.c:239
msgctxt "accessibility"
msgid "Click"
@@ -1056,7 +1061,7 @@ msgid "Invalid"
msgstr "არასწორი"
#. This label is displayed in a treeview cell displaying an accelerator
#. * when the cell is clicked to change the acelerator.
#. * when the cell is clicked to change the accelerator.
#.
#: gtk/deprecated/gtkcellrendereraccel.c:436
#: gtk/deprecated/gtkcellrendereraccel.c:729
@@ -1235,7 +1240,6 @@ msgid "Mozilla Public License 2.0"
msgstr "Mozilla Public License 2.0"
#: gtk/gtkaboutdialog.c:137
#| msgid "BSD 2-Clause License"
msgid "BSD Zero-Clause License"
msgstr "BSD Zero-Clause License"
@@ -2349,7 +2353,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "თუ წაშლით ელემენტს, ის სამუდამოდ დაიკარგება."
#: gtk/gtkfilechooserwidget.c:1183 gtk/gtkfilechooserwidget.c:1781
#: gtk/gtklabel.c:5697 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6147 gtk/gtktextview.c:9018
msgid "_Delete"
msgstr "წაშლა"
@@ -2675,7 +2679,7 @@ msgstr "სტილის ვარიაციები"
msgid "Character Variations"
msgstr "სიმბოლოების ვარიანტები"
#: gtk/gtkglarea.c:305
#: gtk/gtkglarea.c:309
msgid "OpenGL context creation failed"
msgstr "OpenGL-ის კონტექსტის შექმნის შეცდომა"
@@ -2688,31 +2692,31 @@ msgstr "დახურვა"
msgid "Close the infobar"
msgstr "საინფორმაციო ზოლის დახურვა"
#: gtk/gtklabel.c:5694 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
#: gtk/gtklabel.c:5699 gtk/gtktext.c:6135 gtk/gtktextview.c:9006
msgid "Cu_t"
msgstr "ამოჭრა"
#: gtk/gtklabel.c:5695 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
#: gtk/gtklabel.c:5700 gtk/gtktext.c:6139 gtk/gtktextview.c:9010
msgid "_Copy"
msgstr "ასლი"
#: gtk/gtklabel.c:5696 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
#: gtk/gtklabel.c:5701 gtk/gtktext.c:6143 gtk/gtktextview.c:9014
msgid "_Paste"
msgstr "ჩასმა"
#: gtk/gtklabel.c:5702 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
#: gtk/gtklabel.c:5707 gtk/gtktext.c:6156 gtk/gtktextview.c:9039
msgid "Select _All"
msgstr "ყველაფრის _მონიშვნა"
#: gtk/gtklabel.c:5707
#: gtk/gtklabel.c:5712
msgid "_Open Link"
msgstr "_ბმულის გახსნა"
#: gtk/gtklabel.c:5711
#: gtk/gtklabel.c:5716
msgid "Copy _Link Address"
msgstr "დაა_კოპირე ბმულის მისამართი"
#: gtk/gtklabel.c:5755 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
#: gtk/gtklabel.c:5760 gtk/gtktext.c:2716 gtk/gtktextview.c:9088
msgid "Context menu"
msgstr "კონტექსტური მენიუ"
@@ -3853,37 +3857,37 @@ msgstr "სტილის კლასები"
msgid "CSS Property"
msgstr "CSS-ის თვისება"
#: gtk/inspector/general.c:352
#: gtk/inspector/general.c:363
msgctxt "GL version"
msgid "None"
msgstr "არცერთი"
#: gtk/inspector/general.c:430
#: gtk/inspector/general.c:441
msgctxt "GL version"
msgid "Unknown"
msgstr "უცნობი"
#: gtk/inspector/general.c:495
#: gtk/inspector/general.c:503
msgctxt "Vulkan device"
msgid "Disabled"
msgstr "გამორთულია"
#: gtk/inspector/general.c:496 gtk/inspector/general.c:497
#: gtk/inspector/general.c:504 gtk/inspector/general.c:505
msgctxt "Vulkan version"
msgid "Disabled"
msgstr "გამორთულია"
#: gtk/inspector/general.c:553
#: gtk/inspector/general.c:555
msgctxt "Vulkan device"
msgid "None"
msgstr "არცერთი"
#: gtk/inspector/general.c:554 gtk/inspector/general.c:555
#: gtk/inspector/general.c:556 gtk/inspector/general.c:557
msgctxt "Vulkan version"
msgid "None"
msgstr "არცერთი"
#: gtk/inspector/general.c:893
#: gtk/inspector/general.c:895
msgid "IM Context is hardcoded by GTK_IM_MODULE"
msgstr "IM-ის კონტექსტი GTK_IM_MODULE-ში ხელითაა ჩაწერილი"
@@ -7281,7 +7285,7 @@ msgid "Use style from CSS file"
msgstr "სტილის CSS ფაილიდან გამოყენება"
#: tools/gtk-builder-tool-preview.c:187 tools/gtk-builder-tool-screenshot.c:370
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-render.c:204
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-render.c:203
#: tools/gtk-rendernode-tool-show.c:113
#, c-format
msgid "Could not initialize windowing system\n"
@@ -7327,13 +7331,13 @@ msgstr ""
"თავზე გადასაწერად გამოიყენეთ --force.\n"
#: tools/gtk-builder-tool-screenshot.c:332
#: tools/gtk-rendernode-tool-render.c:172
#: tools/gtk-rendernode-tool-render.c:171
#, c-format
msgid "Output written to %s.\n"
msgstr "გამოტანილი ინფორმაცია ჩაწერილია %s-ში.\n"
#: tools/gtk-builder-tool-screenshot.c:336
#: tools/gtk-rendernode-tool-render.c:176
#: tools/gtk-rendernode-tool-render.c:175
#, c-format
msgid "Failed to save %s: %s\n"
msgstr "\"%s'-ის შენახვის შეცდომა: %s\n"
@@ -7351,7 +7355,7 @@ msgid "Overwrite existing file"
msgstr "არსებულ ფაილზე გადაწერა"
#: tools/gtk-builder-tool-screenshot.c:363
#: tools/gtk-rendernode-tool-render.c:197
#: tools/gtk-rendernode-tool-render.c:196
msgid "FILE…"
msgstr "FILE…"
@@ -7821,6 +7825,7 @@ msgid ""
"Perform various tasks on GTK render nodes.\n"
"\n"
"Commands:\n"
" benchmark Benchmark rendering of a node\n"
" info Provide information about the node\n"
" show Show the node\n"
" render Take a screenshot of the node\n"
@@ -7832,6 +7837,7 @@ msgstr ""
"სხვადასხვა დავალებების შესრულება Gtk-ის რენდერის კვანძებზე.\n"
"\n"
"ბრძანებები:\n"
" benchmark კვანძის რენდერის წარმადობის გაზომვა\n"
" info ამ კვანძის შესახებ ინფორმაციის გამოტანა\n"
" show ამ კვანძის ჩვენება\n"
" render კვანძის ეკრანის ანაბეჭდის აღება\n"
@@ -7861,7 +7867,7 @@ msgstr "საწყისი: %g %g\n"
msgid "Provide information about the render node."
msgstr "შეიყვანეთ ინფორმაცია რენდერის კვანძის შესახებ."
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:225
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:224
#: tools/gtk-rendernode-tool-show.c:134
#, c-format
msgid "No .node file specified\n"
@@ -7887,19 +7893,24 @@ msgstr ""
msgid "Failed to generate SVG: %s\n"
msgstr "შეცდომა SVG-ის გენერაციისას: %s\n"
#: tools/gtk-rendernode-tool-render.c:196
#: tools/gtk-rendernode-tool-render.c:150
#, c-format
msgid "Failed to create renderer: %s\n"
msgstr "რენდერერის შექმნა ჩავარდა: %s\n"
#: tools/gtk-rendernode-tool-render.c:195
msgid "Renderer to use"
msgstr "გამოყენებული რენდერერი"
#: tools/gtk-rendernode-tool-render.c:196
#: tools/gtk-rendernode-tool-render.c:195
msgid "RENDERER"
msgstr "რენდერერი"
#: tools/gtk-rendernode-tool-render.c:212
#: tools/gtk-rendernode-tool-render.c:211
msgid "Render a .node file to an image."
msgstr ".ui ფაილის რენდერი გამოსახულებაში."
#: tools/gtk-rendernode-tool-render.c:231
#: tools/gtk-rendernode-tool-render.c:230
#, c-format
msgid "Can only render a single .node file to a single output file\n"
msgstr "ერთი .node ფაილის მხოლოდ ერთ გამოტანის ფაილში რენდერი შეგიძლიათ\n"
@@ -7917,12 +7928,12 @@ msgstr "რენდერის კვანძის ჩვენება."
msgid "Can only preview a single .node file\n"
msgstr "შეგიძლიათ მხოლოდ ერთი .node ფაილის გადახედვა\n"
#: tools/gtk-rendernode-tool-utils.c:51
#: tools/gtk-rendernode-tool-utils.c:54
#, c-format
msgid "Error at %s: %s\n"
msgstr "შეცდომა მისამართზე %s: %s\n"
#: tools/gtk-rendernode-tool-utils.c:69
#: tools/gtk-rendernode-tool-utils.c:72
#, c-format
msgid "Failed to load node file: %s\n"
msgstr "შეცდომა კვანძის ფაილის ჩატვირთვისას: %s\n"
+26 -14
View File
@@ -22,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+.master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2024-01-08 02:46+0000\n"
"PO-Revision-Date: 2024-01-08 15:00+0300\n"
"POT-Creation-Date: 2024-01-16 17:25+0000\n"
"PO-Revision-Date: 2024-01-16 22:49+0300\n"
"Last-Translator: Artur So <arturios2005@mail.ru>\n"
"Language-Team: Русский <gnome-cyr@gnome.org>\n"
"Language: ru\n"
@@ -867,6 +867,11 @@ msgid "This GLES %d.%d implementation does not support half-float vertex data"
msgstr ""
"Данная реализация GLES %d.%d не поддерживает полуплавающие вершинные данные"
#: gsk/gpu/gskgldevice.c:238
#, c-format
msgid "OpenGL ES 2.0 is not supported by this renderer."
msgstr "OpenGL ES 2.0 не поддерживается этим рендерером."
#: gtk/a11y/gtkatspiaction.c:239
msgctxt "accessibility"
msgid "Click"
@@ -2685,7 +2690,7 @@ msgstr "Вариации стилей"
msgid "Character Variations"
msgstr "Вариации символов"
#: gtk/gtkglarea.c:305
#: gtk/gtkglarea.c:309
msgid "OpenGL context creation failed"
msgstr "Не удалось создать контекст OpenGL"
@@ -7303,7 +7308,7 @@ msgid "Use style from CSS file"
msgstr "Использовать стиль из файла CSS"
#: tools/gtk-builder-tool-preview.c:187 tools/gtk-builder-tool-screenshot.c:370
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-render.c:204
#: tools/gtk-builder-tool-validate.c:268 tools/gtk-rendernode-tool-render.c:203
#: tools/gtk-rendernode-tool-show.c:113
#, c-format
msgid "Could not initialize windowing system\n"
@@ -7349,13 +7354,13 @@ msgstr ""
"Используйте --force для перезаписи.\n"
#: tools/gtk-builder-tool-screenshot.c:332
#: tools/gtk-rendernode-tool-render.c:172
#: tools/gtk-rendernode-tool-render.c:171
#, c-format
msgid "Output written to %s.\n"
msgstr "Выход записывается в %s.\n"
#: tools/gtk-builder-tool-screenshot.c:336
#: tools/gtk-rendernode-tool-render.c:176
#: tools/gtk-rendernode-tool-render.c:175
#, c-format
msgid "Failed to save %s: %s\n"
msgstr "Не удалось сохранить %s: %s\n"
@@ -7373,7 +7378,7 @@ msgid "Overwrite existing file"
msgstr "Перезаписать существующий файл"
#: tools/gtk-builder-tool-screenshot.c:363
#: tools/gtk-rendernode-tool-render.c:197
#: tools/gtk-rendernode-tool-render.c:196
msgid "FILE…"
msgstr "ФАЙЛ…"
@@ -7844,6 +7849,7 @@ msgid ""
"Perform various tasks on GTK render nodes.\n"
"\n"
"Commands:\n"
" benchmark Benchmark rendering of a node\n"
" info Provide information about the node\n"
" show Show the node\n"
" render Take a screenshot of the node\n"
@@ -7855,6 +7861,7 @@ msgstr ""
"Выполнение различных задач на узлах рендеринга GTK.\n"
"\n"
"Команды:\n"
" benchmark Тест рендеринга узла\n"
" info Предоставить информацию об узле\n"
" show Показать узел\n"
" render Сделать снимок узла\n"
@@ -7884,7 +7891,7 @@ msgstr "Источник: %g %g\n"
msgid "Provide information about the render node."
msgstr "Предоставить информацию об узле рендеринга."
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:225
#: tools/gtk-rendernode-tool-info.c:236 tools/gtk-rendernode-tool-render.c:224
#: tools/gtk-rendernode-tool-show.c:134
#, c-format
msgid "No .node file specified\n"
@@ -7909,19 +7916,24 @@ msgstr ""
msgid "Failed to generate SVG: %s\n"
msgstr "Не удалось сгенерировать SVG: %s\n"
#: tools/gtk-rendernode-tool-render.c:196
#: tools/gtk-rendernode-tool-render.c:150
#, c-format
msgid "Failed to create renderer: %s\n"
msgstr "Не удалось создать рендерер: %s\n"
#: tools/gtk-rendernode-tool-render.c:195
msgid "Renderer to use"
msgstr "Используемый рендерер"
#: tools/gtk-rendernode-tool-render.c:196
#: tools/gtk-rendernode-tool-render.c:195
msgid "RENDERER"
msgstr "РЕНДЕРЕР"
#: tools/gtk-rendernode-tool-render.c:212
#: tools/gtk-rendernode-tool-render.c:211
msgid "Render a .node file to an image."
msgstr "Преобразование .node файла в изображение."
#: tools/gtk-rendernode-tool-render.c:231
#: tools/gtk-rendernode-tool-render.c:230
#, c-format
msgid "Can only render a single .node file to a single output file\n"
msgstr "Можно вывести только один файл .node в один выходной файл\n"
@@ -7939,12 +7951,12 @@ msgstr "Показать узел рендеринга."
msgid "Can only preview a single .node file\n"
msgstr "Можно предварительно просмотреть только один .node файл\n"
#: tools/gtk-rendernode-tool-utils.c:51
#: tools/gtk-rendernode-tool-utils.c:54
#, c-format
msgid "Error at %s: %s\n"
msgstr "Ошибка в %s: %s\n"
#: tools/gtk-rendernode-tool-utils.c:69
#: tools/gtk-rendernode-tool-utils.c:72
#, c-format
msgid "Failed to load node file: %s\n"
msgstr "Не удалось загрузить node файл: %s\n"
@@ -0,0 +1,8 @@
clip {
clip: 0 0 50 50;
child: border {
colors: rgb(255,0,0) rgb(0,255,0);
outline: -15 -15 80 80 / 40;
widths: 40 0;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

@@ -0,0 +1,15 @@
opacity {
opacity: 0.6;
child: container {
container {
color {
bounds: 0 0 40 40;
color: rgb(255,0,0);
}
color {
bounds: 10 10 40 40;
color: rgb(0,255,0);
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More