clutter/layer-node: Use non-deprecated cogl_texture_2d_new_with_size()

Use the non-deprecated cogl_texture_2d_new_with_size() function to create
the texture backing the FBO, and set it to pre-multiplied before allocating
it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1167
This commit is contained in:
Georges Basile Stavracas Neto 2020-03-30 21:51:33 -03:00
parent 625773fba4
commit 5d27e5415d

View File

@ -1426,6 +1426,7 @@ clutter_layer_node_new (const CoglMatrix *projection,
guint8 opacity) guint8 opacity)
{ {
ClutterLayerNode *res; ClutterLayerNode *res;
CoglContext *context;
CoglTexture *texture; CoglTexture *texture;
CoglColor color; CoglColor color;
@ -1438,10 +1439,12 @@ clutter_layer_node_new (const CoglMatrix *projection,
res->opacity = opacity; res->opacity = opacity;
/* the texture backing the FBO */ /* the texture backing the FBO */
texture = cogl_texture_new_with_size (MAX (res->fbo_width, 1), context = clutter_backend_get_cogl_context (clutter_get_default_backend ());
MAX (res->fbo_height, 1),
COGL_TEXTURE_NO_SLICING, texture = cogl_texture_2d_new_with_size (context,
COGL_PIXEL_FORMAT_RGBA_8888_PRE); MAX (res->fbo_width, 1),
MAX (res->fbo_height, 1));
cogl_texture_set_premultiplied (texture, TRUE);
res->offscreen = COGL_FRAMEBUFFER (cogl_offscreen_new_to_texture (texture)); res->offscreen = COGL_FRAMEBUFFER (cogl_offscreen_new_to_texture (texture));
if (res->offscreen == NULL) if (res->offscreen == NULL)