From 05e1a6c2ca3cd6222590033e5978a9d9f6d22526 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 26 Sep 2019 10:20:36 +0200 Subject: [PATCH] clutter/stage-view: Use cogl_blit_framebuffer() for shadow FB If there is no transformation, use `cogl_blit_framebuffer()` as a shortcut in `clutter_stage_view_blit_offscreen()`, that dramatically improves performance when using a shadow framebuffer. https://gitlab.gnome.org/GNOME/mutter/merge_requests/809 --- clutter/clutter/clutter-stage-view.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c index a12261f44..7db079f78 100644 --- a/clutter/clutter/clutter-stage-view.c +++ b/clutter/clutter/clutter-stage-view.c @@ -143,6 +143,18 @@ clutter_stage_view_blit_offscreen (ClutterStageView *view, clutter_stage_view_get_instance_private (view); CoglMatrix matrix; + clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix); + if (cogl_matrix_is_identity (&matrix)) + { + if (cogl_blit_framebuffer (priv->offscreen, + priv->framebuffer, + rect->x, rect->y, + rect->x, rect->y, + rect->width, rect->height, + NULL)) + return; + } + clutter_stage_view_ensure_offscreen_blit_pipeline (view); cogl_framebuffer_push_matrix (priv->framebuffer);