clutter/stage-view: Disable double buffered shadow buffering

To make the double buffered shadow buffer damaged tiles detection
feasable, a new EGL extension is needed for creating FBO's backed by
a custom CPU memory buffer, instead of DMA buffers, as DMA buffers can
be very slow to read, much slower than just painting the shadow buffer
directly.

Leave the code there, since such an EGL extension is intended to be
added, but hide it behind an env var so that it isn't enabled by
accident.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1724>
This commit is contained in:
Jonas Ådahl 2021-02-10 09:39:18 +01:00 committed by Marge Bot
parent 82af1fb87e
commit 393a85971c

View File

@ -425,15 +425,19 @@ init_shadowfb (ClutterStageView *view)
height = cogl_framebuffer_get_height (priv->framebuffer);
cogl_context = cogl_framebuffer_get_context (priv->framebuffer);
if (init_dma_buf_shadowfbs (view, cogl_context, width, height, &error))
if (g_strcmp0 (g_getenv ("MUTTER_DEBUG_ENABLE_DOUBLE_SHADOWFB"), "1") == 0)
{
g_message ("Initialized double buffered shadow fb for %s", priv->name);
return;
}
if (init_dma_buf_shadowfbs (view, cogl_context, width, height, &error))
{
g_message ("Initialized double buffered shadow fb for %s",
priv->name);
return;
}
g_warning ("Failed to initialize double buffered shadow fb for %s: %s",
priv->name, error->message);
g_clear_error (&error);
g_warning ("Failed to initialize double buffered shadow fb for %s: %s",
priv->name, error->message);
g_clear_error (&error);
}
if (!init_fallback_shadowfb (view, cogl_context, width, height, &error))
{