From 9b4e8695f3ce068cdedb91cb48db3e70190a84f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 25 Jul 2016 16:51:14 +0800 Subject: [PATCH] MetaRendererX11: Allocate offscreen framebuffers up front Allocate the offscreen stage view framebuffers up front; otherwise they may get allocated after the viewport calculated by the stage is set, which would cause the viewport to be incorrect until recalculated. https://bugzilla.gnome.org/show_bug.cgi?id=768976 --- src/backends/x11/meta-renderer-x11.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backends/x11/meta-renderer-x11.c b/src/backends/x11/meta-renderer-x11.c index bd604bc73..c0405bedc 100644 --- a/src/backends/x11/meta-renderer-x11.c +++ b/src/backends/x11/meta-renderer-x11.c @@ -78,6 +78,7 @@ meta_renderer_x11_create_view (MetaRenderer *renderer, int width, height; CoglTexture2D *texture_2d; CoglOffscreen *offscreen; + GError *error = NULL; g_assert (meta_is_wayland_compositor ()); @@ -86,6 +87,9 @@ meta_renderer_x11_create_view (MetaRenderer *renderer, texture_2d = cogl_texture_2d_new_with_size (cogl_context, width, height); offscreen = cogl_offscreen_new_with_texture (COGL_TEXTURE (texture_2d)); + if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (offscreen), &error)) + meta_fatal ("Couldn't allocate framebuffer: %s", error->message); + return g_object_new (META_TYPE_RENDERER_VIEW, "layout", &monitor_info->rect, "framebuffer", COGL_FRAMEBUFFER (offscreen),