Compare commits

..

1 Commits

Author SHA1 Message Date
Matthias Clasen f40ad5f8b8 gpu: Handle image creation failure for cairo ops
Handle this like we do for textures: If we can't create the
image, just return NULL, and don't leak.
2024-01-11 06:23:10 -05:00
19 changed files with 36 additions and 164 deletions
-32
View File
@@ -63,38 +63,6 @@
}
]
},
{
"name": "shaderc",
"buildsystem": "cmake-ninja",
"builddir": true,
"config-opts": [
"-DSHADERC_SKIP_COPYRIGHT_CHECK=ON",
"-DSHADERC_SKIP_EXAMPLES=ON",
"-DSHADERC_SKIP_TESTS=ON"
],
"cleanup": [ "/bin", "/lib/cmake", "/lib/pkgconfig", "/include" ],
"post-install": [
"install -D /lib/$(gcc --print-multiarch)/libSPIRV*.so /app/lib"
],
"sources": [
{
"type": "archive",
"archive-type": "tar",
"url": "https://api.github.com/repos/google/shaderc/tarball/refs/tags/v2021.3",
"sha256": "b7e54b23a83343d5e2da836d8833ae0db11926141955edf845e35d4dc1eb88d1"
},
{
"type": "shell",
"commands": [
"sed -i 's|SPIRV/GlslangToSpv.h|glslang/SPIRV/GlslangToSpv.h|' libshaderc_util/src/compiler.cc",
"sed -i 's|add_subdirectory(third_party)||' CMakeLists.txt",
"sed -i 's|add_custom_target(build-version|set(NOT_USE|' CMakeLists.txt",
"LIB=/lib/$(gcc --print-multiarch)\nVER_MATCH=\"[0-9]+\\.[^\\. ]+\"\nSHADERC=$(grep -m1 -oP \"^v$VER_MATCH\" CHANGES)\nSPIRV=v$(grep -oP \"(?<=Version:.)$VER_MATCH\" $LIB/pkgconfig/SPIRV-Tools-shared.pc)\nGLSLANG=v$(realpath $LIB/libglslang.so | grep -oP \"(?<=so.)$VER_MATCH\")\ncat <<- EOF > glslc/src/build-version.inc\n \"shaderc $SHADERC\"\n \"spirv-tools $SPIRV\"\n \"glslang $GLSLANG\"\nEOF",
"cat glslc/src/build-version.inc"
]
}
]
},
{
"name" : "libsass",
"buildsystem" : "meson",
-1
View File
@@ -1796,7 +1796,6 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.wm.preferences", "action-right-click-titlebar", "gtk-titlebar-right-click", G_TYPE_STRING, { .s = "menu" } },
{ FALSE, "org.gnome.desktop.a11y", "always-show-text-caret", "gtk-keynav-use-caret", G_TYPE_BOOLEAN, { .b = FALSE } },
{ FALSE, "org.gnome.desktop.a11y.interface", "high-contrast", "high-contast", G_TYPE_NONE, { .b = FALSE } },
{ FALSE, "org.gnome.desktop.a11y.interface", "show-status-shapes", "gtk-show-status-shapes", G_TYPE_BOOLEAN, { .b = FALSE } },
/* Note, this setting doesn't exist, the portal and gsd fake it */
{ FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_NONE, { .i = 0 } },
};
-1
View File
@@ -39,7 +39,6 @@ static const struct {
{"Gtk/CursorThemeSize", "gtk-cursor-theme-size"},
{"Gtk/ColorScheme", "gtk-color-scheme"},
{"Gtk/EnableAnimations", "gtk-enable-animations"},
{"Gtk/ShowStatusStates", "gtk-show-status-shapes"},
{"Xft/Antialias", "gtk-xft-antialias"},
{"Xft/Hinting", "gtk-xft-hinting"},
{"Xft/HintStyle", "gtk-xft-hintstyle"},
+11 -21
View File
@@ -14,14 +14,6 @@ gsk_gpu_clip_init_empty (GskGpuClip *clip,
gsk_rounded_rect_init_from_rect (&clip->rect, rect, 0);
}
void
gsk_gpu_clip_init_contained (GskGpuClip *clip,
const graphene_rect_t *rect)
{
clip->type = GSK_GPU_CLIP_CONTAINED;
gsk_rounded_rect_init_from_rect (&clip->rect, rect, 0);
}
void
gsk_gpu_clip_init_rect (GskGpuClip *clip,
const graphene_rect_t *rect)
@@ -62,6 +54,17 @@ gsk_gpu_clip_intersect_rect (GskGpuClip *dest,
{
GskRoundedRectIntersection res;
if (gsk_rect_contains_rect (rect, &src->rect.bounds))
{
gsk_gpu_clip_init_copy (dest, src);
return TRUE;
}
if (!gsk_rect_intersects (rect, &src->rect.bounds))
{
dest->type = GSK_GPU_CLIP_ALL_CLIPPED;
return TRUE;
}
switch (src->type)
{
case GSK_GPU_CLIP_ALL_CLIPPED:
@@ -69,14 +72,6 @@ gsk_gpu_clip_intersect_rect (GskGpuClip *dest,
break;
case GSK_GPU_CLIP_NONE:
if (gsk_rect_contains_rect (rect, &src->rect.bounds))
{
gsk_gpu_clip_init_copy (dest, src);
return TRUE;
}
G_GNUC_FALLTHROUGH;
case GSK_GPU_CLIP_CONTAINED:
gsk_gpu_clip_init_copy (dest, src);
if (gsk_rect_intersection (&dest->rect.bounds, rect, &dest->rect.bounds))
dest->type = GSK_GPU_CLIP_RECT;
@@ -129,7 +124,6 @@ gsk_gpu_clip_intersect_rounded_rect (GskGpuClip *dest,
break;
case GSK_GPU_CLIP_NONE:
case GSK_GPU_CLIP_CONTAINED:
case GSK_GPU_CLIP_RECT:
res = gsk_rounded_rect_intersect_with_rect (rounded, &src->rect.bounds, &dest->rect);
if (!gsk_gpu_clip_init_after_intersection (dest, res))
@@ -180,7 +174,6 @@ gsk_gpu_clip_transform (GskGpuClip *dest,
return TRUE;
case GSK_GPU_CLIP_NONE:
case GSK_GPU_CLIP_CONTAINED:
case GSK_GPU_CLIP_RECT:
case GSK_GPU_CLIP_ROUNDED:
switch (gsk_transform_get_category (transform))
@@ -253,7 +246,6 @@ gsk_gpu_clip_may_intersect_rect (const GskGpuClip *self,
return FALSE;
case GSK_GPU_CLIP_NONE:
case GSK_GPU_CLIP_CONTAINED:
case GSK_GPU_CLIP_RECT:
case GSK_GPU_CLIP_ROUNDED:
return gsk_rect_intersects (&self->rect.bounds, &r);
@@ -277,7 +269,6 @@ gsk_gpu_clip_contains_rect (const GskGpuClip *self,
return FALSE;
case GSK_GPU_CLIP_NONE:
case GSK_GPU_CLIP_CONTAINED:
case GSK_GPU_CLIP_RECT:
return gsk_rect_contains_rect (&self->rect.bounds, &r);
@@ -292,7 +283,6 @@ gsk_gpu_clip_get_shader_clip (const GskGpuClip *self,
const graphene_rect_t *rect)
{
if (self->type == GSK_GPU_CLIP_NONE ||
self->type == GSK_GPU_CLIP_CONTAINED ||
gsk_gpu_clip_contains_rect (self, offset, rect))
return GSK_GPU_SHADER_CLIP_NONE;
else if (self->type == GSK_GPU_CLIP_RECT)
-5
View File
@@ -18,9 +18,6 @@ typedef enum {
* to the actual bounds of the underlying framebuffer
*/
GSK_GPU_CLIP_NONE,
/* The clip exists outside the rect, so clipping must
* happen if rendering can't be proven to stay in the rect */
GSK_GPU_CLIP_CONTAINED,
/* The clip is a rectangular area */
GSK_GPU_CLIP_RECT,
/* The clip is a rounded rectangle */
@@ -37,8 +34,6 @@ struct _GskGpuClip
void gsk_gpu_clip_init_empty (GskGpuClip *clip,
const graphene_rect_t *rect);
void gsk_gpu_clip_init_contained (GskGpuClip *clip,
const graphene_rect_t *rect);
void gsk_gpu_clip_init_copy (GskGpuClip *self,
const GskGpuClip *src);
void gsk_gpu_clip_init_rect (GskGpuClip *clip,
+2 -2
View File
@@ -709,8 +709,8 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
.height = rect.size.height + 2 * padding,
},
scale,
&GRAPHENE_POINT_INIT (cache->origin.x + padding,
cache->origin.y + padding));
&GRAPHENE_POINT_INIT (cache->origin.x + 1,
cache->origin.y + 1));
g_hash_table_insert (priv->glyph_cache, cache, cache);
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
+2 -2
View File
@@ -1591,7 +1591,7 @@ gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
if (gsk_gpu_clip_contains_rect (&self->clip, &self->offset, &node->bounds))
{
gsk_gpu_clip_init_contained (&self->clip, &child->bounds);
gsk_gpu_clip_init_empty (&self->clip, &child->bounds);
}
else if (old_clip.type == GSK_GPU_CLIP_NONE)
{
@@ -1600,7 +1600,7 @@ gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
inverse = gsk_transform_invert (gsk_transform_ref (clip_transform));
gsk_transform_transform_bounds (inverse, &old_clip.rect.bounds, &new_bounds);
gsk_transform_unref (inverse);
gsk_gpu_clip_init_contained (&self->clip, &new_bounds);
gsk_gpu_clip_init_empty (&self->clip, &new_bounds);
}
else if (!gsk_gpu_clip_transform (&self->clip, &old_clip, clip_transform, &child->bounds))
{
+10 -5
View File
@@ -459,14 +459,19 @@ gsk_gpu_upload_cairo_op (GskGpuFrame *frame,
GDestroyNotify user_destroy)
{
GskGpuUploadCairoOp *self;
GskGpuImage *image;
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));
if (!image)
return NULL;
self = (GskGpuUploadCairoOp *) gsk_gpu_op_alloc (frame, &GSK_GPU_UPLOAD_CAIRO_OP_CLASS);
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));
self->image = image;
self->viewport = *viewport;
self->func = func;
self->user_data = user_data;
-12
View File
@@ -172,7 +172,6 @@ enum {
PROP_ALTERNATIVE_SORT_ARROWS,
PROP_ENABLE_ANIMATIONS,
PROP_ERROR_BELL,
PROP_STATUS_SHAPES,
PROP_PRINT_BACKENDS,
PROP_PRINT_PREVIEW_COMMAND,
PROP_ENABLE_ACCELS,
@@ -572,17 +571,6 @@ gtk_settings_class_init (GtkSettingsClass *class)
TRUE,
GTK_PARAM_READWRITE);
/**
* GtkSettings:gtk-show-status-shapes:
*
* When %TRUE, widgets like switches include shapes to indicate their on/off state.
*
* Since: 4.14
*/
pspecs[PROP_STATUS_SHAPES] = g_param_spec_boolean ("gtk-show-status-shapes", NULL, NULL,
FALSE,
GTK_PARAM_READWRITE);
/**
* GtkSettings:gtk-print-backends:
*
-27
View File
@@ -549,18 +549,6 @@ state_set (GtkSwitch *self,
return TRUE;
}
static gboolean
translate_switch_shapes_to_opacity (GBinding *binding,
const GValue *from_value,
GValue *to_value,
gpointer user_data)
{
gboolean visible = g_value_get_boolean (from_value);
g_value_set_double (to_value, visible ? 1.0 : 0.0);
return TRUE;
}
static void
gtk_switch_class_init (GtkSwitchClass *klass)
{
@@ -670,7 +658,6 @@ gtk_switch_init (GtkSwitch *self)
{
GtkLayoutManager *layout;
GtkGesture *gesture;
GtkSettings *gtk_settings;
gtk_widget_set_focusable (GTK_WIDGET (self), TRUE);
@@ -703,32 +690,18 @@ gtk_switch_init (GtkSwitch *self)
gtk_switch_allocate);
gtk_widget_set_layout_manager (GTK_WIDGET (self), layout);
gtk_settings = gtk_settings_get_default ();
self->on_image = g_object_new (GTK_TYPE_IMAGE,
"accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
"icon-name", "switch-on-symbolic",
NULL);
gtk_widget_set_parent (self->on_image, GTK_WIDGET (self));
g_object_bind_property_full (gtk_settings, "gtk-show-status-shapes",
self->on_image, "opacity",
G_BINDING_SYNC_CREATE,
translate_switch_shapes_to_opacity,
NULL, NULL, NULL);
self->off_image = g_object_new (GTK_TYPE_IMAGE,
"accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
"icon-name", "switch-off-symbolic",
NULL);
gtk_widget_set_parent (self->off_image, GTK_WIDGET (self));
g_object_bind_property_full (gtk_settings, "gtk-show-status-shapes",
self->off_image, "opacity",
G_BINDING_SYNC_CREATE,
translate_switch_shapes_to_opacity,
NULL, NULL, NULL);
self->slider = gtk_gizmo_new_with_role ("slider",
GTK_ACCESSIBLE_ROLE_NONE,
NULL, NULL, NULL, NULL, NULL, NULL);
+4
View File
@@ -2482,6 +2482,10 @@ switch {
transition: $button_transition;
}
@if $contrast != 'high' {
> image { color: transparent; } /* only show i / o for the accessible theme */
}
&:hover > slider {
@include button(hover);
}
@@ -1,7 +0,0 @@
transform {
transform: scale(30);
child: text {
font: "text-mixed-color 7.5";
glyphs: 7 10;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1002 B

-22
View File
@@ -1,22 +0,0 @@
transform {
transform: rotate(45);
child: clip {
clip: -10 -2.5 20 5;
child: color {
bounds: -25 -25 50 50;
color: rgb(255,0,0);
}
}
}
color {
bounds: -16 -16 16 16;
color: rgb(0,0,0);
}
color {
bounds: -8 -8 16 16;
color: rgb(0,0,0);
}
color {
bounds: 0 0 16 16;
color: rgb(0,0,0);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

Binary file not shown.
-18
View File
@@ -10,7 +10,6 @@
<GlyphID id="4" name="D"/>
<GlyphID id="5" name="E"/>
<GlyphID id="6" name="F"/>
<GlyphID id="7" name="G"/>
</GlyphOrder>
<head>
@@ -81,7 +80,6 @@
<mtx name="D" width="1024" lsb="0"/>
<mtx name="E" width="1024" lsb="0"/>
<mtx name="F" width="1024" lsb="0"/>
<mtx name="G" width="1024" lsb="0"/>
</hmtx>
<loca>
@@ -143,21 +141,6 @@
</contour>
<instructions><assembly></assembly></instructions>
</TTGlyph>
<TTGlyph name="G">
<contour>
<pt x="0" y="0" on="1"/>
<pt x="1024" y="0" on="1"/>
<pt x="1024" y="2048" on="1"/>
<pt x="0" y="2048" on="1"/>
</contour>
<contour>
<pt x="5" y="5" on="1"/>
<pt x="5" y="2043" on="1"/>
<pt x="1019" y="2043" on="1"/>
<pt x="1019" y="5" on="1"/>
</contour>
<instructions><assembly></assembly></instructions>
</TTGlyph>
</glyf>
<COLR>
@@ -199,7 +182,6 @@
<map code="0x44" name="D"/>
<map code="0x45" name="E"/>
<map code="0x46" name="F"/>
<map code="0x47" name="G"/>
</cmap_format_4>
</cmap>
+6 -8
View File
@@ -10,7 +10,6 @@ node_parser = executable('node-parser', 'node-parser.c',
)
compare_render_tests = [
'big-box-glyph-nocairo',
'big-checkerboard',
'big-checkerboard-scaled-down',
'big-checkerboard-scaled-down-nearest',
@@ -29,7 +28,6 @@ compare_render_tests = [
'border-opacity',
'borders-rotated',
'borders-scaled',
'clip-contained',
'clip-coordinates-2d',
'clip-coordinates-nocairo',
'clip-in-rounded-clip1',
@@ -212,7 +210,7 @@ foreach renderer : renderers
if ((not testname.contains(exclude_term)) and
(renderer_name != 'broadway' or broadway_enabled) and
(renderer_name != 'vulkan' or have_vulkan))
test('compare ' + renderer_name + ' ' + testname, compare_render,
test(renderer_name + ' ' + testname, compare_render,
args: [
'--output', join_paths(meson.current_build_dir(), 'compare', renderer_name),
join_paths(meson.current_source_dir(), 'compare', testname + '.node'),
@@ -221,7 +219,7 @@ foreach renderer : renderers
env: test_env,
suite: suites,
)
test('compare ' + renderer_name + ' ' + testname + ' flipped', compare_render,
test(renderer_name + ' ' + testname + ' flipped', compare_render,
args: [
'--flip',
'--output', join_paths(meson.current_build_dir(), 'compare', renderer_name),
@@ -231,7 +229,7 @@ foreach renderer : renderers
env: test_env,
suite: suites + [ 'gsk-compare-flipped-' + renderer_name ],
)
test('compare ' + renderer_name + ' ' + testname + ' repeated', compare_render,
test(renderer_name + ' ' + testname + ' repeated', compare_render,
args: [
'--repeat',
'--output', join_paths(meson.current_build_dir(), 'compare', renderer_name),
@@ -241,7 +239,7 @@ foreach renderer : renderers
env: test_env,
suite: suites + [ 'gsk-compare-repeated-' + renderer_name ],
)
test('compare ' + renderer_name + ' ' + testname + ' rotated', compare_render,
test(renderer_name + ' ' + testname + ' rotated', compare_render,
args: [
'--rotate',
'--output', join_paths(meson.current_build_dir(), 'compare', renderer_name),
@@ -251,7 +249,7 @@ foreach renderer : renderers
env: test_env,
suite: suites + [ 'gsk-compare-rotated-' + renderer_name ],
)
test('compare ' + renderer_name + ' ' + testname + ' masked', compare_render,
test(renderer_name + ' ' + testname + ' masked', compare_render,
args: [
'--mask',
'--output', join_paths(meson.current_build_dir(), 'compare', renderer_name),
@@ -261,7 +259,7 @@ foreach renderer : renderers
env: test_env,
suite: suites + [ 'gsk-compare-masked-' + renderer_name ],
)
test('compare ' + renderer_name + ' ' + testname + ' replayed', compare_render,
test(renderer_name + ' ' + testname + ' replayed', compare_render,
args: [
'--replay',
'--output', join_paths(meson.current_build_dir(), 'compare', renderer_name),
+1 -1
View File
@@ -10,7 +10,7 @@ echo "1..1"
name=gtk-query-settings
result=$TEST_RESULT_DIR/$name.out
$GTK_QUERY_SETTINGS 2>/dev/null >$result
EXPECTED=51
EXPECTED=50
SEEN=$(wc -l $result | cut -f1 -d' ')
if [ $SEEN -eq $EXPECTED ]; then