Compare commits

..

48 Commits

Author SHA1 Message Date
Matthias Clasen dfefa884ad Add a GskPoint type and use it for offsets
This has a tremendous ripple effect and is kind of disastrous.
2024-01-21 21:25:24 -05:00
Matthias Clasen 72b8c6cf74 Use graphene's simd4f type for GskScale 2024-01-21 18:42:33 -05:00
Matthias Clasen 501095452a gsk: Introduce GskScale
Use a separate type for a 2d scale that the compiler won't confuse
with graphene_point_t. We can also move some of the generic scale/
transform code form gskgpunodeprocessor.c here.
2024-01-21 15:56:59 -05:00
Matthias Clasen 2ede31b682 Don't use a vec2 for blur direction either
A point_t does just as well.
2024-01-21 08:04:36 -05:00
Matthias Clasen 1355367360 gpu: Don't use a vec2 for scales
This is wasteful (since it gets stored as 4 highly-aligned floats),
and all we ever do is unpack and repack that simf4.
2024-01-21 08:04:36 -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
Matthias Clasen b4b7e9b040 gpu: Fix up gc
Make the gc loop free the the right item.
2024-01-20 08:04:43 -05:00
Matthias Clasen c3fcf0f7b0 gpu: Plug a memory leak
This looks like just a leftover line.
2024-01-20 08:02:20 -05:00
Matthias Clasen 60fc48e71f gpu: Cosmetics
s/timestsamp/timestamp/
2024-01-20 08:01:59 -05:00
Danial Behzadi 01d9886eea Update Persian translation 2024-01-20 11:22:43 +00:00
Danial Behzadi a97231c8bf Update Persian translation
(cherry picked from commit 58425405d2)
2024-01-20 11:13:44 +00:00
Matthias Clasen 8ac8a027b2 Merge branch 'wip/no-seat' into 'main'
Fix possible crashers if no seats are available

See merge request GNOME/gtk!6787
2024-01-20 03:30:12 +00:00
Carlos Garnacho 070f3a61ac gdk/wayland: Bail out on titlebar gestures with no seat
This API might be called programmatically at a time that there's no
seats, handle this situation by returning FALSE in the GDK API.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/6335
2024-01-20 01:27:27 +01:00
Carlos Garnacho 022347fa85 gdk/wayland: Avoid activation paths with no seats
When a toplevel is focused programmatically and there is no
underlying seat, we cannot attempt to focus it with no
focus to be obtained, nor serials serials to use.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/6335
2024-01-20 01:27:27 +01:00
Matthias Clasen ebb6076aca Merge branch 'matthiasc/for-main' into 'main'
inspector: Update logging tab

See merge request GNOME/gtk!6783
2024-01-19 16:46:06 +00:00
Matthias Clasen 7b66bc45aa Cosmetics
Add some vim modelines.
2024-01-19 09:26:32 -05:00
Matthias Clasen 698aa7c0f3 inspector: Update logging tab
The verbose flag was missing in the gsk section.
2024-01-19 09:26:32 -05:00
Matthias Clasen 70699efc71 Merge branch 'matthiasc/for-main' into 'main'
Automate profile setting

See merge request GNOME/gtk!6781
2024-01-19 03:49:58 +00:00
Matthias Clasen cebc95f253 Automate profile setting
We can derive whether we are build a developement snapshot or
a stable version from the minor version number. So do that.
This way, we'll get the devel profile selected in the nightly
SDK, which will make the commit sha appear in the inspector,
which is useful to determine what nightly users are testing.
2024-01-18 21:26:39 -05:00
Matthias Clasen f9c6bd125b Merge branch 'inspector-git-sha' into 'main'
build: Move demo header generation

See merge request GNOME/gtk!6780
2024-01-19 01:41:40 +00:00
Matthias Clasen 4733ca193b inspector: Show git sha for the build 2024-01-18 20:22:00 -05:00
Matthias Clasen c7b345f73e build: Move and rename demo_conf.h header
We want to use the same header in the inspector, so move it to
the toplevel. And since it is no longer for demos only, rename
it to profile_conf.h, and also rename the build option back
to profile.
2024-01-18 20:20:58 -05:00
Matthias Clasen 1fbc61f2cb Merge branch 'static_text_widgets_are_not_special' into 'main'
a11y: Remove special handling of accessible names for static text widgets

See merge request GNOME/gtk!6776
2024-01-18 16:01:29 +00:00
Matthias Clasen 565694ede5 Merge branch 'wip/chergert/fix-expression-weak-ref-uaf' into 'main'
expression: use indirection to safely finalize object expression

See merge request GNOME/gtk!6778
2024-01-18 16:00:55 +00:00
Christian Hergert 0df03b054d expression: guard against UAF with indirection
When using g_object_weak_ref(), it is important that you can discover
weather or not it is safe to call g_object_weak_unref(). That is
problematic if you use a naked pointer to structure. Additionally,
if a GWeakRef is used, and things are not cleaned up carefully,
GObject itself will try to write to it. So ensuring that the GWeakRef
is cleared safely before the owning struct is finalized is paramount.
That is difficult if you are unsure wheather or not your weak_ref
callback has been called.

This introduces WeakRefGuard which is an indirection pointer that is
cleared on the first unref. There are only ever two references. When
the owning struct is finalized or the weak ref callback is called, an
unref will occur and the guard will clear the data pointer.
2024-01-17 19:25:31 -08:00
Christian Hergert 73d01d3130 expression: release target if evaulation fails
Related #6341
2024-01-17 19:25:00 -08:00
Matthias Clasen 80f3357117 Merge branch 'dboles/Notebook-DropTarget-GTK4' into 'main'
Notebook: Update doc on how to accept dropped tabs

See merge request GNOME/gtk!6450
2024-01-18 02:28:18 +00:00
Lukáš Tyrychtr d5b34aecdd a11y: Remove special handling of accessible names for static text widgets
By doing this, we gain the capability to send notifications when their
accessible names change. Also, it simplifies the accessible name
generation logic.
2024-01-17 12:49:38 +01:00
Matthias Clasen d16d2135e6 Merge branch 'demos-fix-commit-sha' into 'main'
Flatpak demos fix missing commit sha

See merge request GNOME/gtk!6774
2024-01-17 02:51:35 +00:00
Matthias Clasen 53b52abd30 Merge branch 'matthiasc/for-main' into 'main'
Shrink the repeat-repeats tests

See merge request GNOME/gtk!6775
2024-01-17 02:40:22 +00:00
Matthias Clasen e55e9e3b36 Shrink the repeat-repeats tests
This was triggering timeouts in ci.
2024-01-16 20:58:02 -05:00
Matthias Clasen 9f9cea219f Merge branch 'dnd-cursor-names' into 'main'
dnd: Use standard cursor names

Closes #6337

