diff --git a/clutter/clutter/clutter-paint-context.h b/clutter/clutter/clutter-paint-context.h index 8461b947a..2a36fe967 100644 --- a/clutter/clutter/clutter-paint-context.h +++ b/clutter/clutter/clutter-paint-context.h @@ -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 ()) diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index 14e04e1a5..f5d7f141b 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -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, diff --git a/src/backends/meta-screen-cast-area-stream-src.c b/src/backends/meta-screen-cast-area-stream-src.c index e22b7dcab..e7d42d432 100644 --- a/src/backends/meta-screen-cast-area-stream-src.c +++ b/src/backends/meta-screen-cast-area-stream-src.c @@ -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);