mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
clutter/stage-cogl: Disable buffer age when painting red damage
This is to ensure we're rendering a red damage area that actually represents what is being damaged. Fixes an always-fullscreen red damage on bare metal Wayland and GNOME Shell.
This commit is contained in:
parent
20b271fa49
commit
acacd3dd64
@ -576,6 +576,15 @@ calculate_scissor_region (cairo_rectangle_int_t *fb_clip_region,
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
is_buffer_age_enabled (void)
|
||||||
|
{
|
||||||
|
/* Buffer age is disabled when running with CLUTTER_PAINT=damage-region,
|
||||||
|
* to ensure the red damage represents the currently damaged area */
|
||||||
|
return !(clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION) &&
|
||||||
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view)
|
ClutterStageView *view)
|
||||||
@ -613,9 +622,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
cogl_is_onscreen (fb) &&
|
cogl_is_onscreen (fb) &&
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
|
||||||
|
|
||||||
has_buffer_age =
|
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
|
||||||
cogl_is_onscreen (fb) &&
|
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
|
||||||
|
|
||||||
/* NB: a zero width redraw clip == full stage redraw */
|
/* NB: a zero width redraw clip == full stage redraw */
|
||||||
if (stage_cogl->bounding_redraw_clip.width == 0)
|
if (stage_cogl->bounding_redraw_clip.width == 0)
|
||||||
@ -946,7 +953,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
|
|||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||||
gboolean has_buffer_age =
|
gboolean has_buffer_age =
|
||||||
cogl_is_onscreen (framebuffer) &&
|
cogl_is_onscreen (framebuffer) &&
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
is_buffer_age_enabled ();
|
||||||
float fb_scale;
|
float fb_scale;
|
||||||
gboolean scale_is_fractional;
|
gboolean scale_is_fractional;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user