diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c b/src/backends/meta-screen-cast-monitor-stream-src.c index f30a52d1d..3c449e022 100644 --- a/src/backends/meta-screen-cast-monitor-stream-src.c +++ b/src/backends/meta-screen-cast-monitor-stream-src.c @@ -552,13 +552,13 @@ meta_screen_cast_monitor_stream_src_record_to_framebuffer (MetaScreenCastStreamS { MetaScreenCastMonitorStreamSrc *monitor_src = META_SCREEN_CAST_MONITOR_STREAM_SRC (src); - MetaBackend *backend = get_backend (monitor_src); - MetaRenderer *renderer = meta_backend_get_renderer (backend); + MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src); + ClutterStage *stage = get_stage (monitor_src); MetaMonitor *monitor; MetaLogicalMonitor *logical_monitor; MetaRectangle logical_monitor_layout; - GList *l; float view_scale; + ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR; monitor = get_monitor (monitor_src); logical_monitor = meta_monitor_get_logical_monitor (monitor); @@ -569,45 +569,23 @@ meta_screen_cast_monitor_stream_src_record_to_framebuffer (MetaScreenCastStreamS else view_scale = 1.0; - for (l = meta_renderer_get_views (renderer); l; l = l->next) + switch (meta_screen_cast_stream_get_cursor_mode (stream)) { - ClutterStageView *view = CLUTTER_STAGE_VIEW (l->data); - CoglFramebuffer *view_framebuffer; - CoglScanout *scanout; - MetaRectangle view_layout; - int x, y; - - clutter_stage_view_get_layout (view, &view_layout); - - if (!meta_rectangle_overlap (&logical_monitor_layout, &view_layout)) - continue; - - x = (int) roundf ((view_layout.x - logical_monitor_layout.x) * view_scale); - y = (int) roundf ((view_layout.y - logical_monitor_layout.y) * view_scale); - - scanout = clutter_stage_view_peek_scanout (view); - if (scanout) - { - if (!cogl_scanout_blit_to_framebuffer (scanout, - framebuffer, - x, y, - error)) - return FALSE; - } - else - { - view_framebuffer = clutter_stage_view_get_framebuffer (view); - if (!cogl_blit_framebuffer (view_framebuffer, - framebuffer, - 0, 0, - x, y, - cogl_framebuffer_get_width (view_framebuffer), - cogl_framebuffer_get_height (view_framebuffer), - error)) - return FALSE; - } + case META_SCREEN_CAST_CURSOR_MODE_METADATA: + case META_SCREEN_CAST_CURSOR_MODE_HIDDEN: + paint_flags |= CLUTTER_PAINT_FLAG_NO_CURSORS; + break; + case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED: + paint_flags |= CLUTTER_PAINT_FLAG_FORCE_CURSORS; + break; } + clutter_stage_paint_to_framebuffer (stage, + framebuffer, + &logical_monitor_layout, + view_scale, + paint_flags); + cogl_framebuffer_flush (framebuffer); return TRUE;