[mutter] clutter/stage-view: Always use cogl_blit_framebuffer() from shadowfb
- From: verdre <jonasd src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/stage-view: Always use cogl_blit_framebuffer() from shadowfb
- Date: Tue, 26 May 2020 14:21:41 +0000 (UTC)
commit 4e27a4ea1d59d2ae60e85e124d21e35b6a72b18f
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue May 5 18:55:03 2020 +0200
clutter/stage-view: Always use cogl_blit_framebuffer() from shadowfb
It should only be used when direct blitting is supported, so there is no
reason we should have to deal with pipelines etc when blitting from the
shadow buffer to the onscreen.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
clutter/clutter/clutter-stage-view.c | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index 48d8b35773..a9b202f8cd 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -57,7 +57,6 @@ typedef struct _ClutterStageViewPrivate
gboolean use_shadowfb;
struct {
CoglOffscreen *framebuffer;
- CoglPipeline *pipeline;
} shadow;
CoglScanout *next_scanout;
@@ -158,19 +157,6 @@ clutter_stage_view_ensure_offscreen_blit_pipeline (ClutterStageView *view)
view_class->setup_offscreen_blit_pipeline (view, priv->offscreen_pipeline);
}
-static void
-clutter_stage_view_ensure_shadowfb_blit_pipeline (ClutterStageView *view)
-{
- ClutterStageViewPrivate *priv =
- clutter_stage_view_get_instance_private (view);
-
- if (priv->shadow.pipeline)
- return;
-
- priv->shadow.pipeline =
- clutter_stage_view_create_framebuffer_pipeline (priv->shadow.framebuffer);
-}
-
void
clutter_stage_view_invalidate_offscreen_blit_pipeline (ClutterStageView *view)
{
@@ -326,12 +312,21 @@ clutter_stage_view_after_paint (ClutterStageView *view)
if (priv->shadow.framebuffer)
{
- clutter_stage_view_ensure_shadowfb_blit_pipeline (view);
- clutter_stage_view_copy_to_framebuffer (view,
- priv->shadow.pipeline,
- priv->shadow.framebuffer,
- priv->framebuffer,
- TRUE);
+ int width, height;
+ g_autoptr (GError) error = NULL;
+
+ width = cogl_framebuffer_get_width (priv->framebuffer);
+ height = cogl_framebuffer_get_height (priv->framebuffer);
+ if (!cogl_blit_framebuffer (priv->shadow.framebuffer,
+ priv->framebuffer,
+ 0, 0,
+ 0, 0,
+ width, height,
+ &error))
+ {
+ g_warning ("Failed to blit shadow buffer: %s", error->message);
+ return;
+ }
}
}
@@ -646,7 +641,6 @@ clutter_stage_view_dispose (GObject *object)
g_clear_pointer (&priv->name, g_free);
g_clear_pointer (&priv->framebuffer, cogl_object_unref);
g_clear_pointer (&priv->shadow.framebuffer, cogl_object_unref);
- g_clear_pointer (&priv->shadow.pipeline, cogl_object_unref);
g_clear_pointer (&priv->offscreen, cogl_object_unref);
g_clear_pointer (&priv->offscreen_pipeline, cogl_object_unref);
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]