From 1c509be875bb8ddada05e5d8499dc81effcf6f5d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 7 Nov 2023 10:08:28 +0100 Subject: [PATCH] gpu: Replace clip node fallback with uber or offscreen We don't need to use a fallback here anymore, we have enough code by now to do this smarter. --- gsk/gpu/gskgpunodeprocessor.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 1b6cfbdb99..683deb6dc9 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -970,9 +970,27 @@ gsk_gpu_node_processor_add_clip_node (GskGpuNodeProcessor *self, { if (!gsk_gpu_clip_intersect_rect (&self->clip, &old_clip, &clip)) { - GSK_DEBUG (FALLBACK, "Failed to find intersection between clip of type %u and rectangle", self->clip.type); gsk_gpu_clip_init_copy (&self->clip, &old_clip); - gsk_gpu_node_processor_add_fallback_node (self, node); + gsk_gpu_node_processor_sync_globals (self, 0); + if (!gsk_gpu_node_processor_try_node_as_pattern (self, node)) + { + GskGpuImage *image; + graphene_rect_t tex_rect; + image = gsk_gpu_node_processor_get_node_as_image (self, + 0, + 0, + NULL, + child, + &tex_rect); + if (image) + { + gsk_gpu_node_processor_image_op (self, + image, + &node->bounds, + &tex_rect); + g_object_unref (image); + } + } return; }