gpu: Change the way clip rectangles are processed

Instead of just iterating over all the rectangles of the region,
always draw the first rectangle of the region and subtract it when done.

This sounds more complicated, but it will allow us to modify the
rectangle in future commits.
This commit is contained in:
Benjamin Otte 2024-08-04 01:21:29 +02:00
parent 9a4d8453ed
commit 1abe9760ab

View File

@ -3882,13 +3882,12 @@ gsk_gpu_node_processor_render (GskGpuFrame *frame,
GskRenderPassType pass_type)
{
GskGpuNodeProcessor self;
int i;
for (i = 0; i < cairo_region_num_rectangles (clip); i++)
while (cairo_region_num_rectangles (clip) > 0)
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (clip, i, &rect);
cairo_region_get_rectangle (clip, 0, &rect);
gsk_gpu_node_processor_init (&self,
frame,
@ -3916,6 +3915,8 @@ gsk_gpu_node_processor_render (GskGpuFrame *frame,
target,
pass_type);
cairo_region_subtract_rectangle (clip, &self.scissor);
gsk_gpu_node_processor_finish (&self);
}