From c035384fc81b69b55f6f91e9dccd511bb6842618 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Mar 2023 18:10:53 +0100 Subject: [PATCH 1/4] gsk: Mark mask nodes as 'supports transforms' Just like blur nodes, the renderer can handle these without creating an extra offscreen. --- gsk/gl/gskglrenderjob.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c index ce7ce774d1..30d7c9cc51 100644 --- a/gsk/gl/gskglrenderjob.c +++ b/gsk/gl/gskglrenderjob.c @@ -315,6 +315,7 @@ node_supports_transform (const GskRenderNode *node) case GSK_CAIRO_NODE: case GSK_BLEND_NODE: case GSK_BLUR_NODE: + case GSK_MASK_NODE: return TRUE; case GSK_SHADOW_NODE: From ad84ee835226c8deec2dacf0305516f62f29a54e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Mar 2023 18:20:02 +0100 Subject: [PATCH 2/4] tests: Add more tests for texture scale nodes --- .../compare/texture-scale-magnify-rotate.node | 11 ++++++++ .../compare/texture-scale-magnify-rotate.png | Bin 0 -> 98 bytes testsuite/gsk/meson.build | 3 ++ .../gsk/nodeparser/texture-scale-filters.node | 22 +++++++++++++++ .../nodeparser/texture-scale-filters.ref.node | 26 ++++++++++++++++++ 5 files changed, 62 insertions(+) create mode 100644 testsuite/gsk/compare/texture-scale-magnify-rotate.node create mode 100644 testsuite/gsk/compare/texture-scale-magnify-rotate.png create mode 100644 testsuite/gsk/nodeparser/texture-scale-filters.node create mode 100644 testsuite/gsk/nodeparser/texture-scale-filters.ref.node diff --git a/testsuite/gsk/compare/texture-scale-magnify-rotate.node b/testsuite/gsk/compare/texture-scale-magnify-rotate.node new file mode 100644 index 0000000000..e50c8ba126 --- /dev/null +++ b/testsuite/gsk/compare/texture-scale-magnify-rotate.node @@ -0,0 +1,11 @@ +clip { + clip: 24995 24995 10 10; + child: transform { + transform: translate(25000, 25000) rotate(90) translate(-25000, -25000); + child: texture-scale { + texture: url("data:;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKElEQVQYlWNkYGD4z4AG/v/HEGJgwhDBAQZQIQs2hzMyMtLBauorBACQUgcSISWLRgAAAABJRU5ErkJggg=="); + bounds: 0 0 50000 50000; + filter: nearest; + } + } +} diff --git a/testsuite/gsk/compare/texture-scale-magnify-rotate.png b/testsuite/gsk/compare/texture-scale-magnify-rotate.png new file mode 100644 index 0000000000000000000000000000000000000000..9feff7a4846c524ba54953e9809d2ca18638553f GIT binary patch literal 98 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4X?nUihDc0J{`3F;|9Uo)11C;& w=p8xGqS(aDv%txXjg5`xe8R{36F%@TM9kpe^9nt_4XBC1)78&qol`;+0QxK){Qv*} literal 0 HcmV?d00001 diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index 1ded899729..ca8f833589 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -77,6 +77,7 @@ compare_render_tests = [ 'scaled-texture', 'shadow-in-opacity', 'texture-scale-magnify-10000x', + 'texture-scale-magnify-rotate', 'texture-scale-stripes', 'texture-url', 'transform-in-transform', @@ -234,6 +235,8 @@ node_parser_tests = [ 'texture-fail.node', 'texture-fail.ref.node', 'texture-fail.ref.errors', + 'texture-scale-filters.node', + 'texture-scale-filters.ref.node', 'texture-scale-unknown-filter.errors', 'texture-scale-unknown-filter.node', 'texture-scale-unknown-filter.ref.node', diff --git a/testsuite/gsk/nodeparser/texture-scale-filters.node b/testsuite/gsk/nodeparser/texture-scale-filters.node new file mode 100644 index 0000000000..1aef466ce5 --- /dev/null +++ b/testsuite/gsk/nodeparser/texture-scale-filters.node @@ -0,0 +1,22 @@ +texture-scale { + texture: url('data:,'); + bounds: 0 0 50 50; +} + +texture-scale { + texture: url('data:,'); + bounds: 0 0 50 50; + filter: linear; +} + +texture-scale { + texture: url('data:,'); + bounds: 0 0 50 50; + filter: nearest; +} + +texture-scale { + texture: url('data:,'); + bounds: 0 0 50 50; + filter: trilinear; +} diff --git a/testsuite/gsk/nodeparser/texture-scale-filters.ref.node b/testsuite/gsk/nodeparser/texture-scale-filters.ref.node new file mode 100644 index 0000000000..957013272e --- /dev/null +++ b/testsuite/gsk/nodeparser/texture-scale-filters.ref.node @@ -0,0 +1,26 @@ +texture-scale { + bounds: 0 0 50 50; + texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\ +1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\ +"); +} +texture-scale { + bounds: 0 0 50 50; + texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\ +1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\ +"); +} +texture-scale { + bounds: 0 0 50 50; + filter: nearest; + texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\ +1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\ +"); +} +texture-scale { + bounds: 0 0 50 50; + filter: trilinear; + texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWP8z8Dwn4EIwESMolGF\ +1FMIAD2cAhL1w47oAAAAAElFTkSuQmCC\ +"); +} From 6b7f0266acbdcccc05e6ce51fd53757b1fac8acf Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Mar 2023 22:19:51 +0100 Subject: [PATCH 3/4] icontheme: Silence a compiler warning --- gtk/gtkicontheme.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 66c7d97f34..729f632852 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -3051,6 +3051,7 @@ theme_lookup_icon (IconTheme *theme, min_difference = G_MAXINT; min_dir_size = NULL; + min_file = NULL; for (i = 0; i < theme->dir_sizes->len; i++) { From 42f1b623bf5b6231057ff3bdc18ad33d8e1504f7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Mar 2023 22:20:12 +0100 Subject: [PATCH 4/4] css: Small speedups --- gtk/gtkcssnumbervalue.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c index cd8c942c01..270711b27c 100644 --- a/gtk/gtkcssnumbervalue.c +++ b/gtk/gtkcssnumbervalue.c @@ -758,11 +758,8 @@ _gtk_css_number_value_get (const GtkCssValue *value, gboolean gtk_css_dimension_value_is_zero (const GtkCssValue *value) { - if (!value) - return TRUE; - - if (value->class != >K_CSS_VALUE_NUMBER) - return FALSE; + g_assert (value != 0); + g_assert (value->class == >K_CSS_VALUE_NUMBER); if (value->type != TYPE_DIMENSION) return FALSE;