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:
parent
adcd0fe9b4
commit
9b4e8695f3
@ -78,6 +78,7 @@ meta_renderer_x11_create_view (MetaRenderer *renderer,
|
|||||||
int width, height;
|
int width, height;
|
||||||
CoglTexture2D *texture_2d;
|
CoglTexture2D *texture_2d;
|
||||||
CoglOffscreen *offscreen;
|
CoglOffscreen *offscreen;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
g_assert (meta_is_wayland_compositor ());
|
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);
|
texture_2d = cogl_texture_2d_new_with_size (cogl_context, width, height);
|
||||||
offscreen = cogl_offscreen_new_with_texture (COGL_TEXTURE (texture_2d));
|
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,
|
return g_object_new (META_TYPE_RENDERER_VIEW,
|
||||||
"layout", &monitor_info->rect,
|
"layout", &monitor_info->rect,
|
||||||
"framebuffer", COGL_FRAMEBUFFER (offscreen),
|
"framebuffer", COGL_FRAMEBUFFER (offscreen),
|
||||||
|
Loading…
Reference in New Issue
Block a user