From 5d27e5415d3b9d74d8ffae4ad476bf84b4143a26 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Mon, 30 Mar 2020 21:51:33 -0300 Subject: [PATCH] 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 --- clutter/clutter/clutter-paint-nodes.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c index a6c65aae7..72d21788c 100644 --- a/clutter/clutter/clutter-paint-nodes.c +++ b/clutter/clutter/clutter-paint-nodes.c @@ -1426,6 +1426,7 @@ clutter_layer_node_new (const CoglMatrix *projection, guint8 opacity) { ClutterLayerNode *res; + CoglContext *context; CoglTexture *texture; CoglColor color; @@ -1438,10 +1439,12 @@ clutter_layer_node_new (const CoglMatrix *projection, res->opacity = opacity; /* the texture backing the FBO */ - texture = cogl_texture_new_with_size (MAX (res->fbo_width, 1), - MAX (res->fbo_height, 1), - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_RGBA_8888_PRE); + context = clutter_backend_get_cogl_context (clutter_get_default_backend ()); + + texture = cogl_texture_2d_new_with_size (context, + 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)); if (res->offscreen == NULL)