[mutter] clutter/canvas: Use cogl_texture_2d_new_from_bitmap



commit f25360677f35909c719134fd24287d65b0dade18
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Mar 30 15:51:34 2022 -0300

    clutter/canvas: Use cogl_texture_2d_new_from_bitmap
    
    cogl_texture_new_from_bitmap() is deprecated. Since this was the
    last usage of it, also drop cogl_texture_new_from_bitmap().
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2355>

 clutter/clutter/clutter-canvas.c         |  4 +---
 cogl/cogl/deprecated/cogl-auto-texture.c | 22 ----------------------
 cogl/cogl/deprecated/cogl-auto-texture.h | 22 ----------------------
 3 files changed, 1 insertion(+), 47 deletions(-)
---
diff --git a/clutter/clutter/clutter-canvas.c b/clutter/clutter/clutter-canvas.c
index 220daa7b27..a0c753d9fe 100644
--- a/clutter/clutter/clutter-canvas.c
+++ b/clutter/clutter/clutter-canvas.c
@@ -342,9 +342,7 @@ clutter_canvas_paint_content (ClutterContent      *content,
     g_clear_pointer (&priv->texture, cogl_object_unref);
 
   if (priv->texture == NULL)
-    priv->texture = cogl_texture_new_from_bitmap (priv->buffer,
-                                                  COGL_TEXTURE_NO_SLICING,
-                                                  CLUTTER_CAIRO_FORMAT_ARGB32);
+    priv->texture = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (priv->buffer));
 
   if (priv->texture == NULL)
     return;
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.c b/cogl/cogl/deprecated/cogl-auto-texture.c
index f8dbb2aa06..dd44db51fc 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.c
+++ b/cogl/cogl/deprecated/cogl-auto-texture.c
@@ -225,28 +225,6 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
   return tex;
 }
 
-CoglTexture *
-cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
-                              CoglTextureFlags flags,
-                              CoglPixelFormat internal_format)
-{
-  g_autoptr (GError) error = NULL;
-
-  CoglTexture *tex =
-    _cogl_texture_new_from_bitmap (bitmap,
-                                   flags,
-                                   internal_format,
-                                   FALSE, /* can't convert in-place */
-                                   &error);
-  if (!tex)
-    {
-      COGL_NOTE (TEXTURES, "Failed to create texture from bitmap: %s",
-                 error->message);
-      return NULL;
-    }
-  return tex;
-}
-
 CoglTexture *
 cogl_texture_new_from_file (const char        *filename,
                             CoglTextureFlags   flags,
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.h b/cogl/cogl/deprecated/cogl-auto-texture.h
index 1bfd472491..8ea4ac5c4a 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.h
+++ b/cogl/cogl/deprecated/cogl-auto-texture.h
@@ -102,28 +102,6 @@ cogl_texture_new_from_data (int width,
                             int rowstride,
                             const uint8_t *data);
 
-/**
- * cogl_texture_new_from_bitmap:
- * @bitmap: A #CoglBitmap pointer
- * @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE
- * @internal_format: the #CoglPixelFormat to use for the GPU storage of the
- * texture
- *
- * Creates a #CoglTexture from a #CoglBitmap.
- *
- * Return value: (transfer full): A newly created #CoglTexture or
- *               %NULL on failure
- *
- * Since: 1.0
- * Deprecated: 1.18: Use specific constructors such as
- *                   cogl_texture_2d_new_from_bitmap()
- */
-COGL_DEPRECATED_FOR (cogl_texture_2d_new_from_bitmap__OR__cogl_texture_2d_sliced_new_from_bitmap)
-COGL_EXPORT CoglTexture *
-cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
-                              CoglTextureFlags flags,
-                              CoglPixelFormat internal_format);
-
 G_END_DECLS
 
 #endif /* __COGL_AUTO_TEXTURE_H__ */


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