Merge branch 'matthiasc/for-main' into 'main'

gsk: Mark mask nodes as 'supports transforms'

See merge request GNOME/gtk!5650
This commit is contained in:
Matthias Clasen 2023-03-14 05:30:17 +00:00
commit 664ce48a4c
8 changed files with 66 additions and 5 deletions

View File

@ -315,6 +315,7 @@ node_supports_transform (const GskRenderNode *node)
case GSK_CAIRO_NODE: case GSK_CAIRO_NODE:
case GSK_BLEND_NODE: case GSK_BLEND_NODE:
case GSK_BLUR_NODE: case GSK_BLUR_NODE:
case GSK_MASK_NODE:
return TRUE; return TRUE;
case GSK_SHADOW_NODE: case GSK_SHADOW_NODE:

View File

@ -758,11 +758,8 @@ _gtk_css_number_value_get (const GtkCssValue *value,
gboolean gboolean
gtk_css_dimension_value_is_zero (const GtkCssValue *value) gtk_css_dimension_value_is_zero (const GtkCssValue *value)
{ {
if (!value) g_assert (value != 0);
return TRUE; g_assert (value->class == &GTK_CSS_VALUE_NUMBER);
if (value->class != &GTK_CSS_VALUE_NUMBER)
return FALSE;
if (value->type != TYPE_DIMENSION) if (value->type != TYPE_DIMENSION)
return FALSE; return FALSE;

View File

@ -3051,6 +3051,7 @@ theme_lookup_icon (IconTheme *theme,
min_difference = G_MAXINT; min_difference = G_MAXINT;
min_dir_size = NULL; min_dir_size = NULL;
min_file = NULL;
for (i = 0; i < theme->dir_sizes->len; i++) for (i = 0; i < theme->dir_sizes->len; i++)
{ {

View File

@ -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;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

View File

@ -77,6 +77,7 @@ compare_render_tests = [
'scaled-texture', 'scaled-texture',
'shadow-in-opacity', 'shadow-in-opacity',
'texture-scale-magnify-10000x', 'texture-scale-magnify-10000x',
'texture-scale-magnify-rotate',
'texture-scale-stripes', 'texture-scale-stripes',
'texture-url', 'texture-url',
'transform-in-transform', 'transform-in-transform',
@ -234,6 +235,8 @@ node_parser_tests = [
'texture-fail.node', 'texture-fail.node',
'texture-fail.ref.node', 'texture-fail.ref.node',
'texture-fail.ref.errors', 'texture-fail.ref.errors',
'texture-scale-filters.node',
'texture-scale-filters.ref.node',
'texture-scale-unknown-filter.errors', 'texture-scale-unknown-filter.errors',
'texture-scale-unknown-filter.node', 'texture-scale-unknown-filter.node',
'texture-scale-unknown-filter.ref.node', 'texture-scale-unknown-filter.ref.node',

View File

@ -0,0 +1,22 @@
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
}
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
filter: linear;
}
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
filter: nearest;
}
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
filter: trilinear;
}

View File

@ -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\
");
}