mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
clutter/stage-cogl: Check for DISABLE_CLIPPED_REDRAWS earlier
Right now we're checking for the DISABLE_CLIPPED_REDRAWS debug flag after creating the fb_clip_region and adjusting the redraw_clip. That means that if may_use_clipped_redraw was TRUE, the redraw_clip will still be set to the region and thus cause the stage to only be partially redrawn. Since we don't push a clip to the framebuffer though (use_clipped_redraw is now FALSE), parts of the view will get corrupted. To fix that, disable clipped redraws right away if the debug flag is set. This also allows removing the may_use_clipped_redraw bool and replacing it entirely with use_clipped_redraw. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1113
This commit is contained in:
parent
afe4cd482e
commit
08f47fee16
@ -575,7 +575,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
|
||||
cairo_rectangle_int_t view_rect;
|
||||
gboolean is_full_redraw;
|
||||
gboolean may_use_clipped_redraw;
|
||||
gboolean use_clipped_redraw;
|
||||
gboolean can_blit_sub_buffer;
|
||||
gboolean has_buffer_age;
|
||||
@ -611,7 +610,21 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
else
|
||||
is_full_redraw = FALSE;
|
||||
|
||||
may_use_clipped_redraw =
|
||||
if (has_buffer_age)
|
||||
{
|
||||
buffer_age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
|
||||
if (!valid_buffer_age (view_cogl, buffer_age))
|
||||
{
|
||||
CLUTTER_NOTE (CLIPPING,
|
||||
"Invalid back buffer(age=%d): forcing full redraw\n",
|
||||
buffer_age);
|
||||
use_clipped_redraw = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
use_clipped_redraw =
|
||||
use_clipped_redraw &&
|
||||
!(clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS) &&
|
||||
_clutter_stage_window_can_clip_redraws (stage_window) &&
|
||||
(can_blit_sub_buffer || has_buffer_age) &&
|
||||
!is_full_redraw &&
|
||||
@ -619,17 +632,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
* frames when starting up... */
|
||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3;
|
||||
|
||||
if (has_buffer_age)
|
||||
{
|
||||
buffer_age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
|
||||
if (!valid_buffer_age (view_cogl, buffer_age))
|
||||
{
|
||||
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", buffer_age);
|
||||
may_use_clipped_redraw = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (may_use_clipped_redraw)
|
||||
if (use_clipped_redraw)
|
||||
{
|
||||
fb_clip_region = offset_scale_and_clamp_region (redraw_clip,
|
||||
-view_rect.x,
|
||||
@ -650,13 +653,8 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||
redraw_clip = cairo_region_create_rectangle (&view_rect);
|
||||
}
|
||||
|
||||
if (may_use_clipped_redraw &&
|
||||
G_LIKELY (!(clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)))
|
||||
use_clipped_redraw = TRUE;
|
||||
else
|
||||
use_clipped_redraw = FALSE;
|
||||
|
||||
clip_region_empty = may_use_clipped_redraw && cairo_region_is_empty (fb_clip_region);
|
||||
clip_region_empty = (use_clipped_redraw &&
|
||||
cairo_region_is_empty (fb_clip_region));
|
||||
|
||||
swap_with_damage = FALSE;
|
||||
if (has_buffer_age)
|
||||
|
Loading…
Reference in New Issue
Block a user