mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
screen-cast/area-src: Clear framebuffer before painting stage
We'll be painting to a framebuffer that may not be completely covered by the painted areas, meaning the not painted areas would end up undefined, thus potentially contain garbage or old content. Avoid this by clearing the framebuffer before painting the stage. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1442 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1459
This commit is contained in:
parent
67cc60cbda
commit
df228e8945
@ -34,6 +34,7 @@ typedef enum _ClutterPaintFlag
|
||||
CLUTTER_PAINT_FLAG_NONE = 0,
|
||||
CLUTTER_PAINT_FLAG_NO_CURSORS = 1 << 0,
|
||||
CLUTTER_PAINT_FLAG_FORCE_CURSORS = 1 << 1,
|
||||
CLUTTER_PAINT_FLAG_CLEAR = 1 << 2,
|
||||
} ClutterPaintFlag;
|
||||
|
||||
#define CLUTTER_TYPE_PAINT_CONTEXT (clutter_paint_context_get_type ())
|
||||
|
@ -3614,6 +3614,14 @@ clutter_stage_paint_to_framebuffer (ClutterStage *stage,
|
||||
ClutterPaintContext *paint_context;
|
||||
cairo_region_t *redraw_clip;
|
||||
|
||||
if (paint_flags & CLUTTER_PAINT_FLAG_CLEAR)
|
||||
{
|
||||
CoglColor clear_color;
|
||||
|
||||
cogl_color_init_from_4ub (&clear_color, 0, 0, 0, 0);
|
||||
cogl_framebuffer_clear (framebuffer, COGL_BUFFER_BIT_COLOR, &clear_color);
|
||||
}
|
||||
|
||||
redraw_clip = cairo_region_create_rectangle (rect);
|
||||
paint_context =
|
||||
clutter_paint_context_new_for_framebuffer (framebuffer,
|
||||
|
@ -414,7 +414,7 @@ meta_screen_cast_area_stream_src_record_to_buffer (MetaScreenCastStreamSrc *src
|
||||
MetaRectangle *area;
|
||||
float scale;
|
||||
int stride;
|
||||
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_NONE;
|
||||
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
||||
|
||||
stage = get_stage (area_src);
|
||||
area = meta_screen_cast_area_stream_get_area (area_stream);
|
||||
@ -456,7 +456,7 @@ meta_screen_cast_area_stream_src_record_to_framebuffer (MetaScreenCastStreamSrc
|
||||
ClutterStage *stage;
|
||||
MetaRectangle *area;
|
||||
float scale;
|
||||
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_NONE;
|
||||
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
||||
|
||||
stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
|
||||
area = meta_screen_cast_area_stream_get_area (area_stream);
|
||||
|
Loading…
Reference in New Issue
Block a user