See merge request GNOME/gtk!6770
2024-01-17 01:33:41 +00:00
Jan Willem Eriks cf8cca8724 Flatpak builds pass the commit sha as environment variable
This variable is refrenced at build-aux/meson/gen-demo-header.py but never passed to the flatpak builder.
This fixes that the flatpak build don't have their commit in the about window.
2024-01-16 20:45:01 +01:00
Daniel Boles 473881357c Notebook: Update doc on how to accept dropped tabs
It was still giving out-of-date info about how GTK3 did this. Update per
reading the current code, so readers have proper guidance on doing this.
2023-10-02 16:39:49 +01:00
83 changed files with 1123 additions and 658 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ flatpak build ${builddir} meson \
-Ddemo-profile=devel \
_flatpak_build
flatpak build ${builddir} ninja -C _flatpak_build install
flatpak build --env=CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA ${builddir} ninja -C _flatpak_build install
flatpak-builder \
--user --disable-rofiles-fuse \
+1 -1
View File
@@ -24,7 +24,7 @@
#include "demos.h"
#include "fontify.h"
#include "demo_conf.h"
#include "profile_conf.h"
static GtkWidget *info_view;
static GtkWidget *source_view;
+1 -1
View File
@@ -236,7 +236,7 @@ foreach flag: common_cflags
endif
endforeach
gtkdemo_deps += [ demo_conf_h ]
gtkdemo_deps += [ profile_conf_h ]
executable('gtk4-demo',
sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources],
+1 -1
View File
@@ -4,7 +4,7 @@
#include "iconbrowserapp.h"
#include "iconbrowserwin.h"
#include "demo_conf.h"
#include "profile_conf.h"
struct _IconBrowserApp
{
+1 -1
View File
@@ -14,7 +14,7 @@ iconbrowser_resources = gnome.compile_resources('iconbrowser_resources',
executable('gtk4-icon-browser',
sources: [iconbrowser_sources, iconbrowser_resources],
c_args: common_cflags,
dependencies: [ libgtk_dep, demo_conf_h ],
dependencies: [ libgtk_dep, profile_conf_h ],
include_directories: confinc,
win_subsystem: 'windows',
link_args: extra_demo_ldflags,
-13
View File
@@ -1,16 +1,3 @@
gen_demo_header = find_program('../build-aux/meson/gen-demo-header.py')
demo_profile = get_option('demo-profile')
demo_conf_h = declare_dependency(
sources: custom_target('demo-header',
command: [gen_demo_header, meson.project_source_root(), demo_profile],
capture: true,
output: 'demo_conf.h',
build_by_default: true,
build_always_stale: true,
)
)
# appdata
appdata_config = configuration_data()
+1 -1
View File
@@ -12,7 +12,7 @@ node_editor_resources = gnome.compile_resources('node_editor_resources',
executable('gtk4-node-editor',
sources: [node_editor_sources, node_editor_resources],
dependencies: [ libgtk_dep, demo_conf_h ],
dependencies: [ libgtk_dep, profile_conf_h ],
include_directories: confinc,
c_args: common_cflags,
win_subsystem: 'windows',
+1 -1
View File
@@ -25,7 +25,7 @@
#include "node-editor-window.h"
#include "demo_conf.h"
#include "profile_conf.h"
static const char *css =
"textview.editor {"
+1 -1
View File
@@ -1,7 +1,7 @@
executable('gtk4-print-editor',
sources: ['print-editor.c'],
c_args: common_cflags,
dependencies: [ libgtk_dep, demo_conf_h ],
dependencies: [ libgtk_dep, profile_conf_h ],
include_directories: confinc,
win_subsystem: 'windows',
link_args: extra_demo_ldflags,
+1 -1
View File
@@ -4,7 +4,7 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "demo_conf.h"
#include "profile_conf.h"
static GtkWidget *main_window;
static GFile *filename = NULL;
+1 -1
View File
@@ -66,7 +66,7 @@ endif
executable('gtk4-widget-factory',
sources: ['widget-factory.c', widgetfactory_resources],
c_args: common_cflags,
dependencies: [ libgtk_dep, demo_conf_h ],
dependencies: [ libgtk_dep, profile_conf_h ],
include_directories: confinc,
win_subsystem: 'windows',
link_args: extra_demo_ldflags,
+1 -1
View File
@@ -25,7 +25,7 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "demo_conf.h"
#include "profile_conf.h"
static void
change_dark_state (GSimpleAction *action,
+6 -5
View File
@@ -1973,8 +1973,10 @@ gdk_wayland_toplevel_titlebar_gesture (GdkToplevel *toplevel,
return FALSE;
seat = gdk_display_get_default_seat (surface->display);
wl_seat = gdk_wayland_seat_get_wl_seat (seat);
if (!seat)
return FALSE;
wl_seat = gdk_wayland_seat_get_wl_seat (seat);
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (GDK_WAYLAND_SEAT (seat), NULL);
gtk_surface1_titlebar_gesture (wayland_toplevel->display_server.gtk_surface,
@@ -2155,15 +2157,14 @@ gdk_wayland_toplevel_focus (GdkToplevel *toplevel,
GdkWaylandSurface *wayland_surface = GDK_WAYLAND_SURFACE (toplevel);
GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandSeat *seat =
GDK_WAYLAND_SEAT (gdk_display_get_default_seat (display));
gchar *startup_id = NULL;
startup_id = g_steal_pointer (&display_wayland->startup_notification_id);
if (display_wayland->xdg_activation)
if (seat && display_wayland->xdg_activation)
{
GdkWaylandSeat *seat =
GDK_WAYLAND_SEAT (gdk_display_get_default_seat (display));
/* If the focus request does not have a startup ID associated, get a
* new token to activate the window.
*/
+29 -29
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)
+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);
+1 -1
View File
@@ -60,7 +60,7 @@ gsk_gpu_blend_mode_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
float opacity,
GskBlendMode blend_mode,
guint32 bottom_descriptor,
+1 -1
View File
@@ -10,7 +10,7 @@ void gsk_gpu_blend_mode_op (GskGpuF
GskGpuShaderClip clip,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
float opacity,
GskBlendMode blend_mode,
guint32 start_descriptor,
+8 -7
View File
@@ -63,9 +63,9 @@ gsk_gpu_blur_op_full (GskGpuFrame *frame,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const graphene_vec2_t *blur_direction,
const graphene_point_t *blur_direction,
const GdkRGBA *blur_color)
{
GskGpuBlurInstance *instance;
@@ -79,7 +79,8 @@ gsk_gpu_blur_op_full (GskGpuFrame *frame,
gsk_gpu_rect_to_float (rect, offset, instance->rect);
gsk_gpu_rect_to_float (tex_rect, offset, instance->tex_rect);
graphene_vec2_to_float (blur_direction, instance->blur_direction);
instance->blur_direction[0] = blur_direction->x;
instance->blur_direction[1] = blur_direction->y;
gsk_gpu_rgba_to_float (blur_color, instance->blur_color);
instance->tex_id = descriptor;
}
@@ -90,9 +91,9 @@ gsk_gpu_blur_op (GskGpuFrame *frame,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const graphene_vec2_t *blur_direction)
const graphene_point_t *blur_direction)
{
gsk_gpu_blur_op_full (frame,
0,
@@ -112,9 +113,9 @@ gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const graphene_vec2_t *blur_direction,
const graphene_point_t *blur_direction,
const GdkRGBA *shadow_color)
{
gsk_gpu_blur_op_full (frame,
+4 -4
View File
@@ -11,18 +11,18 @@ void gsk_gpu_blur_op (GskGpuF
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const graphene_vec2_t *blur_direction);
const graphene_point_t *blur_direction);
void gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const graphene_vec2_t *blur_direction,
const graphene_point_t *blur_direction,
const GdkRGBA *shadow_color);
+2 -2
View File
@@ -103,7 +103,7 @@ void
gsk_gpu_border_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const GskRoundedRect *outline,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_point_t *inside_offset,
const float widths[4],
const GdkRGBA colors[4])
@@ -118,7 +118,7 @@ gsk_gpu_border_op (GskGpuFrame *frame,
NULL,
&instance);
gsk_rounded_rect_to_float (outline, offset, instance->outline);
gsk_gpu_rounded_rect_to_float (outline, offset, instance->outline);
for (i = 0; i < 4; i++)
{
+1 -1
View File
@@ -10,7 +10,7 @@ G_BEGIN_DECLS
void gsk_gpu_border_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const GskRoundedRect *outline,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_point_t *inside_offset,
const float widths[4],
const GdkRGBA colors[4]);
+2 -3
View File
@@ -86,7 +86,7 @@ gsk_gpu_box_shadow_op (GskGpuFrame *frame,
const graphene_point_t *shadow_offset,
float spread,
float blur_radius,
const graphene_point_t *offset,
const GskPoint *offset,
const GdkRGBA *color)
{
GskGpuBoxshadowInstance *instance;
@@ -102,11 +102,10 @@ gsk_gpu_box_shadow_op (GskGpuFrame *frame,
&instance);
gsk_gpu_rect_to_float (bounds, offset, instance->bounds);
gsk_rounded_rect_to_float (outline, offset, instance->outline);
gsk_gpu_rounded_rect_to_float (outline, offset, instance->outline);
gsk_gpu_rgba_to_float (color, instance->color);
instance->shadow_offset[0] = shadow_offset->x;
instance->shadow_offset[1] = shadow_offset->y;
instance->shadow_spread = spread;
instance->blur_radius = blur_radius;
}
+1 -1
View File
@@ -15,7 +15,7 @@ void gsk_gpu_box_shadow_op (
const graphene_point_t *shadow_offset,
float spread,
float blur_radius,
const graphene_point_t *offset,
const GskPoint *offset,
const GdkRGBA *color);
+5 -9
View File
@@ -238,12 +238,10 @@ gsk_gpu_clip_transform (GskGpuClip *dest,
gboolean
gsk_gpu_clip_may_intersect_rect (const GskGpuClip *self,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *rect)
{
graphene_rect_t r = *rect;
r.origin.x += offset->x;
r.origin.y += offset->y;
graphene_rect_t r = gsk_rect_add_offset (*rect, *offset);
switch (self->type)
{
@@ -262,12 +260,10 @@ gsk_gpu_clip_may_intersect_rect (const GskGpuClip *self,
gboolean
gsk_gpu_clip_contains_rect (const GskGpuClip *self,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *rect)
{
graphene_rect_t r = *rect;
r.origin.x += offset->x;
r.origin.y += offset->y;
graphene_rect_t r = gsk_rect_add_offset (*rect, *offset);
switch (self->type)
{
@@ -288,7 +284,7 @@ gsk_gpu_clip_contains_rect (const GskGpuClip *self,
GskGpuShaderClip
gsk_gpu_clip_get_shader_clip (const GskGpuClip *self,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *rect)
{
if (self->type == GSK_GPU_CLIP_NONE ||
+8 -8
View File
@@ -59,15 +59,15 @@ gboolean gsk_gpu_clip_transform (GskGpuC
GskTransform *transform,
const graphene_rect_t *viewport) G_GNUC_WARN_UNUSED_RESULT;
gboolean gsk_gpu_clip_contains_rect (const GskGpuClip *self,
const graphene_point_t *offset,
gboolean gsk_gpu_clip_contains_rect (const GskGpuClip *self,
const GskPoint *offset,
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
gboolean gsk_gpu_clip_may_intersect_rect (const GskGpuClip *self,
const graphene_point_t *offset,
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
GskGpuShaderClip gsk_gpu_clip_get_shader_clip (const GskGpuClip *self,
const graphene_point_t *offset,
const graphene_rect_t *rect);
gboolean gsk_gpu_clip_may_intersect_rect (const GskGpuClip *self,
const GskPoint *offset,
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
GskGpuShaderClip gsk_gpu_clip_get_shader_clip (const GskGpuClip *self,
const GskPoint *offset,
const graphene_rect_t *rect);
G_END_DECLS
+1 -1
View File
@@ -59,7 +59,7 @@ gsk_gpu_colorize_op (GskGpuFrame *frame,
GskGpuDescriptors *descriptors,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const GdkRGBA *color)
{
+1 -1
View File
@@ -11,7 +11,7 @@ void gsk_gpu_colorize_op (GskGpuF
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const GdkRGBA *color);
+2 -2
View File
@@ -58,7 +58,7 @@ gsk_gpu_color_matrix_op (GskGpuFrame *frame,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const graphene_matrix_t *color_matrix,
const graphene_vec4_t *color_offset)
@@ -85,7 +85,7 @@ gsk_gpu_color_matrix_op_opacity (GskGpuFrame *frame,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
float opacity)
{
+2 -2
View File
@@ -11,7 +11,7 @@ void gsk_gpu_color_matrix_op (GskGpuF
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
const graphene_matrix_t *color_matrix,
const graphene_vec4_t *color_offset);
@@ -21,7 +21,7 @@ void gsk_gpu_color_matrix_op_opacity (GskGpuF
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect,
float opacity);
+1 -1
View File
@@ -57,7 +57,7 @@ void
gsk_gpu_color_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const GdkRGBA *color)
{
GskGpuColorInstance *instance;
+1 -1
View File
@@ -9,7 +9,7 @@ G_BEGIN_DECLS
void gsk_gpu_color_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const GdkRGBA *color);
+1 -1
View File
@@ -59,7 +59,7 @@ gsk_gpu_conic_gradient_op (GskGpuFrame *frame,
const graphene_rect_t *rect,
const graphene_point_t *center,
float angle,
const graphene_point_t *offset,
const GskPoint *offset,
const GskColorStop *stops,
gsize n_stops)
{
+1 -1
View File
@@ -13,7 +13,7 @@ void gsk_gpu_conic_gradient_op (GskGpuF
const graphene_rect_t *rect,
const graphene_point_t *center,
float angle,
const graphene_point_t *offset,
const GskPoint *offset,
const GskColorStop *stops,
gsize n_stops);
+1 -1
View File
@@ -59,7 +59,7 @@ gsk_gpu_cross_fade_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
float opacity,
float progress,
guint32 start_descriptor,
+1 -1
View File
@@ -10,7 +10,7 @@ void gsk_gpu_cross_fade_op (GskGpuF
GskGpuShaderClip clip,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
float opacity,
float progress,
guint32 start_descriptor,
+4 -4
View File
@@ -48,7 +48,7 @@ struct _GskGpuCachedClass
GskGpuCached *cached);
gboolean (* should_collect) (GskGpuDevice *device,
GskGpuCached *cached,
gint64 timestsamp);
gint64 timestamp);
};
struct _GskGpuCached
@@ -285,7 +285,7 @@ gsk_gpu_cached_glyph_free (GskGpuDevice *device,
static gboolean
gsk_gpu_cached_glyph_should_collect (GskGpuDevice *device,
GskGpuCached *cached,
gint64 timestsamp)
gint64 timestamp)
{
/* FIXME */
return FALSE;
@@ -336,7 +336,7 @@ gsk_gpu_device_gc (GskGpuDevice *self,
{
next = cached->next;
if (gsk_gpu_cached_should_collect (self, cached, timestamp))
gsk_gpu_cached_free (self, priv->first_cached);
gsk_gpu_cached_free (self, cached);
}
}
@@ -661,7 +661,6 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
return cache->image;
}
cache = g_new (GskGpuCachedGlyph, 1);
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);
@@ -721,3 +720,4 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
}
/* }}} */
/* vim:set foldmethod=marker expandtab: */
+6 -3
View File
@@ -12,6 +12,8 @@
#include "gskvulkandescriptorsprivate.h"
#endif
#include "gskrectprivate.h"
typedef struct _GskGpuGlobalsOp GskGpuGlobalsOp;
struct _GskGpuGlobalsOp
@@ -87,15 +89,16 @@ static const GskGpuOpClass GSK_GPU_GLOBALS_OP_CLASS = {
void
gsk_gpu_globals_op (GskGpuFrame *frame,
const graphene_vec2_t *scale,
const GskScale *scale,
const graphene_matrix_t *mvp,
const GskRoundedRect *clip)
{
GskGpuGlobalsOp *self;
GskPoint zero = gsk_point_init (0, 0);
self = (GskGpuGlobalsOp *) gsk_gpu_op_alloc (frame, &GSK_GPU_GLOBALS_OP_CLASS);
graphene_matrix_to_float (mvp, self->instance.mvp);
gsk_rounded_rect_to_float (clip, graphene_point_zero (), self->instance.clip);
graphene_vec2_to_float (scale, self->instance.scale);
gsk_gpu_rounded_rect_to_float (clip, &zero, self->instance.clip);
gsk_scale_to_float (scale, self->instance.scale);
}
+2 -1
View File
@@ -3,6 +3,7 @@
#include "gskgpuopprivate.h"
#include <gsk/gskroundedrect.h>
#include "gsk/gskscaleprivate.h"
#include <graphene.h>
G_BEGIN_DECLS
@@ -17,7 +18,7 @@ struct _GskGpuGlobalsInstance
};
void gsk_gpu_globals_op (GskGpuFrame *frame,
const graphene_vec2_t *scale,
const GskScale *scale,
const graphene_matrix_t *mvp,
const GskRoundedRect *clip);
+1 -1
View File
@@ -64,7 +64,7 @@ gsk_gpu_linear_gradient_op (GskGpuFrame *frame,
const graphene_rect_t *rect,
const graphene_point_t *start,
const graphene_point_t *end,
const graphene_point_t *offset,
const GskPoint *offset,
const GskColorStop *stops,
gsize n_stops)
{
+1 -1
View File
@@ -14,7 +14,7 @@ void gsk_gpu_linear_gradient_op (GskGpuF
const graphene_rect_t *rect,
const graphene_point_t *start,
const graphene_point_t *end,
const graphene_point_t *offset,
const GskPoint *offset,
const GskColorStop *stops,
gsize n_stops);
+1 -1
View File
@@ -58,7 +58,7 @@ gsk_gpu_mask_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
float opacity,
GskMaskMode mask_mode,
guint32 source_descriptor,
+1 -1
View File
@@ -10,7 +10,7 @@ void gsk_gpu_mask_op (GskGpuF
GskGpuShaderClip clip,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
float opacity,
GskMaskMode mask_mode,
guint32 source_descriptor,
+172 -295
View File
@@ -40,6 +40,8 @@
#include "gskroundedrectprivate.h"
#include "gskstrokeprivate.h"
#include "gsktransformprivate.h"
#include "gskscaleprivate.h"
#include "gskpointprivate.h"
#include "gdk/gdkrgbaprivate.h"
@@ -104,12 +106,12 @@ struct _GskGpuNodeProcessor
GskGpuFrame *frame;
GskGpuDescriptors *desc;
cairo_rectangle_int_t scissor;
GskGpuBlend blend;
graphene_point_t offset;
graphene_matrix_t projection;
graphene_vec2_t scale;
GskTransform *modelview;
GskGpuClip clip;
GskGpuBlend blend;
GskPoint offset;
GskScale scale;
GskTransform *modelview;
graphene_matrix_t projection;
float opacity;
GskGpuGlobals pending_globals;
@@ -129,8 +131,8 @@ struct _GskGpuPatternWriter
GskGpuDescriptors *desc;
graphene_rect_t bounds;
graphene_point_t offset;
graphene_vec2_t scale;
GskPoint offset;
GskScale scale;
guint stack;
PatternBuffer buffer;
@@ -175,24 +177,20 @@ gsk_gpu_node_processor_init (GskGpuNodeProcessor *self,
}
else
{
float scale_x = viewport->size.width / width;
float scale_y = viewport->size.height / height;
gsk_gpu_clip_init_rect (&self->clip,
&GRAPHENE_RECT_INIT (
scale_x * clip->x,
scale_y * clip->y,
scale_x * clip->width,
scale_y * clip->height
));
graphene_rect_t rect;
rect = gsk_rect_scale (GRAPHENE_RECT_INIT (clip->x, clip->y, clip->width, clip->height),
gsk_scale_init (viewport->size.width / width,
viewport->size.height / height));
gsk_gpu_clip_init_rect (&self->clip, &rect);
}
self->modelview = NULL;
gsk_gpu_image_get_projection_matrix (target, &self->projection);
graphene_vec2_init (&self->scale,
width / viewport->size.width,
height / viewport->size.height);
self->offset = GRAPHENE_POINT_INIT (-viewport->origin.x,
-viewport->origin.y);
self->scale = gsk_scale_init (width / viewport->size.width,
height / viewport->size.height);
self->offset = gsk_point_init (-viewport->origin.x,
-viewport->origin.y);
self->opacity = 1.0;
self->pending_globals = GSK_GPU_GLOBAL_MATRIX | GSK_GPU_GLOBAL_SCALE | GSK_GPU_GLOBAL_CLIP | GSK_GPU_GLOBAL_SCISSOR | GSK_GPU_GLOBAL_BLEND;
}
@@ -304,42 +302,20 @@ gsk_gpu_node_processor_add_images (GskGpuNodeProcessor *self,
while (desc != self->desc);
}
static void
rect_round_to_pixels (const graphene_rect_t *src,
const graphene_vec2_t *pixel_scale,
const graphene_point_t *pixel_offset,
graphene_rect_t *dest)
{
float x, y, xscale, yscale, inv_xscale, inv_yscale;
xscale = graphene_vec2_get_x (pixel_scale);
yscale = graphene_vec2_get_y (pixel_scale);
inv_xscale = 1.0f / xscale;
inv_yscale = 1.0f / yscale;
x = floorf ((src->origin.x + pixel_offset->x) * xscale);
y = floorf ((src->origin.y + pixel_offset->y) * yscale);
*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);
}
static GskGpuImage *
gsk_gpu_node_processor_init_draw (GskGpuNodeProcessor *self,
GskGpuFrame *frame,
GdkMemoryDepth depth,
const graphene_vec2_t *scale,
const graphene_rect_t *viewport)
gsk_gpu_node_processor_init_draw (GskGpuNodeProcessor *self,
GskGpuFrame *frame,
GdkMemoryDepth depth,
const GskScale *scale,
const graphene_rect_t *viewport)
{
GskGpuImage *image;
cairo_rectangle_int_t area;
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 (gsk_scale_get_x (*scale) * viewport->size.width);
area.height = ceilf (gsk_scale_get_y (*scale) * viewport->size.height);
image = gsk_gpu_device_create_offscreen_image (gsk_gpu_frame_get_device (frame),
FALSE,
@@ -398,16 +374,13 @@ gsk_gpu_node_processor_process (GskGpuFrame *frame,
static void
gsk_gpu_pattern_writer_init (GskGpuPatternWriter *self,
GskGpuFrame *frame,
const graphene_vec2_t *scale,
const graphene_point_t *offset,
const GskScale *scale,
const GskPoint *offset,
const graphene_rect_t *bounds)
{
self->frame = frame;
self->desc = NULL;
self->bounds = GRAPHENE_RECT_INIT (bounds->origin.x + offset->x,
bounds->origin.y + offset->y,
bounds->size.width,
bounds->size.height);
self->bounds = gsk_rect_add_offset (*bounds, *offset);
self->offset = *offset;
self->scale = *scale;
self->stack = 0;
@@ -476,12 +449,12 @@ gsk_gpu_pattern_writer_append_vec4 (GskGpuPatternWriter *self,
static void
gsk_gpu_pattern_writer_append_point (GskGpuPatternWriter *self,
const graphene_point_t *point,
const graphene_point_t *offset)
const GskPoint *offset)
{
float f[2];
f[0] = point->x + offset->x;
f[1] = point->y + offset->y;
f[0] = point->x + gsk_point_get_x (*offset);
f[1] = point->y + gsk_point_get_y (*offset);
gsk_gpu_pattern_writer_append (self, G_ALIGNOF (float), (guchar *) f, sizeof (f));
}
@@ -489,7 +462,7 @@ gsk_gpu_pattern_writer_append_point (GskGpuPatternWriter *self,
static void
gsk_gpu_pattern_writer_append_rect (GskGpuPatternWriter *self,
const graphene_rect_t *rect,
const graphene_point_t *offset)
const GskPoint *offset)
{
float f[4];
@@ -553,78 +526,14 @@ gsk_gpu_pattern_writer_add_image (GskGpuPatternWriter *self,
return gsk_gpu_descriptors_add_image (self->desc, image, sampler, out_descriptor);
}
static void
extract_scale_from_transform (GskTransform *transform,
float *out_scale_x,
float *out_scale_y)
{
switch (gsk_transform_get_category (transform))
{
default:
g_assert_not_reached ();
G_GNUC_FALLTHROUGH;
case GSK_TRANSFORM_CATEGORY_IDENTITY:
case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
*out_scale_x = 1.0f;
*out_scale_y = 1.0f;
return;
case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
{
float scale_x, scale_y, dx, dy;
gsk_transform_to_affine (transform, &scale_x, &scale_y, &dx, &dy);
*out_scale_x = fabs (scale_x);
*out_scale_y = fabs (scale_y);
}
return;
case GSK_TRANSFORM_CATEGORY_2D:
{
float skew_x, skew_y, scale_x, scale_y, angle, dx, dy;
gsk_transform_to_2d_components (transform,
&skew_x, &skew_y,
&scale_x, &scale_y,
&angle,
&dx, &dy);
*out_scale_x = fabs (scale_x);
*out_scale_y = fabs (scale_y);
}
return;
case GSK_TRANSFORM_CATEGORY_UNKNOWN:
case GSK_TRANSFORM_CATEGORY_ANY:
case GSK_TRANSFORM_CATEGORY_3D:
{
graphene_quaternion_t rotation;
graphene_matrix_t matrix;
graphene_vec4_t perspective;
graphene_vec3_t translation;
graphene_vec3_t matrix_scale;
graphene_vec3_t shear;
gsk_transform_to_matrix (transform, &matrix);
graphene_matrix_decompose (&matrix,
&translation,
&matrix_scale,
&rotation,
&shear,
&perspective);
*out_scale_x = fabs (graphene_vec3_get_x (&matrix_scale));
*out_scale_y = fabs (graphene_vec3_get_y (&matrix_scale));
}
return;
}
}
static gboolean
gsk_gpu_node_processor_rect_is_integer (GskGpuNodeProcessor *self,
const graphene_rect_t *rect,
cairo_rectangle_int_t *int_rect)
{
graphene_rect_t transformed_rect;
float scale_x = graphene_vec2_get_x (&self->scale);
float scale_y = graphene_vec2_get_y (&self->scale);
float scale_x = gsk_scale_get_x (self->scale);
float scale_y = gsk_scale_get_y (self->scale);
switch (gsk_transform_get_category (self->modelview))
{
@@ -662,10 +571,8 @@ static void
gsk_gpu_node_processor_get_clip_bounds (GskGpuNodeProcessor *self,
graphene_rect_t *out_bounds)
{
graphene_rect_offset_r (&self->clip.rect.bounds,
- self->offset.x,
- self->offset.y,
out_bounds);
*out_bounds = gsk_rect_init_offset (self->clip.rect.bounds,
gsk_point_negate (self->offset));
/* FIXME: We could try the scissor rect here.
* But how often is that smaller than the clip bounds?
@@ -758,7 +665,7 @@ gsk_gpu_node_processor_image_op (GskGpuNodeProcessor *self,
static GskGpuImage *
gsk_gpu_get_node_as_image (GskGpuFrame *frame,
const graphene_rect_t *clip_bounds,
const graphene_vec2_t *scale,
const GskScale *scale,
GskRenderNode *node,
graphene_rect_t *out_bounds)
{
@@ -938,7 +845,7 @@ gsk_gpu_node_processor_get_node_as_image (GskGpuNodeProcessor *self,
return NULL;
clip_bounds = &clip;
}
rect_round_to_pixels (clip_bounds, &self->scale, &self->offset, &clip);
clip = gsk_rect_round_to_pixels (*clip_bounds, self->scale, self->offset);
image = gsk_gpu_get_node_as_image (self->frame,
&clip,
@@ -980,9 +887,8 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
GskGpuNodeProcessor other;
GskGpuImage *intermediate;
guint32 intermediate_descriptor;
graphene_vec2_t direction;
graphene_rect_t clip_rect, intermediate_rect;
graphene_point_t real_offset;
GskPoint real_offset;
int width, height;
float clip_radius;
@@ -994,8 +900,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 (gsk_scale_get_x (self->scale) * intermediate_rect.size.width);
height = ceilf (gsk_scale_get_y (self->scale) * intermediate_rect.size.height);
intermediate = gsk_gpu_device_create_offscreen_image (gsk_gpu_frame_get_device (self->frame),
FALSE,
@@ -1016,7 +922,6 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
gsk_gpu_node_processor_sync_globals (&other, 0);
graphene_vec2_init (&direction, blur_radius, 0.0f);
gsk_gpu_blur_op (other.frame,
gsk_gpu_clip_get_shader_clip (&other.clip, &other.offset, &intermediate_rect),
source_desc,
@@ -1024,7 +929,7 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
&intermediate_rect,
&other.offset,
source_rect,
&direction);
&GRAPHENE_POINT_INIT (blur_radius, 0));
gsk_gpu_render_pass_end_op (other.frame,
intermediate,
@@ -1032,9 +937,7 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
gsk_gpu_node_processor_finish (&other);
real_offset = GRAPHENE_POINT_INIT (self->offset.x + shadow_offset->x,
self->offset.y + shadow_offset->y);
graphene_vec2_init (&direction, 0.0f, blur_radius);
real_offset = gsk_point_add (self->offset, gsk_point_init (shadow_offset->x, shadow_offset->y));
intermediate_descriptor = gsk_gpu_node_processor_add_image (self, intermediate, GSK_GPU_SAMPLER_TRANSPARENT);
if (shadow_color)
{
@@ -1045,7 +948,7 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
rect,
&real_offset,
&intermediate_rect,
&direction,
&GRAPHENE_POINT_INIT (0, blur_radius),
shadow_color);
}
else
@@ -1057,7 +960,7 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
rect,
&real_offset,
&intermediate_rect,
&direction);
&GRAPHENE_POINT_INIT (0, blur_radius));
}
g_object_unref (intermediate);
@@ -1073,7 +976,7 @@ gsk_gpu_node_processor_add_fallback_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clipped_bounds))
return;
rect_round_to_pixels (&clipped_bounds, &self->scale, &self->offset, &clipped_bounds);
clipped_bounds = gsk_rect_round_to_pixels (clipped_bounds, self->scale, self->offset);
gsk_gpu_node_processor_sync_globals (self, 0);
@@ -1295,9 +1198,7 @@ gsk_gpu_node_processor_add_node_clipped (GskGpuNodeProcessor *self,
return;
}
graphene_rect_offset_r (clip_bounds,
self->offset.x, self->offset.y,
&clip);
clip = gsk_rect_add_offset (*clip_bounds, self->offset);
gsk_gpu_clip_init_copy (&old_clip, &self->clip);
@@ -1428,7 +1329,8 @@ gsk_gpu_node_processor_add_rounded_clip_node_with_mask (GskGpuNodeProcessor *sel
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clip_bounds))
return;
rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds);
clip_bounds = gsk_rect_round_to_pixels (clip_bounds, self->scale, self->offset);
child_image = gsk_gpu_node_processor_get_node_as_image (self,
0,
@@ -1505,7 +1407,7 @@ gsk_gpu_node_processor_add_rounded_clip_node (GskGpuNodeProcessor *self,
gsk_gpu_clip_init_copy (&old_clip, &self->clip);
clip = *original_clip;
gsk_rounded_rect_offset (&clip, self->offset.x, self->offset.y);
gsk_rounded_rect_offset (&clip, gsk_point_get_x (self->offset), gsk_point_get_y (self->offset));
if (!gsk_gpu_clip_intersect_rounded_rect (&self->clip, &old_clip, &clip))
{
@@ -1534,8 +1436,8 @@ gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
{
GskRenderNode *child;
GskTransform *transform;
graphene_point_t old_offset;
graphene_vec2_t old_scale;
GskPoint old_offset;
GskScale old_scale;
GskTransform *old_modelview;
GskGpuClip old_clip;
@@ -1550,8 +1452,7 @@ gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
float dx, dy;
gsk_transform_to_translate (transform, &dx, &dy);
old_offset = self->offset;
self->offset.x += dx;
self->offset.y += dy;
self->offset = gsk_point_add (self->offset, gsk_point_init (dx,dy));
gsk_gpu_node_processor_add_node (self, child);
self->offset = old_offset;
}
@@ -1568,13 +1469,11 @@ gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
gsk_transform_to_affine (transform, &scale_x, &scale_y, &dx, &dy);
gsk_gpu_clip_scale (&self->clip, &old_clip, scale_x, scale_y);
self->offset.x = (self->offset.x + dx) / scale_x;
self->offset.y = (self->offset.y + dy) / scale_y;
graphene_vec2_init (&self->scale, fabs (scale_x), fabs (scale_y));
graphene_vec2_multiply (&self->scale, &old_scale, &self->scale);
self->offset = gsk_point_divide (gsk_point_add (self->offset, gsk_point_init (dx, dy)), gsk_scale_init (scale_x, scale_y));
self->scale = gsk_scale_multiply (old_scale, gsk_scale_init (fabsf (scale_x), fabsf (scale_y)));
self->modelview = gsk_transform_scale (self->modelview,
scale_x / fabs (scale_x),
scale_y / fabs (scale_y));
scale_x / fabsf (scale_x),
scale_y / fabsf (scale_y));
}
break;
@@ -1584,9 +1483,10 @@ gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
case GSK_TRANSFORM_CATEGORY_3D:
{
GskTransform *clip_transform;
float scale_x, scale_y, old_pixels, new_pixels;
float old_pixels, new_pixels;
GskScale scale;
clip_transform = gsk_transform_transform (gsk_transform_translate (NULL, &self->offset), transform);
clip_transform = gsk_transform_transform (gsk_transform_translate (NULL, &GRAPHENE_POINT_INIT (gsk_point_get_x (self->offset), gsk_point_get_y (self->offset))), transform);
gsk_gpu_clip_init_copy (&old_clip, &self->clip);
if (gsk_gpu_clip_contains_rect (&self->clip, &self->offset, &node->bounds))
@@ -1631,26 +1531,25 @@ gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
old_modelview = gsk_transform_ref (self->modelview);
self->modelview = gsk_transform_scale (self->modelview,
graphene_vec2_get_x (&self->scale),
graphene_vec2_get_y (&self->scale));
gsk_scale_get_x (self->scale),
gsk_scale_get_y (self->scale));
self->modelview = gsk_transform_transform (self->modelview, clip_transform);
gsk_transform_unref (clip_transform);
extract_scale_from_transform (self->modelview, &scale_x, &scale_y);
scale = gsk_scale_extract_from_transform (self->modelview);
old_pixels = graphene_vec2_get_x (&old_scale) * graphene_vec2_get_y (&old_scale) *
old_pixels = gsk_scale_get_x (old_scale) * gsk_scale_get_y (old_scale) *
old_clip.rect.bounds.size.width * old_clip.rect.bounds.size.height;
new_pixels = scale_x * scale_y * self->clip.rect.bounds.size.width * self->clip.rect.bounds.size.height;
new_pixels = gsk_scale_get_x (scale) * gsk_scale_get_y (scale) *
self->clip.rect.bounds.size.width * self->clip.rect.bounds.size.height;
if (new_pixels > 2 * old_pixels)
{
float forced_downscale = 2 * old_pixels / new_pixels;
scale_x *= forced_downscale;
scale_y *= forced_downscale;
}
scale = gsk_scale_multiply (scale, gsk_scale_init_uniform (2 * old_pixels / new_pixels));
self->modelview = gsk_transform_scale (self->modelview, 1 / scale_x, 1 / scale_y);
graphene_vec2_init (&self->scale, scale_x, scale_y);
self->offset = *graphene_point_zero ();
self->modelview = gsk_transform_scale (self->modelview,
1 / gsk_scale_get_x (scale),
1 / gsk_scale_get_y (scale));
self->scale = scale;
self->offset = gsk_point_init (0, 0);
}
break;
@@ -1677,8 +1576,8 @@ gsk_gpu_node_processor_create_transform_pattern (GskGpuPatternWriter *self,
{
GskRenderNode *child;
GskTransform *transform;
graphene_point_t old_offset;
graphene_vec2_t old_scale;
GskPoint old_offset;
GskScale old_scale;
graphene_rect_t old_bounds;
gboolean result;
@@ -1697,8 +1596,7 @@ gsk_gpu_node_processor_create_transform_pattern (GskGpuPatternWriter *self,
{
float dx, dy;
gsk_transform_to_translate (transform, &dx, &dy);
self->offset.x += dx;
self->offset.y += dy;
self->offset = gsk_point_add (self->offset, gsk_point_init (dx, dy));
result = gsk_gpu_node_processor_create_node_pattern (self, child);
self->offset = old_offset;
return result;
@@ -1707,22 +1605,21 @@ gsk_gpu_node_processor_create_transform_pattern (GskGpuPatternWriter *self,
case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
{
float sx, sy, dx, dy, inv_sx, inv_sy;
GskPoint p;
graphene_vec4_t vec4;
if (!gsk_gpu_pattern_writer_push_stack (self))
return FALSE;
gsk_transform_to_affine (transform, &sx, &sy, &dx, &dy);
inv_sx = 1.f / sx;
inv_sy = 1.f / sy;
p = gsk_point_add (self->offset, gsk_point_init (dx, dy));
gsk_gpu_pattern_writer_append_uint (self, GSK_GPU_PATTERN_AFFINE);
graphene_vec4_init (&vec4, self->offset.x + dx, self->offset.y + dy, inv_sx, inv_sy);
graphene_vec4_init (&vec4, gsk_point_get_x (p), gsk_point_get_y (p), inv_sx, inv_sy);
gsk_gpu_pattern_writer_append_vec4 (self, &vec4);
self->bounds.origin.x = (self->bounds.origin.x - self->offset.x - dx) * inv_sx;
self->bounds.origin.y = (self->bounds.origin.y - self->offset.y - dy) * inv_sy;
self->bounds.size.width *= inv_sx;
self->bounds.size.height *= inv_sy;
self->offset = GRAPHENE_POINT_INIT (0, 0);
graphene_vec2_init (&self->scale, fabs (sx), fabs (sy));
graphene_vec2_multiply (&self->scale, &old_scale, &self->scale);
self->bounds = gsk_rect_scale (gsk_rect_subtract_offset (self->bounds, p),
gsk_scale_init (inv_sx, inv_sy));
self->offset = gsk_point_init (0, 0);
self->scale = gsk_scale_multiply (gsk_scale_init (fabsf (sx), fabsf (sy)), old_scale);
}
break;
@@ -1744,9 +1641,9 @@ gsk_gpu_node_processor_create_transform_pattern (GskGpuPatternWriter *self,
gsk_gpu_pattern_writer_append_uint (self, GSK_GPU_PATTERN_POSITION_POP);
gsk_gpu_pattern_writer_pop_stack (self);
self->scale = old_scale;
self->bounds = old_bounds;
self->offset = old_offset;
self->scale = old_scale;
self->bounds = old_bounds;
self->offset = old_offset;
return result;
}
@@ -1771,11 +1668,10 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
cairo_rectangle_int_t int_clipped;
graphene_rect_t rect, clipped;
const GdkRGBA *color;
GskPoint zero = gsk_point_init (0, 0);
color = gsk_color_node_get_color (node);
graphene_rect_offset_r (&node->bounds,
self->offset.x, self->offset.y,
&rect);
rect = gsk_rect_add_offset (node->bounds, self->offset);
gsk_rect_intersection (&self->clip.rect.bounds, &rect, &clipped);
if (gsk_gpu_frame_should_optimize (self->frame, GSK_GPU_OPTIMIZE_CLEAR) &&
@@ -1806,24 +1702,24 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
return;
}
scale_x = graphene_vec2_get_x (&self->scale);
scale_y = graphene_vec2_get_y (&self->scale);
scale_x = gsk_scale_get_x (self->scale);
scale_y = gsk_scale_get_y (self->scale);
clipped = GRAPHENE_RECT_INIT (int_clipped.x / scale_x, int_clipped.y / scale_y,
int_clipped.width / scale_x, int_clipped.height / scale_y);
shader_clip = gsk_gpu_clip_get_shader_clip (&self->clip, graphene_point_zero(), &clipped);
shader_clip = gsk_gpu_clip_get_shader_clip (&self->clip, &zero, &clipped);
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,
shader_clip,
&clipped,
graphene_point_zero (),
&zero,
color);
return;
}
@@ -1833,13 +1729,13 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
gsk_gpu_color_op (self->frame,
shader_clip,
&GRAPHENE_RECT_INIT (clipped.origin.x, clipped.origin.y, cover.origin.x - clipped.origin.x, clipped.size.height),
graphene_point_zero (),
&zero,
color);
if (clipped.origin.y != cover.origin.y)
gsk_gpu_color_op (self->frame,
shader_clip,
&GRAPHENE_RECT_INIT (clipped.origin.x, clipped.origin.y, clipped.size.width, cover.origin.y - clipped.origin.y),
graphene_point_zero (),
&zero,
color);
if (clipped.origin.x + clipped.size.width != cover.origin.x + cover.size.width)
gsk_gpu_color_op (self->frame,
@@ -1848,7 +1744,7 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
clipped.origin.y,
clipped.origin.x + clipped.size.width - cover.origin.x - cover.size.width,
clipped.size.height),
graphene_point_zero (),
&zero,
color);
if (clipped.origin.y + clipped.size.height != cover.origin.y + cover.size.height)
gsk_gpu_color_op (self->frame,
@@ -1857,7 +1753,7 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
cover.origin.y + cover.size.height,
clipped.size.width,
clipped.origin.y + clipped.size.height - cover.origin.y - cover.size.height),
graphene_point_zero (),
&zero,
color);
}
}
@@ -1934,8 +1830,8 @@ gsk_gpu_node_processor_add_texture_node (GskGpuNodeProcessor *self,
}
if (gsk_gpu_frame_should_optimize (self->frame, GSK_GPU_OPTIMIZE_MIPMAP) &&
(gdk_texture_get_width (texture) > 2 * node->bounds.size.width * graphene_vec2_get_x (&self->scale) ||
gdk_texture_get_height (texture) > 2 * node->bounds.size.height * graphene_vec2_get_y (&self->scale)))
(gdk_texture_get_width (texture) > 2 * node->bounds.size.width * gsk_scale_get_x (self->scale) ||
gdk_texture_get_height (texture) > 2 * node->bounds.size.height * gsk_scale_get_y (self->scale)))
{
guint32 descriptor;
@@ -2001,8 +1897,8 @@ gsk_gpu_node_processor_create_texture_pattern (GskGpuPatternWriter *self,
}
if (gsk_gpu_frame_should_optimize (self->frame, GSK_GPU_OPTIMIZE_MIPMAP) &&
(gdk_texture_get_width (texture) > 2 * node->bounds.size.width * graphene_vec2_get_x (&self->scale) ||
gdk_texture_get_height (texture) > 2 * node->bounds.size.height * graphene_vec2_get_y (&self->scale)))
(gdk_texture_get_width (texture) > 2 * node->bounds.size.width * gsk_scale_get_x (self->scale) ||
gdk_texture_get_height (texture) > 2 * node->bounds.size.height * gsk_scale_get_y (self->scale)))
{
image = gsk_gpu_node_processor_ensure_image (self->frame,
image,
@@ -2045,18 +1941,18 @@ gsk_gpu_node_processor_add_texture_scale_node (GskGpuNodeProcessor *self,
guint32 descriptor;
gboolean need_mipmap, need_offscreen;
need_offscreen = self->modelview != NULL ||
!graphene_vec2_equal (&self->scale, graphene_vec2_one ());
need_offscreen = self->modelview != NULL || !gsk_scale_is_one (self->scale);
if (need_offscreen)
{
GskGpuImage *offscreen;
graphene_rect_t clip_bounds;
GskScale one = gsk_scale_init (1, 1);
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clip_bounds))
return;
gsk_rect_round_larger (&clip_bounds);
clip_bounds = gsk_rect_round_larger (clip_bounds);
offscreen = gsk_gpu_render_pass_op_offscreen (self->frame,
graphene_vec2_one (),
&one,
&clip_bounds,
node);
descriptor = gsk_gpu_node_processor_add_image (self, offscreen, GSK_GPU_SAMPLER_DEFAULT);
@@ -2252,7 +2148,8 @@ gsk_gpu_node_processor_add_gradient_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &bounds))
return;
rect_round_to_pixels (&bounds, &self->scale, &self->offset, &bounds);
bounds = gsk_rect_round_to_pixels (bounds, self->scale, self->offset);
image = gsk_gpu_node_processor_init_draw (&other,
self->frame,
@@ -2547,8 +2444,7 @@ gsk_gpu_node_processor_add_shadow_node (GskGpuNodeProcessor *self,
const GskShadow *shadow = gsk_shadow_node_get_shadow (node, i);
if (shadow->radius == 0)
{
graphene_point_t shadow_offset = GRAPHENE_POINT_INIT (self->offset.x + shadow->dx,
self->offset.y + shadow->dy);
GskPoint shadow_offset = gsk_point_add (self->offset, gsk_point_init (shadow->dx, shadow->dy));
gsk_gpu_colorize_op (self->frame,
gsk_gpu_clip_get_shader_clip (&self->clip, &shadow_offset, &child->bounds),
desc,
@@ -2974,9 +2870,9 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
GskGpuDevice *device;
const PangoGlyphInfo *glyphs;
PangoFont *font;
graphene_point_t offset;
GskPoint offset;
guint i, num_glyphs;
float scale, inv_scale;
GskScale scale, inv;
GdkRGBA color;
if (self->opacity < 1.0 &&
@@ -2992,18 +2888,17 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
num_glyphs = gsk_text_node_get_num_glyphs (node);
glyphs = gsk_text_node_get_glyphs (node, NULL);
font = gsk_text_node_get_font (node);
offset = *gsk_text_node_get_offset (node);
offset.x += self->offset.x;
offset.y += self->offset.y;
offset = gsk_point_add (gsk_point_init_from_graphene (gsk_text_node_get_offset (node)), self->offset);
scale = MAX (graphene_vec2_get_x (&self->scale), graphene_vec2_get_y (&self->scale));
inv_scale = 1.f / scale;
scale = gsk_scale_max (self->scale);
inv = gsk_scale_invert (scale);
for (i = 0; i < num_glyphs; i++)
{
GskGpuImage *image;
graphene_rect_t glyph_bounds, glyph_tex_rect;
graphene_point_t glyph_offset;
GskPoint g_offset;
guint32 descriptor;
image = gsk_gpu_device_lookup_glyph_image (device,
@@ -3011,34 +2906,36 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
font,
glyphs[i].glyph,
0,
scale,
gsk_scale_get_x (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);
glyph_tex_rect = 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);
glyph_bounds = gsk_rect_scale (GRAPHENE_RECT_INIT (0, 0, glyph_bounds.size.width, glyph_bounds.size.height), inv);
g_offset = gsk_point_add (gsk_point_add (offset, gsk_point_divide (gsk_point_init_from_graphene (&glyph_offset), scale)),
gsk_point_init (glyphs[i].geometry.x_offset/(float)PANGO_SCALE,
glyphs[i].geometry.y_offset/(float)PANGO_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,
gsk_gpu_clip_get_shader_clip (&self->clip, &glyph_offset, &glyph_bounds),
gsk_gpu_clip_get_shader_clip (&self->clip, &g_offset, &glyph_bounds),
self->desc,
descriptor,
&glyph_bounds,
&glyph_offset,
&g_offset,
&glyph_tex_rect);
else
gsk_gpu_colorize_op (self->frame,
gsk_gpu_clip_get_shader_clip (&self->clip, &glyph_offset, &glyph_bounds),
gsk_gpu_clip_get_shader_clip (&self->clip, &g_offset, &glyph_bounds),
self->desc,
descriptor,
&glyph_bounds,
&glyph_offset,
&g_offset,
&glyph_tex_rect,
&color);
offset.x += (float) glyphs[i].geometry.width / PANGO_SCALE;
offset = gsk_point_add (offset, gsk_point_init ((float) glyphs[i].geometry.width / PANGO_SCALE, 0));
}
}
@@ -3051,10 +2948,10 @@ gsk_gpu_node_processor_create_glyph_pattern (GskGpuPatternWriter *self,
PangoFont *font;
guint num_glyphs;
gsize i;
float scale, inv_scale;
GskScale scale, inv;
guint32 tex_id;
GskGpuImage *last_image;
graphene_point_t offset;
GskPoint offset;
if (gsk_text_node_has_color_glyphs (node))
return FALSE;
@@ -3063,12 +2960,10 @@ gsk_gpu_node_processor_create_glyph_pattern (GskGpuPatternWriter *self,
num_glyphs = gsk_text_node_get_num_glyphs (node);
glyphs = gsk_text_node_get_glyphs (node, NULL);
font = gsk_text_node_get_font (node);
offset = *gsk_text_node_get_offset (node);
offset.x += self->offset.x;
offset.y += self->offset.y;
offset = gsk_point_add (gsk_point_init_from_graphene (gsk_text_node_get_offset (node)), self->offset);
scale = MAX (graphene_vec2_get_x (&self->scale), graphene_vec2_get_y (&self->scale));
inv_scale = 1.f / scale;
scale = gsk_scale_max (self->scale);
inv = gsk_scale_invert (scale);
gsk_gpu_pattern_writer_append_uint (self, GSK_GPU_PATTERN_GLYPHS);
gsk_gpu_pattern_writer_append_rgba (self, gsk_text_node_get_color (node));
@@ -3080,13 +2975,15 @@ gsk_gpu_node_processor_create_glyph_pattern (GskGpuPatternWriter *self,
GskGpuImage *image;
graphene_rect_t glyph_bounds;
graphene_point_t glyph_offset;
GskPoint g_offset;
graphene_rect_t rect;
image = gsk_gpu_device_lookup_glyph_image (device,
self->frame,
font,
glyphs[i].glyph,
0,
scale,
gsk_scale_get_x (scale),
&glyph_bounds,
&glyph_offset);
@@ -3098,28 +2995,22 @@ gsk_gpu_node_processor_create_glyph_pattern (GskGpuPatternWriter *self,
last_image = image;
}
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);
g_offset = gsk_point_add (gsk_point_add (offset, gsk_point_divide (gsk_point_init_from_graphene (&glyph_offset), scale)),
gsk_point_init (glyphs[i].geometry.x_offset / (float)PANGO_SCALE,
glyphs[i].geometry.y_offset / (float)PANGO_SCALE));
gsk_gpu_pattern_writer_append_uint (self, tex_id);
gsk_gpu_pattern_writer_append_rect (self,
&GRAPHENE_RECT_INIT (
0,
0,
glyph_bounds.size.width * inv_scale,
glyph_bounds.size.height * inv_scale
),
&glyph_offset);
gsk_gpu_pattern_writer_append_rect (self,
&GRAPHENE_RECT_INIT (
- glyph_bounds.origin.x * inv_scale,
- glyph_bounds.origin.y * inv_scale,
gsk_gpu_image_get_width (image) * inv_scale,
gsk_gpu_image_get_height (image) * inv_scale
),
&glyph_offset);
rect = gsk_rect_scale (GRAPHENE_RECT_INIT (0, 0, glyph_bounds.size.width, glyph_bounds.size.height),
inv);
gsk_gpu_pattern_writer_append_rect (self, &rect, &g_offset);
rect = 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);
gsk_gpu_pattern_writer_append_rect (self, &rect, &g_offset);
offset.x += (float) glyphs[i].geometry.width / PANGO_SCALE;
offset = gsk_point_add (offset, gsk_point_init ((float) glyphs[i].geometry.width / PANGO_SCALE, 0));
}
return TRUE;
@@ -3219,10 +3110,10 @@ gsk_gpu_node_processor_repeat_tile (GskGpuNodeProcessor *self,
graphene_rect_t clipped_child_bounds, offset_rect;
guint32 descriptor;
gsk_rect_init_offset (&offset_rect,
rect,
- x * child_bounds->size.width,
- y * child_bounds->size.height);
offset_rect = gsk_rect_init_offset (*rect,
gsk_point_multiply (gsk_point_init (child_bounds->size.width, child_bounds->size.height),
gsk_scale_init (-x, -y)));
if (!gsk_rect_intersection (&offset_rect, child_bounds, &clipped_child_bounds))
{
/* The math has gone wrong probably, someone should look at this. */
@@ -3351,23 +3242,21 @@ gsk_gpu_node_processor_add_repeat_node (GskGpuNodeProcessor *self,
else
{
/* repeat in both directions */
graphene_point_t old_offset, offset;
GskPoint old_offset, offset;
graphene_rect_t clip_bounds;
float x, y;
float x, y, offset_x, offset_y;
old_offset = self->offset;
for (x = floorf (tile_left); x < ceilf (tile_right); x++)
{
offset.x = x * child_bounds->size.width;
offset_x = x * child_bounds->size.width;
for (y = floorf (tile_top); y < ceilf (tile_bottom); y++)
{
offset.y = y * child_bounds->size.height;
self->offset = GRAPHENE_POINT_INIT (old_offset.x + offset.x, old_offset.y + offset.y);
clip_bounds = GRAPHENE_RECT_INIT (bounds.origin.x - offset.x,
bounds.origin.y - offset.y,
bounds.size.width,
bounds.size.height);
offset_y = y * child_bounds->size.height;
offset = gsk_point_init (offset_x, offset_y);
self->offset = gsk_point_add (old_offset, offset);
clip_bounds = gsk_rect_subtract_offset (bounds, offset);
if (!gsk_rect_intersection (&clip_bounds, child_bounds, &clip_bounds))
continue;
gsk_gpu_node_processor_add_node_clipped (self,
@@ -3408,10 +3297,7 @@ gsk_gpu_node_processor_create_repeat_pattern (GskGpuPatternWriter *self,
gsk_gpu_pattern_writer_append_rect (self, child_bounds, &self->offset);
old_bounds = self->bounds;
self->bounds = GRAPHENE_RECT_INIT (child_bounds->origin.x + self->offset.x,
child_bounds->origin.y + self->offset.y,
child_bounds->size.width,
child_bounds->size.height);
self->bounds = gsk_rect_add_offset (*child_bounds, self->offset);
if (!gsk_gpu_node_processor_create_node_pattern (self, child))
{
@@ -3483,7 +3369,8 @@ gsk_gpu_node_processor_add_fill_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clip_bounds))
return;
rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds);
clip_bounds = gsk_rect_round_to_pixels (clip_bounds, self->scale, self->offset);
child = gsk_fill_node_get_child (node);
@@ -3580,7 +3467,8 @@ gsk_gpu_node_processor_add_stroke_node (GskGpuNodeProcessor *self,
if (!gsk_gpu_node_processor_clip_node_bounds (self, node, &clip_bounds))
return;
rect_round_to_pixels (&clip_bounds, &self->scale, &self->offset, &clip_bounds);
clip_bounds = gsk_rect_round_to_pixels (clip_bounds, self->scale, self->offset);
child = gsk_stroke_node_get_child (node);
@@ -3654,15 +3542,9 @@ gsk_gpu_node_processor_add_subsurface_node (GskGpuNodeProcessor *self,
if (!gdk_subsurface_is_above_parent (subsurface))
{
cairo_rectangle_int_t int_rect;
graphene_rect_t r = gsk_rect_add_offset (node->bounds, self->offset);
if (!gsk_gpu_node_processor_rect_is_integer (self,
&GRAPHENE_RECT_INIT (
node->bounds.origin.x + self->offset.x,
node->bounds.origin.y + self->offset.y,
node->bounds.size.width,
node->bounds.size.height
),
&int_rect))
if (!gsk_gpu_node_processor_rect_is_integer (self, &r, &int_rect))
{
g_warning ("FIXME: non-integer aligned subsurface?!");
}
@@ -3916,6 +3798,7 @@ gsk_gpu_node_processor_add_node (GskGpuNodeProcessor *self,
* 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;
@@ -3979,15 +3862,9 @@ gsk_gpu_node_processor_create_node_pattern (GskGpuPatternWriter *self,
gsk_gpu_descriptors_set_size (self->desc, images_before, buffers_before);
}
rect_round_to_pixels (&GRAPHENE_RECT_INIT (
self->bounds.origin.x - self->offset.x,
self->bounds.origin.y - self->offset.y,
self->bounds.size.width,
self->bounds.size.height
),
&self->scale,
&self->offset,
&bounds);
bounds = gsk_rect_round_to_pixels (gsk_rect_subtract_offset (self->bounds, self->offset),
self->scale,
self->offset);
image = gsk_gpu_get_node_as_image (self->frame,
&bounds,
&self->scale,
+3 -2
View File
@@ -66,11 +66,12 @@ gsk_gpu_radial_gradient_op (GskGpuFrame *frame,
const graphene_point_t *radius,
float start,
float end,
const graphene_point_t *offset,
const GskPoint *offset,
const GskColorStop *stops,
gsize n_stops)
{
GskGpuRadialgradientInstance *instance;
GskPoint zero = gsk_point_init (0, 0);
g_assert (n_stops > 1);
g_assert (n_stops <= 7);
@@ -85,7 +86,7 @@ gsk_gpu_radial_gradient_op (GskGpuFrame *frame,
gsk_gpu_rect_to_float (rect, offset, instance->rect);
gsk_gpu_point_to_float (center, offset, instance->center_radius);
gsk_gpu_point_to_float (radius, graphene_point_zero(), &instance->center_radius[2]);
gsk_gpu_point_to_float (radius, &zero, &instance->center_radius[2]);
instance->startend[0] = start;
instance->startend[1] = end;
gsk_gpu_rgba_to_float (&stops[MIN (n_stops - 1, 6)].color, instance->color6);
+1 -1
View File
@@ -16,7 +16,7 @@ void gsk_gpu_radial_gradient_op (GskGpuF
const graphene_point_t *radius,
float start,
float end,
const graphene_point_t *offset,
const GskPoint *offset,
const GskColorStop *stops,
gsize n_stops);
+6 -6
View File
@@ -335,16 +335,16 @@ gsk_gpu_render_pass_end_op (GskGpuFrame *frame,
}
GskGpuImage *
gsk_gpu_render_pass_op_offscreen (GskGpuFrame *frame,
const graphene_vec2_t *scale,
const graphene_rect_t *viewport,
GskRenderNode *node)
gsk_gpu_render_pass_op_offscreen (GskGpuFrame *frame,
const GskScale *scale,
const graphene_rect_t *viewport,
GskRenderNode *node)
{
GskGpuImage *image;
int width, height;
width = ceil (graphene_vec2_get_x (scale) * viewport->size.width);
height = ceil (graphene_vec2_get_y (scale) * viewport->size.height);
width = ceil (gsk_scale_get_x (*scale) * viewport->size.width);
height = ceil (gsk_scale_get_y (*scale) * viewport->size.height);
image = gsk_gpu_device_create_offscreen_image (gsk_gpu_frame_get_device (frame),
FALSE,
+3 -1
View File
@@ -6,6 +6,8 @@
#include <graphene.h>
#include "gsk/gskscaleprivate.h"
G_BEGIN_DECLS
/* We only need this for the final VkImageLayout, but don't tell anyone */
@@ -24,7 +26,7 @@ void gsk_gpu_render_pass_end_op (GskGpuF
GskRenderPassType pass_type);
GskGpuImage * gsk_gpu_render_pass_op_offscreen (GskGpuFrame *frame,
const graphene_vec2_t *scale,
const GskScale *scale,
const graphene_rect_t *viewport,
GskRenderNode *node);
+2 -2
View File
@@ -57,7 +57,7 @@ void
gsk_gpu_rounded_color_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const GskRoundedRect *outline,
const graphene_point_t *offset,
const GskPoint *offset,
const GdkRGBA *color)
{
GskGpuRoundedcolorInstance *instance;
@@ -69,7 +69,7 @@ gsk_gpu_rounded_color_op (GskGpuFrame *frame,
NULL,
&instance);
gsk_rounded_rect_to_float (outline, offset, instance->outline);
gsk_gpu_rounded_rect_to_float (outline, offset, instance->outline);
gsk_gpu_rgba_to_float (color, instance->color);
}
+1 -1
View File
@@ -10,7 +10,7 @@ G_BEGIN_DECLS
void gsk_gpu_rounded_color_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const GskRoundedRect *outline,
const graphene_point_t *offset,
const GskPoint *offset,
const GdkRGBA *color);
+4 -3
View File
@@ -3,6 +3,7 @@
#include "gskgpuopprivate.h"
#include "gskgputypesprivate.h"
#include "gskpointprivate.h"
G_BEGIN_DECLS
@@ -69,11 +70,11 @@ gsk_gpu_rgba_to_float (const GdkRGBA *rgba,
static inline void
gsk_gpu_point_to_float (const graphene_point_t *point,
const graphene_point_t *offset,
const GskPoint *offset,
float values[2])
{
values[0] = point->x + offset->x;
values[1] = point->y + offset->y;
values[0] = point->x + gsk_point_get_x (*offset);
values[1] = point->y + gsk_point_get_y (*offset);
}
G_END_DECLS
+1 -1
View File
@@ -62,7 +62,7 @@ gsk_gpu_straight_alpha_op (GskGpuFrame *frame,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect)
{
GskGpuStraightalphaInstance *instance;
+1 -1
View File
@@ -12,7 +12,7 @@ void gsk_gpu_straight_alpha_op (GskGpuF
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect);
+1 -1
View File
@@ -58,7 +58,7 @@ gsk_gpu_texture_op (GskGpuFrame *frame,
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect)
{
GskGpuTextureInstance *instance;
+1 -1
View File
@@ -11,7 +11,7 @@ void gsk_gpu_texture_op (GskGpuF
GskGpuDescriptors *desc,
guint32 descriptor,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
const graphene_rect_t *tex_rect);
+1
View File
@@ -2,6 +2,7 @@
#include <gdk/gdk.h>
#include "gsk/gskenums.h"
#include "gsk/gsktypes.h"
#include "gdk/gdkmemoryformatprivate.h"
+1 -1
View File
@@ -56,7 +56,7 @@ void
gsk_gpu_uber_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
GskGpuDescriptors *desc,
guint32 pattern_id)
{
+1 -1
View File
@@ -9,7 +9,7 @@ G_BEGIN_DECLS
void gsk_gpu_uber_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
GskGpuDescriptors *desc,
guint32 pattern_id);
+8 -8
View File
@@ -451,12 +451,12 @@ static const GskGpuOpClass GSK_GPU_UPLOAD_CAIRO_OP_CLASS = {
};
GskGpuImage *
gsk_gpu_upload_cairo_op (GskGpuFrame *frame,
const graphene_vec2_t *scale,
const graphene_rect_t *viewport,
GskGpuCairoFunc func,
gpointer user_data,
GDestroyNotify user_destroy)
gsk_gpu_upload_cairo_op (GskGpuFrame *frame,
const GskScale *scale,
const graphene_rect_t *viewport,
GskGpuCairoFunc func,
gpointer user_data,
GDestroyNotify user_destroy)
{
GskGpuUploadCairoOp *self;
@@ -465,8 +465,8 @@ gsk_gpu_upload_cairo_op (GskGpuFrame *frame,
self->image = gsk_gpu_device_create_upload_image (gsk_gpu_frame_get_device (frame),
FALSE,
GDK_MEMORY_DEFAULT,
ceil (graphene_vec2_get_x (scale) * viewport->size.width),
ceil (graphene_vec2_get_y (scale) * viewport->size.height));
ceil (gsk_scale_get_x (*scale) * viewport->size.width),
ceil (gsk_scale_get_y (*scale) * viewport->size.height));
self->viewport = *viewport;
self->func = func;
self->user_data = user_data;
+2 -1
View File
@@ -3,6 +3,7 @@
#include "gskgpuopprivate.h"
#include "gsktypes.h"
#include "gsk/gskscaleprivate.h"
G_BEGIN_DECLS
@@ -14,7 +15,7 @@ GskGpuImage * gsk_gpu_upload_texture_op_try (GskGpuF
GdkTexture *texture);
GskGpuImage * gsk_gpu_upload_cairo_op (GskGpuFrame *frame,
const graphene_vec2_t *scale,
const GskScale *scale,
const graphene_rect_t *viewport,
GskGpuCairoFunc func,
gpointer user_data,
+148 -11
View File
@@ -1,20 +1,157 @@
#pragma once
#include "gsktypes.h"
#include <graphene.h>
#include <math.h>
#include <smmintrin.h>
static inline void G_GNUC_PURE
gsk_point_interpolate (const graphene_point_t *p1,
const graphene_point_t *p2,
float t,
graphene_point_t *p)
#include "gskscaleprivate.h"
struct _GskPoint
{
p->x = p1->x * (1 - t) + p2->x * t;
p->Y = p1->y * (1 - t) + p2->y * t;
GRAPHENE_ALIGNED_DECL (graphene_simd4f_t v, 16);
};
static inline float
gsk_point_get_x (const GskPoint p)
{
return graphene_simd4f_get_x (p.v);
}
static inline float G_GNUC_PURE
gsk_point_distance (const graphene_point_t *p1,
const graphene_point_t *p2)
static inline float
gsk_point_get_y (const GskPoint p)
{
return sqrtf ((p1->x - p2->x)*(p1->x - p2->x) + (p1->y - p2->y)*(p1->y - p2->y));
return graphene_simd4f_get_y (p.v);
}
static inline GskPoint
gsk_point_init (float x,
float y)
{
GskPoint p;
p.v = graphene_simd4f_init (x, y, 0.f, 0.f);
return p;
}
static inline GskPoint
gsk_point_init_from_graphene (const graphene_point_t *p)
{
return gsk_point_init (p->x, p->y);
}
static inline void
gsk_point_to_float (const GskPoint *p,
float v[2])
{
graphene_simd4f_dup_2f (p->v, v);
}
static inline gboolean
gsk_point_is_zero (const GskPoint p)
{
return gsk_point_get_x (p) == 0 && gsk_point_get_y (p) == 0;
}
static inline GskPoint
gsk_point_negate (const GskPoint p)
{
GskPoint neg;
neg.v = graphene_simd4f_neg (p.v);
return neg;
}
static inline GskPoint
gsk_point_multiply (const GskPoint p,
const GskScale s)
{
GskPoint q;
q.v = graphene_simd4f_mul (p.v, s.v);
return q;
}
static inline GskPoint
gsk_point_divide (const GskPoint p,
const GskScale s)
{
GskPoint q;
q.v = graphene_simd4f_div (p.v, s.v);
return q;
}
static inline GskPoint
gsk_point_add (const GskPoint p1,
const GskPoint p2)
{
GskPoint p;
p.v = graphene_simd4f_add (p1.v, p2.v);
return p;
}
static inline GskPoint
gsk_point_subtract (const GskPoint p1,
const GskPoint p2)
{
GskPoint p;
p.v = graphene_simd4f_sub (p1.v, p2.v);
return p;
}
#ifdef HAVE_SSE4
# define graphene_simd4f_floor(v) \
(__extension__ ({ \
(graphene_simd4f_t) _mm_floor_ps ((v)); \
}))
# define graphene_simd4f_ceil(v) \
(__extension__ ({ \
(graphene_simd4f_t) _mm_ceil_ps ((v)); \
}))
static inline GskPoint
gsk_point_floor (const GskPoint p)
{
GskPoint q;
q.v = graphene_simd4f_floor (p.v);
return q;
}
static inline GskPoint
gsk_point_ceil (const GskPoint p)
{
GskPoint q;
q.v = graphene_simd4f_ceil (p.v);
return q;
}
#else
static inline GskPoint
gsk_point_floor (const GskPoint p)
{
return gsk_point_init (floorf (gsk_point_get_x (p)), floorf (gsk_point_get_y (p)));
}
static inline GskPoint
gsk_point_ceil (const GskPoint p)
{
return gsk_point_init (ceilf (gsk_point_get_x (p)), ceilf (gsk_point_get_y (p)));
}
#endif
+96 -16
View File
@@ -2,6 +2,9 @@
#include <graphene.h>
#include <math.h>
#include "gskscaleprivate.h"
#include "gskpointprivate.h"
static inline void
gsk_rect_init (graphene_rect_t *r,
@@ -23,13 +26,14 @@ gsk_rect_init_from_rect (graphene_rect_t *r,
gsk_rect_init (r, r1->origin.x, r1->origin.y, r1->size.width, r1->size.height);
}
static inline void
gsk_rect_init_offset (graphene_rect_t *r,
const graphene_rect_t *src,
float dx,
float dy)
static inline graphene_rect_t
gsk_rect_init_offset (const graphene_rect_t src,
const GskPoint offset)
{
gsk_rect_init (r, src->origin.x + dx, src->origin.y + dy, src->size.width, src->size.height);
return GRAPHENE_RECT_INIT (src.origin.x + gsk_point_get_x (offset),
src.origin.y + gsk_point_get_y (offset),
src.size.width,
src.size.height);
}
static inline gboolean G_GNUC_PURE
@@ -113,22 +117,98 @@ gsk_rect_equal (const graphene_rect_t *r1,
static inline void
gsk_gpu_rect_to_float (const graphene_rect_t *rect,
const graphene_point_t *offset,
const GskPoint *offset,
float values[4])
{
values[0] = rect->origin.x + offset->x;
values[1] = rect->origin.y + offset->y;
values[0] = rect->origin.x + gsk_point_get_x (*offset);
values[1] = rect->origin.y + gsk_point_get_y (*offset);
values[2] = rect->size.width;
values[3] = rect->size.height;
}
static inline void
gsk_rect_round_larger (graphene_rect_t *rect)
static inline graphene_rect_t
gsk_rect_round_larger (const graphene_rect_t rect)
{
float x = floor (rect->origin.x);
float y = floor (rect->origin.y);
*rect = GRAPHENE_RECT_INIT (x, y,
ceil (rect->origin.x + rect->size.width) - x,
ceil (rect->origin.y + rect->size.height) - y);
float x = floorf (rect.origin.x);
float y = floorf (rect.origin.y);
return GRAPHENE_RECT_INIT (x, y,
ceilf (rect.origin.x + rect.size.width) - x,
ceilf (rect.origin.y + rect.size.height) - y);
}
static inline graphene_rect_t
gsk_rect_scale (const graphene_rect_t r,
const GskScale scale)
{
float sx = gsk_scale_get_x (scale);
float sy = gsk_scale_get_y (scale);
if (G_UNLIKELY (sx < 0 || sy < 0))
{
graphene_rect_t res;
graphene_rect_scale (&r, sx, sy, &res);
return res;
}
return GRAPHENE_RECT_INIT (r.origin.x * sx,
r.origin.y * sy,
r.size.width * sx,
r.size.height * sy);
}
static inline graphene_rect_t
gsk_rect_add_offset (const graphene_rect_t r,
const GskPoint offset)
{
return GRAPHENE_RECT_INIT (r.origin.x + gsk_point_get_x (offset),
r.origin.y + gsk_point_get_y (offset),
r.size.width,
r.size.height);
}
static inline graphene_rect_t
gsk_rect_subtract_offset (const graphene_rect_t r,
const GskPoint offset)
{
return GRAPHENE_RECT_INIT (r.origin.x - gsk_point_get_x (offset),
r.origin.y - gsk_point_get_y (offset),
r.size.width,
r.size.height);
}
static inline graphene_rect_t
gsk_rect_from_points (GskPoint p0,
GskPoint p1)
{
return GRAPHENE_RECT_INIT (gsk_point_get_x (p0),
gsk_point_get_y (p0),
gsk_point_get_x (p1) - gsk_point_get_x (p0),
gsk_point_get_y (p1) - gsk_point_get_y (p0));
}
static inline GskPoint
gsk_rect_get_origin (const graphene_rect_t rect)
{
return gsk_point_init (rect.origin.x, rect.origin.y);
}
static inline GskPoint
gsk_rect_get_opposite (const graphene_rect_t rect)
{
return gsk_point_init (rect.origin.x + rect.size.width, rect.origin.y + rect.size.height);
}
static inline graphene_rect_t
gsk_rect_round_to_pixels (const graphene_rect_t src,
const GskScale scale,
const GskPoint offset)
{
GskPoint p0, p1;
p0 = gsk_point_subtract (gsk_point_divide (gsk_point_floor (gsk_point_multiply (gsk_point_add (gsk_rect_get_origin (src), offset), scale)), scale), offset);
p1 = gsk_point_divide (gsk_point_subtract (gsk_point_ceil (gsk_point_multiply (gsk_point_add (gsk_rect_get_opposite (src), offset), scale)), p0), scale);
return gsk_rect_from_points (p0, p1);
}
+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++)
{
+16
View File
@@ -1,6 +1,7 @@
#pragma once
#include "gskroundedrect.h"
#include "gskrectprivate.h"
#include <cairo.h>
@@ -48,6 +49,21 @@ void gsk_rounded_rect_path (const GskRounde
void gsk_rounded_rect_to_float (const GskRoundedRect *self,
const graphene_point_t *offset,
float rect[12]);
static inline void
gsk_gpu_rounded_rect_to_float (const GskRoundedRect *self,
const GskPoint *offset,
float rect[12])
{
guint i;
gsk_gpu_rect_to_float (&self->bounds, offset, rect);
for (i = 0; i < 4; i++)
{
rect[4 + i] = self->corner[i].width;
rect[8 + i] = self->corner[i].height;
}
}
gboolean gsk_rounded_rect_equal (gconstpointer rect1,
gconstpointer rect2) G_GNUC_PURE;
+59
View File
@@ -0,0 +1,59 @@
#include "config.h"
#include "gskscaleprivate.h"
#include "gsktransform.h"
GskScale
gsk_scale_extract_from_transform (GskTransform *transform)
{
switch (gsk_transform_get_category (transform))
{
default:
g_assert_not_reached ();
G_GNUC_FALLTHROUGH;
case GSK_TRANSFORM_CATEGORY_IDENTITY:
case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
return gsk_scale_init (1, 1);
case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
{
float scale_x, scale_y, dx, dy;
gsk_transform_to_affine (transform, &scale_x, &scale_y, &dx, &dy);
return gsk_scale_init (fabsf (scale_x), fabsf (scale_y));
}
case GSK_TRANSFORM_CATEGORY_2D:
{
float skew_x, skew_y, scale_x, scale_y, angle, dx, dy;
gsk_transform_to_2d_components (transform,
&skew_x, &skew_y,
&scale_x, &scale_y,
&angle,
&dx, &dy);
return gsk_scale_init (fabsf (scale_x), fabsf (scale_y));
}
case GSK_TRANSFORM_CATEGORY_UNKNOWN:
case GSK_TRANSFORM_CATEGORY_ANY:
case GSK_TRANSFORM_CATEGORY_3D:
{
graphene_quaternion_t rotation;
graphene_matrix_t matrix;
graphene_vec4_t perspective;
graphene_vec3_t translation;
graphene_vec3_t matrix_scale;
graphene_vec3_t shear;
gsk_transform_to_matrix (transform, &matrix);
graphene_matrix_decompose (&matrix,
&translation,
&matrix_scale,
&rotation,
&shear,
&perspective);
return gsk_scale_init (fabsf (graphene_vec3_get_x (&matrix_scale)),
fabsf (graphene_vec3_get_y (&matrix_scale)));
}
}
}
+108
View File
@@ -0,0 +1,108 @@
#pragma once
#include "gsktypes.h"
#include <graphene.h>
#include <math.h>
struct _GskScale
{
GRAPHENE_ALIGNED_DECL (graphene_simd4f_t v, 16);
};
static inline float
gsk_scale_get_x (const GskScale s)
{
return graphene_simd4f_get_x (s.v);
}
static inline float
gsk_scale_get_y (const GskScale s)
{
return graphene_simd4f_get_y (s.v);
}
static inline GskScale
gsk_scale_init (float x,
float y)
{
GskScale s;
s.v = graphene_simd4f_init (x, y, 0.f, 0.f);
return s;
}
static inline GskScale
gsk_scale_init_uniform (float x)
{
return gsk_scale_init (x, x);
}
static inline void
gsk_scale_to_float (const GskScale *s,
float v[2])
{
graphene_simd4f_dup_2f (s->v, v);
}
static inline gboolean
gsk_scale_is_one (const GskScale s)
{
return gsk_scale_get_x (s) == 1 && gsk_scale_get_y (s) == 1;
}
static inline gboolean
gsk_scale_is_uniform (const GskScale s)
{
return gsk_scale_get_x (s) == gsk_scale_get_y (s);
}
static inline GskScale
gsk_scale_invert (const GskScale s)
{
GskScale inv;
inv.v = graphene_simd4f_reciprocal (s.v);
return inv;
}
static inline GskScale
gsk_scale_multiply (const GskScale s1,
const GskScale s2)
{
GskScale s;
s.v = graphene_simd4f_mul (s1.v, s2.v);
return s;
}
static inline GskScale
gsk_scale_divide (const GskScale s1,
const GskScale s2)
{
GskScale s;
s.v = graphene_simd4f_div (s1.v, s2.v);
return s;
}
# define graphene_simd4f_shuffle_yxzw(v) \
(__extension__ ({ \
(graphene_simd4f_t) _mm_shuffle_ps ((v), (v), _MM_SHUFFLE (1, 0, 2, 3)); \
}))
static inline GskScale
gsk_scale_max (const GskScale s)
{
GskScale m;
m.v = graphene_simd4f_max (graphene_simd4f_shuffle_yxzw (s.v), s.v);
return m;
}
GskScale gsk_scale_extract_from_transform (GskTransform *transform);
+2 -1
View File
@@ -34,4 +34,5 @@ typedef struct _GskRenderNode GskRenderNode;
typedef struct _GskRoundedRect GskRoundedRect;
typedef struct _GskStroke GskStroke;
typedef struct _GskTransform GskTransform;
typedef struct _GskScale GskScale;
typedef struct _GskPoint GskPoint;
+1
View File
@@ -51,6 +51,7 @@ gsk_private_sources = files([
'gskdebug.c',
'gskprivate.c',
'gskprofiler.c',
'gskscale.c',
'gl/gskglattachmentstate.c',
'gl/gskglbuffer.c',
'gl/gskglcommandqueue.c',
+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);
-16
View File
@@ -1355,22 +1355,6 @@ gtk_at_context_get_text_accumulate (GtkATContext *self,
}
}
/* Step 2.G */
if (GTK_IS_LABEL (self->accessible))
{
const char *text = gtk_label_get_text (GTK_LABEL (self->accessible));
if (text && not_just_space (text))
append_with_space (res, text);
return;
}
else if (GTK_IS_INSCRIPTION (self->accessible))
{
const char *text = gtk_inscription_get_text (GTK_INSCRIPTION (self->accessible));
if (text && not_just_space (text))
append_with_space (res, text);
return;
}
/* Step 2.I */
if (GTK_IS_WIDGET (self->accessible))
{
+119 -20
View File
@@ -162,6 +162,45 @@
* ```
*/
typedef struct _WeakRefGuard WeakRefGuard;
struct _WeakRefGuard
{
gatomicrefcount ref_count;
gpointer data;
};
static WeakRefGuard *
weak_ref_guard_new (gpointer data)
{
WeakRefGuard *guard;
guard = g_new0 (WeakRefGuard, 1);
g_atomic_ref_count_init (&guard->ref_count);
guard->data = data;
return guard;
}
static WeakRefGuard *
weak_ref_guard_ref (WeakRefGuard *guard)
{
g_atomic_ref_count_inc (&guard->ref_count);
return guard;
}
static void
weak_ref_guard_unref (WeakRefGuard *guard)
{
/* Always clear data pointer after first unref so that it
* cannot be accessed unless both the expression/watch is
* valid _and_ the weak ref is still active.
*/
guard->data = NULL;
if (g_atomic_ref_count_dec (&guard->ref_count))
g_free (guard);
}
typedef struct _GtkExpressionClass GtkExpressionClass;
typedef struct _GtkExpressionSubWatch GtkExpressionSubWatch;
@@ -230,7 +269,8 @@ struct _GtkExpressionTypeInfo
struct _GtkExpressionWatch
{
GtkExpression *expression;
GObject *this;
WeakRefGuard *guard;
GWeakRef this_wr;
GDestroyNotify user_destroy;
GtkExpressionNotify notify;
gpointer user_data;
@@ -903,6 +943,7 @@ struct _GtkObjectExpression
{
GtkExpression parent;
WeakRefGuard *guard;
GWeakRef object_wr;
GSList *watches;
};
@@ -917,15 +958,22 @@ static void
gtk_object_expression_weak_ref_cb (gpointer data,
GObject *object)
{
GtkObjectExpression *self = (GtkObjectExpression *) data;
GSList *iter = self->watches;
WeakRefGuard *guard = data;
GtkObjectExpression *self = guard->data;
while (iter)
if (self != NULL)
{
GtkObjectExpressionWatch *owatch = iter->data;
iter = iter->next;
owatch->notify (owatch->user_data);
GSList *iter = self->watches;
while (iter)
{
GtkObjectExpressionWatch *owatch = iter->data;
iter = iter->next;
owatch->notify (owatch->user_data);
}
}
weak_ref_guard_unref (guard);
}
static void
@@ -938,10 +986,21 @@ gtk_object_expression_finalize (GtkExpression *expr)
if (object != NULL)
{
g_object_weak_unref (object, gtk_object_expression_weak_ref_cb, self);
g_object_weak_unref (object, gtk_object_expression_weak_ref_cb, self->guard);
weak_ref_guard_unref (self->guard);
g_object_unref (object);
}
else
{
/* @object has been disposed. Which means that either our
* gtk_object_expression_weak_ref_cb has been called or we
* can expect it to be called shortly after this. No need to
* call g_object_weak_unref() or unref the handle which will
* be unref'ed by that callback.
*/
}
g_clear_pointer (&self->guard, weak_ref_guard_unref);
g_weak_ref_clear (&self->object_wr);
g_assert (self->watches == NULL);
@@ -1041,10 +1100,14 @@ gtk_object_expression_new (GObject *object)
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
result = gtk_expression_alloc (GTK_TYPE_OBJECT_EXPRESSION, G_OBJECT_TYPE (object));
self = (GtkObjectExpression *) result;
self = (GtkObjectExpression *) result;
g_weak_ref_init (&self->object_wr, object);
g_object_weak_ref (object, gtk_object_expression_weak_ref_cb, self);
self->guard = weak_ref_guard_new (self);
g_object_weak_ref (object,
gtk_object_expression_weak_ref_cb,
weak_ref_guard_ref (self->guard));
return result;
}
@@ -1867,12 +1930,19 @@ static void
gtk_expression_watch_this_cb (gpointer data,
GObject *this)
{
GtkExpressionWatch *watch = data;
WeakRefGuard *guard = data;
GtkExpressionWatch *watch = guard->data;
watch->this = NULL;
if (watch != NULL)
{
g_weak_ref_set (&watch->this_wr, NULL);
watch->notify (watch->user_data);
gtk_expression_watch_unwatch (watch);
watch->notify (watch->user_data);
gtk_expression_watch_unwatch (watch);
}
weak_ref_guard_unref (guard);
}
static void
@@ -1926,9 +1996,12 @@ gtk_expression_watch (GtkExpression *self,
watch = g_atomic_rc_box_alloc0 (sizeof (GtkExpressionWatch) + gtk_expression_watch_size (self));
watch->expression = gtk_expression_ref (self);
watch->this = this_;
watch->guard = weak_ref_guard_new (watch);
g_weak_ref_init (&watch->this_wr, this_);
if (this_)
g_object_weak_ref (this_, gtk_expression_watch_this_cb, watch);
g_object_weak_ref (this_,
gtk_expression_watch_this_cb,
weak_ref_guard_ref (watch->guard));
watch->notify = notify;
watch->user_data = user_data;
watch->user_destroy = user_destroy;
@@ -1962,6 +2035,10 @@ gtk_expression_watch_finalize (gpointer data)
GtkExpressionWatch *watch G_GNUC_UNUSED = data;
g_assert (!gtk_expression_watch_is_watching (data));
weak_ref_guard_unref (watch->guard);
g_weak_ref_clear (&watch->this_wr);
}
/**
@@ -1991,17 +2068,27 @@ gtk_expression_watch_unref (GtkExpressionWatch *watch)
void
gtk_expression_watch_unwatch (GtkExpressionWatch *watch)
{
GObject *this;
if (!gtk_expression_watch_is_watching (watch))
return;
gtk_expression_subwatch_finish (watch->expression, (GtkExpressionSubWatch *) watch->sub);
if (watch->this)
g_object_weak_unref (watch->this, gtk_expression_watch_this_cb, watch);
this = g_weak_ref_get (&watch->this_wr);
if (this)
{
g_object_weak_unref (this, gtk_expression_watch_this_cb, watch->guard);
weak_ref_guard_unref (watch->guard);
g_weak_ref_set (&watch->this_wr, NULL);
}
if (watch->user_destroy)
watch->user_destroy (watch->user_data);
g_clear_object (&this);
g_clear_pointer (&watch->expression, gtk_expression_unref);
gtk_expression_watch_unref (watch);
@@ -2024,12 +2111,19 @@ gboolean
gtk_expression_watch_evaluate (GtkExpressionWatch *watch,
GValue *value)
{
GObject *this;
gboolean ret;
g_return_val_if_fail (watch != NULL, FALSE);
if (!gtk_expression_watch_is_watching (watch))
return FALSE;
return gtk_expression_evaluate (watch->expression, watch->this, value);
this = g_weak_ref_get (&watch->this_wr);
ret = gtk_expression_evaluate (watch->expression, this, value);
g_clear_object (&this);
return ret;
}
typedef struct {
@@ -2086,6 +2180,8 @@ gtk_expression_bind_free (gpointer data)
GtkExpressionBind *bind = data;
GObject *target = g_weak_ref_get (&bind->target_wr);
g_weak_ref_set (&bind->target_wr, NULL);
if (target)
{
GSList *binds;
@@ -2124,7 +2220,10 @@ gtk_expression_bind_notify (gpointer data)
return;
if (!gtk_expression_watch_evaluate (bind->watch, &value))
return;
{
g_object_unref (target);
return;
}
g_object_set_property (target, bind->pspec->name, &value);
g_object_unref (target);
+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,
+5
View File
@@ -805,6 +805,11 @@ gtk_inscription_set_text (GtkInscription *self,
gtk_widget_queue_draw (GTK_WIDGET (self));
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TEXT]);
gtk_accessible_update_property (GTK_ACCESSIBLE (self),
GTK_ACCESSIBLE_PROPERTY_LABEL,
text,
-1);
}
/**
+5
View File
@@ -3086,6 +3086,11 @@ gtk_label_set_label_internal (GtkLabel *self,
g_object_notify_by_pspec (G_OBJECT (self), label_props[PROP_LABEL]);
gtk_accessible_update_property (GTK_ACCESSIBLE (self),
GTK_ACCESSIBLE_PROPERTY_LABEL,
self->label,
-1);
return TRUE;
}
+4 -3
View File
@@ -6991,9 +6991,10 @@ gtk_notebook_get_tab_detachable (GtkNotebook *notebook,
*
* If you want a widget to interact with a notebook through DnD
* (i.e.: accept dragged tabs from it) it must be set as a drop
* destination and accept the target GTK_NOTEBOOK_TAB. The notebook
* will fill the selection with a GtkWidget** pointing to the child
* widget that corresponds to the dropped tab.
* destination by adding to it a [class@Gtk.DropTarget] controller that accepts
* the GType `GTK_TYPE_NOTEBOOK_PAGE`. The `:value` of said drop target will be
* preloaded with a [class@Gtk.NotebookPage] object that corresponds to the
* dropped tab, so you can process the value via `::accept` or `::drop` signals.
*
* Note that you should use [method@Gtk.Notebook.detach_tab] instead
* of [method@Gtk.Notebook.remove_page] if you want to remove the tab
+12 -1
View File
@@ -38,6 +38,8 @@
#include "gdk/gdkdebugprivate.h"
#include "gdk/gdkdisplayprivate.h"
#include "profile_conf.h"
#include <epoxy/gl.h>
#ifdef GDK_WINDOWING_X11
@@ -193,7 +195,16 @@ init_version (GtkInspectorGeneral *gen)
g_object_unref (gsk_renderer);
gdk_surface_destroy (surface);
gtk_label_set_text (GTK_LABEL (gen->gtk_version), GTK_VERSION);
if (g_strcmp0 (PROFILE, "devel") == 0)
{
char *version = g_strdup_printf ("%s-%s", GTK_VERSION, VCS_TAG);
gtk_label_set_text (GTK_LABEL (gen->gtk_version), version);
g_free (version);
}
else
{
gtk_label_set_text (GTK_LABEL (gen->gtk_version), GTK_VERSION);
}
gtk_label_set_text (GTK_LABEL (gen->gdk_backend), backend);
gtk_label_set_text (GTK_LABEL (gen->gsk_renderer), renderer);
}
+3
View File
@@ -67,6 +67,7 @@ struct _GtkInspectorLogs
GtkWidget *shaders;
GtkWidget *surface;
GtkWidget *glyphcache;
GtkWidget *verbose;
GtkWidget *actions;
GtkWidget *builder;
@@ -147,6 +148,7 @@ flag_toggled (GtkWidget *button,
update_flag (logs->shaders, &flags, GSK_DEBUG_SHADERS);
update_flag (logs->surface, &flags, GSK_DEBUG_SURFACE);
update_flag (logs->glyphcache, &flags, GSK_DEBUG_GLYPH_CACHE);
update_flag (logs->verbose, &flags, GSK_DEBUG_VERBOSE);
gsk_set_debug_flags (flags);
toplevels = gtk_window_list_toplevels ();
@@ -210,6 +212,7 @@ gtk_inspector_logs_class_init (GtkInspectorLogsClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkInspectorLogs, shaders);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorLogs, surface);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorLogs, glyphcache);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorLogs, verbose);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorLogs, actions);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorLogs, builder);
+6
View File
@@ -158,6 +158,12 @@
<signal name="toggled" handler="flag_toggled"/>
</object>
</child>
<child>
<object class="GtkCheckButton" id="verbose">
<property name="label">Verbose</property>
<signal name="toggled" handler="flag_toggled"/>
</object>
</child>
</object>
</child>
<child>
+1
View File
@@ -1028,6 +1028,7 @@ gtk_deps = [
epoxy_dep,
libm,
graphene_dep,
profile_conf_h,
]
if x11_enabled
+21
View File
@@ -785,6 +785,27 @@ project_build_root = meson.current_build_dir()
gen_visibility_macros = find_program('build-aux/meson/gen-visibility-macros.py')
gen_profile_conf = find_program('build-aux/meson/gen-profile-conf.py')
profile = get_option('profile')
if profile == 'auto'
if gtk_minor_version.is_even()
profile = 'default'
else
profile = 'devel'
endif
endif
profile_conf_h = declare_dependency(
sources: custom_target('profile-conf',
command: [gen_profile_conf, meson.project_source_root(), profile],
capture: true,
output: 'profile_conf.h',
build_by_default: true,
build_always_stale: true,
)
)
subdir('gdk/version')
subdir('gtk/css')
subdir('gdk')
+6 -6
View File
@@ -124,15 +124,15 @@ option('man-pages',
option('demo-profile',
type: 'combo',
choices: [ 'default', 'devel' ],
value: 'default',
description : 'Profile to use for demos')
choices: [ 'auto', 'default', 'devel' ],
value: 'auto',
deprecated: 'profile')
option('profile',
type: 'combo',
choices: [ 'default', 'devel' ],
value: 'default',
deprecated: 'demo-profile')
choices: [ 'auto', 'default', 'devel' ],
value: 'auto',
description : 'Profile to use for demos')
option('build-demos',
type: 'boolean',
+155 -118
View File
@@ -6,14 +6,14 @@
# Mahyar Moghimi <mahyar.moqimi@gmail.com>, 2010.
# Ali Yousefi Sabzevar <aysabzevar@gmail.com>, 2010.
# Arash Mousavi <mousavi.arash@gmail.com>, 2011-2017.
# Danial Behzadi <dani.behzi@ubuntu.com>, 2018-2023.
# Danial Behzadi <dani.behzi@ubuntu.com>, 2018-2024.
#
msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.6\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2023-11-27 21:52+0000\n"
"PO-Revision-Date: 2023-11-28 12:17+0330\n"
"POT-Creation-Date: 2024-01-20 11:14+0000\n"
"PO-Revision-Date: 2024-01-20 14:52+0330\n"
"Last-Translator: Danial Behzadi <dani.behzi@ubuntu.com>\n"
"Language-Team: Persian <>\n"
"Language: fa\n"
@@ -23,7 +23,7 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-Bookmarks: 133,-1,-1,-1,-1,-1,-1,-1,-1,-1\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 3.4.1\n"
"X-Generator: Poedit 3.4.2\n"
#: gdk/broadway/gdkbroadway-server.c:135
#, c-format
@@ -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 "هیچ قالب سازگاری برای انتقال محتویات تخته‌گیره وجود ندارد."
@@ -53,57 +53,57 @@ msgstr "نمی‌توان محتوا را به شکل «%s» فراهم کرد"
msgid "Cannot provide contents as %s"
msgstr "نمی‌توان محتوا را به شکل %s فراهم کرد"
#: gdk/gdkdisplay.c:169 gdk/gdkglcontext.c:455
#: gdk/gdkdisplay.c:170 gdk/gdkglcontext.c:462
msgid "The current backend does not support OpenGL"
msgstr "پسانه در حال حاضر از OpenGL پشتیبانی نمی‌کند"
#: gdk/gdkdisplay.c:1268 gdk/gdksurface.c:1268 gdk/gdkvulkancontext.c:1479
#: gdk/gdkdisplay.c:1296 gdk/gdkvulkancontext.c:1581
msgid "Vulkan support disabled via GDK_DEBUG"
msgstr "پشتیبانی از ولکان به دست GDK_DEBUG از کار افتاده"
#: gdk/gdkdisplay.c:1300
#: gdk/gdkdisplay.c:1350
msgid "GL support disabled via GDK_DEBUG"
msgstr "پشتیبانی از GL به دست GDK_DEBUG از کار افتاده"
#: gdk/gdkdisplay.c:1596
#: gdk/gdkdisplay.c:1646
msgid "No EGL configuration available"
msgstr "هیچ پیکربندی‌ای برای EGL موجود نیست"
#: gdk/gdkdisplay.c:1604
#: gdk/gdkdisplay.c:1654
msgid "Failed to get EGL configurations"
msgstr "شکست در گرفتن پیکربندی EGL"
#: gdk/gdkdisplay.c:1634
#: gdk/gdkdisplay.c:1684
msgid "No EGL configuration with required features found"
msgstr "هیچ پیکربندی‌ای با ویژگی‌های موردنیاز برای EGL موجود نیست"
#: gdk/gdkdisplay.c:1641
#: gdk/gdkdisplay.c:1691
msgid "No perfect EGL configuration found"
msgstr "هیچ پیکربندی بی‌نظیری برایEGL موجود نیست"
#: gdk/gdkdisplay.c:1683
#: 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$Id افزونه کم دارد: %1$s"
#: gdk/gdkdisplay.c:1733
#: gdk/gdkdisplay.c:1783
msgid "libEGL not available in this sandbox"
msgstr "libEGL در این قرنطینه موجود نیست"
#: gdk/gdkdisplay.c:1734
#: gdk/gdkdisplay.c:1784
msgid "libEGL not available"
msgstr "libEGL موجود نیست"
#: gdk/gdkdisplay.c:1744
#: gdk/gdkdisplay.c:1794
msgid "Failed to create EGL display"
msgstr "شکست در ایجاد نمایشگر EGL"
#: gdk/gdkdisplay.c:1754
#: gdk/gdkdisplay.c:1804
msgid "Could not initialize EGL display"
msgstr "نتوانست نمایشگر EGL را راه‌اندازی کند"
#: gdk/gdkdisplay.c:1765
#: gdk/gdkdisplay.c:1815
#, c-format
msgid "EGL version %d.%d is too old. GTK requires %d.%d"
msgstr "EGL نگارش %Id. %Id بیش از حد قدیمی است. GTK به %Id.%Id نیاز دارد"
@@ -116,37 +116,37 @@ msgstr "کشیدن و رها کردن از دیگر برنامه‌ها پشتی
msgid "No compatible formats to transfer contents."
msgstr "هیچ قالب سازگاری برای انتقال محتویات وجود ندارد."
#: gdk/gdkglcontext.c:415 gdk/x11/gdkglcontext-glx.c:642
#: gdk/gdkglcontext.c:422 gdk/x11/gdkglcontext-glx.c:642
msgid "No GL API allowed."
msgstr "هیچ رابط برنامه‌نویسی GLای مجاز نیست."
#: gdk/gdkglcontext.c:438 gdk/win32/gdkglcontext-win32-wgl.c:385
#: gdk/win32/gdkglcontext-win32-wgl.c:528 gdk/win32/gdkglcontext-win32-wgl.c:572
#: gdk/gdkglcontext.c:445 gdk/win32/gdkglcontext-win32-wgl.c:381
#: gdk/win32/gdkglcontext-win32-wgl.c:524 gdk/win32/gdkglcontext-win32-wgl.c:568
#: gdk/x11/gdkglcontext-glx.c:688
msgid "Unable to create a GL context"
msgstr "امکان ساخت زمینه مناسب برای GL نبود"
#: gdk/gdkglcontext.c:1299
#: gdk/gdkglcontext.c:1306
msgid "OpenGL ES disabled via GDK_DEBUG"
msgstr "OpenGL ES به دست GDK_DEBUG از کار افتاد"
#: gdk/gdkglcontext.c:1311
#: gdk/gdkglcontext.c:1318
msgid "OpenGL disabled via GDK_DEBUG"
msgstr "OpenGL به دست GDK_DEBUG از کار افتاد"
#: gdk/gdkglcontext.c:1322
#: gdk/gdkglcontext.c:1329
#, c-format
msgid "Application does not support %s API"
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:1979
#: gdk/gdkglcontext.c:2124
#, c-format
msgid "Trying to use %s, but %s is already in use"
msgstr "تلاش شد از %s استفاده شود، ولی %s از پیش در حال استفاده است"
#: gdk/gdktexture.c:530
#: gdk/gdktexture.c:580
msgid "Unknown image format."
msgstr "قالب تصویر ناشناخته."
@@ -537,7 +537,7 @@ msgstr "خطا در تفسیر پروندهٔ JPEG (%s)"
msgid "Unsupported JPEG colorspace (%d)"
msgstr "فضای رنگ JPEG پشتیبانی نشده (%Id)"
#: 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 "حافظهٔ ناکافی برای اندازهٔ تصویر %Iu×%Iu"
@@ -547,16 +547,21 @@ msgstr "حافظهٔ ناکافی برای اندازهٔ تصویر %Iu×%Iu"
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 "عمق پشتیبانی‌نشدهٔ %Iu در تصویر png"
#: gdk/loaders/gdkpng.c:261
#: gdk/loaders/gdkpng.c:262
#, c-format
msgid "Unsupported color type %u in png image"
msgstr "گونهٔ رنگ پشتیبانی نشدهٔ %Iu در تصویر png"
#: gdk/loaders/gdkpng.c:272
#, c-format
msgid "Image stride too large for image size %ux%u"
msgstr "گام تصویر بیش از حد بزرگ برای اندازهٔ تصویر %Iu×%Iu"
#: gdk/loaders/gdktiff.c:358
msgid "Failed to load RGB data from TIFF file"
msgstr "نمی‌توان داده‌های RGB را از پروندهٔ TIFF بار کرد"
@@ -699,21 +704,21 @@ msgstr "IDataObject_GetData (0x%x) شکست خورد. 0x%lx را برگردان
msgid "Failed to transmute DnD data W32 format 0x%x to %p (%s)"
msgstr "شکست در تغییر شکل قالب W32 دادهٔ ک‌ور 0x%x به %p (%s)"
#: gdk/win32/gdkglcontext-win32-wgl.c:319
#: gdk/win32/gdkglcontext-win32-wgl.c:315
msgid "No GL implementation is available"
msgstr "هیچ پیاده سازی GLای پیدا نشد"
#: gdk/win32/gdkglcontext-win32-wgl.c:394
#: gdk/win32/gdkglcontext-win32-wgl.c:390
#, c-format
msgid "WGL version %d.%d is too low, need at least %d.%d"
msgstr "WGL نگارش %Id. %Id بیش از حد قدیمی است. کمینه به %Id.%Id نیاز است"
#: gdk/win32/gdkglcontext-win32-wgl.c:412
#: gdk/win32/gdkglcontext-win32-wgl.c:408
#, c-format
msgid "GL implementation cannot share GL contexts"
msgstr "پیاده‌سازی GL نمی‌تواند بافتارهای GL را هم‌رساند"
#: gdk/win32/gdkglcontext-win32-wgl.c:692
#: gdk/win32/gdkglcontext-win32-wgl.c:688
msgid "No available configurations for the given pixel format"
msgstr "هیچ پیکربندی برای قالب نقطه‌ای ارائه شده موجود نیست"
@@ -813,11 +818,16 @@ msgstr "قالب نامعتبر در تبدیل متن ترکیبی."
msgid "Unsupported encoding “%s”"
msgstr "رمزنگاری پشتیبانی‌نشدهٔ %s"
#: gsk/gl/gskglrenderer.c:135
#: gsk/gl/gskglrenderer.c:204
#, c-format
msgid "This GLES %d.%d implementation does not support half-float vertex data"
msgstr "این پشتیبانی EGL %Id.%Id از داده‌های رأس نیم‌شناور پیشتیبانی نمی‌کند"
#: gsk/gpu/gskgldevice.c:238
#, c-format
msgid "OpenGL ES 2.0 is not supported by this renderer."
msgstr "نگارش ۲٫۰ OpenGL ES به دست این پرداختگر پشتیبانی نمی‌شود."
#: gtk/a11y/gtkatspiaction.c:239
msgctxt "accessibility"
msgid "Click"
@@ -1014,7 +1024,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
@@ -1193,35 +1203,39 @@ msgstr "نگارش ۲٫۰ پروانهٔ آپاچی"
msgid "Mozilla Public License 2.0"
msgstr "پروانهٔ عمومی موزیلا ۲٫۰"
#: gtk/gtkaboutdialog.c:963
#: gtk/gtkaboutdialog.c:137
msgid "BSD Zero-Clause License"
msgstr "پروانهٔ بی‌بند BSD"
#: gtk/gtkaboutdialog.c:964
msgid "Website"
msgstr "پایگاه وب"
#: gtk/gtkaboutdialog.c:999 gtk/ui/gtkapplication-quartz.ui:6
#: gtk/gtkaboutdialog.c:1000 gtk/ui/gtkapplication-quartz.ui:6
#, c-format
msgid "About %s"
msgstr "دربارهٔ %s"
#: gtk/gtkaboutdialog.c:2089
#: gtk/gtkaboutdialog.c:2090
msgid "Created by"
msgstr "ایجاد شده به دست"
#: gtk/gtkaboutdialog.c:2092
#: gtk/gtkaboutdialog.c:2093
msgid "Documented by"
msgstr "مستند شده به دست"
#: gtk/gtkaboutdialog.c:2102
#: gtk/gtkaboutdialog.c:2103
msgid "Translated by"
msgstr "بازگردانی به دست"
#: gtk/gtkaboutdialog.c:2107
#: gtk/gtkaboutdialog.c:2108
msgid "Design by"
msgstr "طرّاحی به دست"
#. Translators: this is the license preamble; the string at the end
#. * contains the name of the license as link text.
#.
#: gtk/gtkaboutdialog.c:2272
#: gtk/gtkaboutdialog.c:2273
#, c-format
msgid ""
"This program comes with absolutely no warranty.\n"
@@ -1714,6 +1728,16 @@ msgctxt "accessibility"
msgid "block quote"
msgstr "نقل‌قول مستقیم"
#: gtk/gtkaccessible.c:837
msgctxt "accessibility"
msgid "article"
msgstr "حرف تعریف"
#: gtk/gtkaccessible.c:838
msgctxt "accessibility"
msgid "comment"
msgstr "نظر"
#: gtk/gtkalertdialog.c:668 gtk/print/gtkcustompaperunixdialog.c:322
#: gtk/gtkmessagedialog.c:166 gtk/ui/gtkassistant.ui:40
msgid "_Close"
@@ -1723,7 +1747,7 @@ msgstr "_بستن"
#. * suspend or screen locking, and the caller hasn't specified
#. * a reason.
#.
#: gtk/gtkapplication-dbus.c:721
#: gtk/gtkapplication-dbus.c:721 gtk/gtkapplication-dbus.c:763
msgid "Reason not specified"
msgstr "دلیل مشخّص نشده"
@@ -2196,7 +2220,7 @@ msgstr "یک پرونده با همان نام در حال حاضر وجود د
#: gtk/gtkfiledialog.c:843 gtk/gtkmessagedialog.c:170 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:6234
#: gtk/print/gtkprintunixdialog.c:839 gtk/gtkwindow.c:6253
#: gtk/ui/gtkappchooserdialog.ui:48 gtk/ui/gtkassistant.ui:52
#: gtk/ui/gtkcolorchooserdialog.ui:36 gtk/ui/gtkfontchooserdialog.ui:27
msgid "_Cancel"
@@ -2284,7 +2308,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 "_حذف"
@@ -2609,7 +2633,7 @@ msgstr "دگرگونه‌های سبک"
msgid "Character Variations"
msgstr "دگرگونه‌های نویسه"
#: gtk/gtkglarea.c:305
#: gtk/gtkglarea.c:309
msgid "OpenGL context creation failed"
msgstr "ساخت زمینه OpenGL شکست خورد"
@@ -2622,31 +2646,31 @@ 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 "_رونوشت از نشانی پیوند"
#: 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 "فهرست بافتاری"
@@ -2717,7 +2741,7 @@ msgid "Play"
msgstr "پخش"
#: gtk/gtkmessagedialog.c:162 gtk/gtkmessagedialog.c:180
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6235
#: gtk/print/gtkprintbackend.c:639 gtk/gtkwindow.c:6254
msgid "_OK"
msgstr "_تأیید"
@@ -3542,7 +3566,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 "جست‌وجوی میان‌برها"
@@ -3556,12 +3580,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 "جست‌وجو دیگری را امتحان کنید"
@@ -3583,12 +3607,12 @@ msgstr "بر_گردان"
msgid "_Redo"
msgstr "_انجام دوباره"
#: gtk/gtkwindow.c:6223
#: gtk/gtkwindow.c:6242
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "می‌خواهید از بازرس +GTK استفاده کنید؟"
#: gtk/gtkwindow.c:6225
#: gtk/gtkwindow.c:6244
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify the "
@@ -3598,7 +3622,7 @@ msgstr ""
"بازرس +GTK یک بازرس تعاملی است که به شما اجازه پیمایش و تغییر هسته برنامه‌های +GTK "
"را می‌دهد. استفاده از آن ممکن است باعث شود که برنامه‌ها قفل کنند یا از هم بپاشند."
#: gtk/gtkwindow.c:6230
#: gtk/gtkwindow.c:6249
msgid "Dont show this message again"
msgstr "این پیام را دوباره نشان نده"
@@ -3777,39 +3801,39 @@ msgid "CSS Property"
msgstr "مشخصه CSS"
# farmaan
#: 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 "از کار افتاده"
# farmaan
#: gtk/inspector/general.c:549
#: gtk/inspector/general.c:555
msgctxt "Vulkan device"
msgid "None"
msgstr "هیچ‌کدام"
# farmaan
#: 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 به دست GTK_IM_MODULE به صورت سخت رمز شده است"
@@ -3861,43 +3885,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 "افزارهٔ ولکان"
#: gtk/inspector/general.ui:816
#: gtk/inspector/general.ui:876
msgid "Vulkan API version"
msgstr "نگارش API ولکان"
#: gtk/inspector/general.ui:843
#: gtk/inspector/general.ui:903
msgid "Vulkan driver version"
msgstr "نگارش راه‌انداز ولکان"
@@ -4315,49 +4347,52 @@ msgstr "نمایش آهنگ قاب"
msgid "Show Graphic Updates"
msgstr "نمایش بروزرسانی‌های گرافیکی"
#: gtk/inspector/visual.ui:435
msgid "Show Fallback Rendering"
msgstr "نمایش پرداخت جایگزین"
#: gtk/inspector/visual.ui:430
msgid ""
"Tints all the places where the current renderer uses Cairo instead of the GPU."
msgstr "تیره کردن تمام جاهایی که پرداختگر کنونی به جای GPU از کایرو استفاده می‌کند."
#: gtk/inspector/visual.ui:460
#: gtk/inspector/visual.ui:436
msgid "Show Cairo Rendering"
msgstr "نمایش پرداخت کایرو"
#: gtk/inspector/visual.ui:461
msgid "Show Baselines"
msgstr "نمایش مبناها"
#: gtk/inspector/visual.ui:488
#: gtk/inspector/visual.ui:489
msgid "Show Layout Borders"
msgstr "نمایش حاشیه‌های چیدمان"
#: gtk/inspector/visual.ui:545
#: gtk/inspector/visual.ui:546
msgid "CSS Padding"
msgstr "فاصله‌دهی CSS"
#: gtk/inspector/visual.ui:555
#: gtk/inspector/visual.ui:556
msgid "CSS Border"
msgstr "لبهٔ CSS"
#: gtk/inspector/visual.ui:565
#: gtk/inspector/visual.ui:566
msgid "CSS Margin"
msgstr "حاشیهٔ CSS"
#: gtk/inspector/visual.ui:575
#: gtk/inspector/visual.ui:576
msgid "Widget Margin"
msgstr "حاشیهٔ ابزارک"
#: gtk/inspector/visual.ui:610
#: gtk/inspector/visual.ui:611
msgid "Show Focus"
msgstr "نمایش تمرکز"
#: gtk/inspector/visual.ui:635
#: gtk/inspector/visual.ui:636
msgid "Show Accessibility warnings"
msgstr "شنمایش هشدارهای دسترسی‌پذیری"
#: gtk/inspector/visual.ui:660
#, fuzzy
#| msgid "Show Graphic Updates"
#: gtk/inspector/visual.ui:661
msgid "Show Graphics Offload"
msgstr "نمایش بروزرسانی‌های گرافیکی"
msgstr "نمایش تخلیهٔ گرافیکی"
#: gtk/inspector/visual.ui:692
#: gtk/inspector/visual.ui:693
msgid "Inspect Inspector"
msgstr "بازرسی بازرس"
@@ -7187,7 +7222,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"
@@ -7232,12 +7267,12 @@ msgstr ""
"پروندهٔ %s موجود است.\n"
"برای پایکالی از ‪--force‬ استفاده کنید.\n"
#: tools/gtk-builder-tool-screenshot.c:332 tools/gtk-rendernode-tool-render.c:172
#: tools/gtk-builder-tool-screenshot.c:332 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-builder-tool-screenshot.c:336 tools/gtk-rendernode-tool-render.c:175
#, c-format
msgid "Failed to save %s: %s\n"
msgstr "شکست در ذخیرهٔ %s: %s\n"
@@ -7254,7 +7289,7 @@ msgstr "ذخیره به شکل پروندهٔ گره به‌جای png"
msgid "Overwrite existing file"
msgstr "رونویسی پروندهٔ موجود"
#: tools/gtk-builder-tool-screenshot.c:363 tools/gtk-rendernode-tool-render.c:197
#: tools/gtk-builder-tool-screenshot.c:363 tools/gtk-rendernode-tool-render.c:196
msgid "FILE…"
msgstr "پرونده…"
@@ -7452,10 +7487,8 @@ msgid "Allow cubic Bézier curves"
msgstr "اجازه به منحی‌های درجه سوم بزیه"
#: tools/gtk-path-tool-decompose.c:86
#, fuzzy
#| msgid "Allow cubic Bézier curves"
msgid "Allow conic Bézier curves"
msgstr "اجازه به منحی‌های درجه سوم بزیه"
msgstr "اجازه به منحی‌های مخروطی بزیه"
#: tools/gtk-path-tool-decompose.c:87 tools/gtk-path-tool-info.c:88
#: tools/gtk-path-tool-render.c:125 tools/gtk-path-tool-restrict.c:38
@@ -7519,10 +7552,9 @@ msgid "%d cubics"
msgstr "%Id درجه سوم"
#: tools/gtk-path-tool-info.c:159
#, fuzzy, c-format
#| msgid "%d cubics"
#, c-format
msgid "%d conics"
msgstr "%Id درجه سوم"
msgstr "%Id مخروطی"
#: tools/gtk-path-tool-render.c:117 tools/gtk-path-tool-show.c:140
msgid "Fill the path (the default)"
@@ -7729,23 +7761,23 @@ 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"
"\n"
msgstr ""
"استفاده:\n"
" gtk4-builder-tool [دستور] [‫گزینه…‬]‬ FILE\n"
" gtk4-rendermode-tool [دستور] [‫گزینه…‬]‬ پرونده‬\n"
"\n"
"انجام وظایف مختلف روی پرونده‌های .ui مربوط به GtkBuilder.\n"
"انجام وظایف مختلف روی گره‌های پرداخت GTK\n"
"\n"
"دستورها:\n"
" validate تصدیق پرونده\n"
" simplify ساده سازی پرونده\n"
" enumerate فهرست کردن تمام اشیای نام‌دار\n"
" preview پیش‌نمایش پرونده\n"
"\n"
" screenshot نماگرفت از پرونده\n"
" benchmark محک پرداخت یک گره\n"
" info فراهم کردن اطَلاعات دربارهٔ گره\n"
" show نمایش گره\n"
" render نماگرفت از گره\n"
"\n"
#: tools/gtk-rendernode-tool-info.c:191
@@ -7772,7 +7804,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"
@@ -7797,19 +7829,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 "RENDERER"
#: 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 "تنها می‌تواند یک تک‌پروندهٔ ‪.noide‬ را در یک پروندهٔ خروحی پرداخت کند\n"
@@ -7827,12 +7864,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"