From 537f8ec69ba98eb78c8db59d19324a98dd616ecd Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 9 Jun 2024 22:41:55 -0400 Subject: [PATCH] gpu: Use the clip for color conversion When creating the offscreen for color conversion, take the clip into account - we don't need a bigger offscreen than that. --- gsk/gpu/gskgpunodeprocessor.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index b4ad7dc4f7..cd44ad370f 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -4011,19 +4011,23 @@ gsk_gpu_node_processor_add_color_state_node (GskGpuNodeProcessor *self, else { GskGpuImage *image; + graphene_rect_t clip_bounds; + graphene_rect_t bounds; + + gsk_gpu_node_processor_get_clip_bounds (self, &clip_bounds); image = gsk_gpu_get_node_as_image (self->frame, - &node->bounds, + &clip_bounds, &self->scale, color_state, child, - &node->bounds); + &bounds); gsk_gpu_node_processor_color_convert_op (self, image, color_state, - &node->bounds, - &node->bounds); + &bounds, + &bounds); g_object_unref (image); }