clutter/stage-cogl: Don't push scissor clip with one clip rectangle

While this is meant as an optimzation to only use the scissor clip and
not the stencil buffer if there's only one clip rectangle, it's not
needed since this optimization is going to be applied to region clips
anyway inside _cogl_clip_stack_gl_flush() (see cogl-clip-stack-gl.c).

So remove the unnecessary optimization here and rely on cogl-clip-stack
to do it for us.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1113
This commit is contained in:
Jonas Dreßler 2020-03-06 11:59:54 +01:00 committed by Jonas Ådahl
parent 8c52b431bb
commit 3fed768db4

View File

@ -724,30 +724,8 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
CLUTTER_NOTE (CLIPPING, "Empty stage output paint\n");
}
else if (use_clipped_redraw)
{
cairo_rectangle_int_t clip_rect;
if (cairo_region_num_rectangles (fb_clip_region) == 1)
{
cairo_region_get_extents (fb_clip_region, &clip_rect);
CLUTTER_NOTE (CLIPPING,
"Stage clip pushed: x=%d, y=%d, width=%d, height=%d\n",
clip_rect.x,
clip_rect.y,
clip_rect.width,
clip_rect.height);
cogl_framebuffer_push_scissor_clip (fb,
clip_rect.x,
clip_rect.y,
clip_rect.width,
clip_rect.height);
}
else
{
cogl_framebuffer_push_region_clip (fb, fb_clip_region);
}
paint_stage (stage_cogl, view, redraw_clip);