From 690c06109e1b76beeb8bc4ec13178cce65e04d17 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 10 May 2024 07:24:25 -0400 Subject: [PATCH] gsk: Speed up mask nodes with cairo Switch symbolc icon drawing from color-matrix to mask nodes make the performance of the iconscroll demo crater (from 60fps to 10fps). Apply the same optimization we already have for color-matrix nodes when drawing mask nodes. This gets us back to 60fps. Fixes: #6700 --- gsk/gskrendernodeimpl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 98493c9ded..d4a05e3010 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -6397,6 +6397,10 @@ gsk_mask_node_draw (GskRenderNode *node, graphene_matrix_t color_matrix; graphene_vec4_t color_offset; + /* clip so the push_group() creates a smaller surface */ + gsk_cairo_rectangle (cr, &node->bounds); + cairo_clip (cr); + if (has_empty_clip (cr)) return;