[mutter/gbsneto/layer-node-cleanups: 5/6] clutter/layer-node: Use non-deprecated cogl_texture_2d_new_with_size()



commit b37b4f50271b4e985cc22d2e89c836941880c718
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Mar 30 21:51:33 2020 -0300

    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 bb9b79a9f..5986250d9 100644
--- a/clutter/clutter/clutter-paint-nodes.c
+++ b/clutter/clutter/clutter-paint-nodes.c
@@ -1423,6 +1423,7 @@ clutter_layer_node_new (const CoglMatrix        *projection,
                         guint8                   opacity)
 {
   ClutterLayerNode *res;
+  CoglContext *context;
   CoglTexture *texture;
   CoglColor color;
 
@@ -1435,10 +1436,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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]