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
This commit is contained in:
Jonas Ådahl 2016-07-25 16:51:14 +08:00
parent adcd0fe9b4
commit 9b4e8695f3

View File

@ -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),