[cogl/cogl-1.18] texture: make cogl_texture_get_format api private



commit 99cdcc9e3c8db152258a3b416143830924613a7b
Author: Robert Bragg <robert linux intel com>
Date:   Thu Jun 27 18:33:04 2013 +0100

    texture: make cogl_texture_get_format api private
    
    CoglPixelFormat is not a good way of describing the internal
    format of a texture because it's too specific given that we don't
    actually have exact knowledge of the internal format used by the driver.
    
    This makes cogl_texture_get_format private and in the future we'll
    provide a better way of querying the channels and their precision.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
    
    (cherry picked from commit ffde82981f22bd0185a7f33e1e6e1479f4c295b8)
    
    Note: Since we can't break API compatibility on the 1.x branch this adds
    a cogl/deprecated/cogl-texture-deprecated.c file with a
    cogl_texture_get_format() wrapper around the private api. This also
    moves the cogl_texture_get_rowstride() and cogl_texture_ref/unref()
    functions that were previously deprecated into cogl-texture-deprecated.c

 cogl-pango/cogl-pango-pipeline-cache.c             |    2 +-
 cogl-pango/cogl-pango-render.c                     |    2 +-
 cogl/Makefile.am                                   |    4 +-
 cogl/cogl-atlas-texture.c                          |    2 +-
 cogl/cogl-blit.c                                   |    6 +-
 cogl/cogl-framebuffer.c                            |    2 +-
 cogl/cogl-pipeline-layer.c                         |    2 +-
 cogl/cogl-sub-texture.c                            |    2 +-
 cogl/cogl-texture-2d-sliced.c                      |    4 +-
 cogl/cogl-texture-private.h                        |    3 +
 cogl/cogl-texture-rectangle.c                      |    2 +-
 cogl/cogl-texture.c                                |   50 +---------
 cogl/cogl-texture.h                                |   70 --------------
 cogl/cogl.h                                        |    1 +
 cogl/deprecated/cogl-texture-deprecated.c          |   79 ++++++++++++++++
 cogl/deprecated/cogl-texture-deprecated.h          |   99 ++++++++++++++++++++
 cogl/driver/gl/cogl-framebuffer-gl.c               |    4 +-
 cogl/driver/gl/cogl-texture-2d-gl.c                |    2 +-
 cogl/winsys/cogl-texture-pixmap-x11.c              |    2 +-
 .../cogl-2.0-experimental-sections.txt             |    1 -
 20 files changed, 205 insertions(+), 134 deletions(-)
---
diff --git a/cogl-pango/cogl-pango-pipeline-cache.c b/cogl-pango/cogl-pango-pipeline-cache.c
index 1dba447..92258a0 100644
--- a/cogl-pango/cogl-pango-pipeline-cache.c
+++ b/cogl-pango/cogl-pango-pipeline-cache.c
@@ -185,7 +185,7 @@ _cogl_pango_pipeline_cache_get (CoglPangoPipelineCache *cache,
 
       entry->texture = cogl_object_ref (texture);
 
-      if (cogl_texture_get_format (entry->texture) == COGL_PIXEL_FORMAT_A_8)
+      if (_cogl_texture_get_format (entry->texture) == COGL_PIXEL_FORMAT_A_8)
         base = get_base_texture_alpha_pipeline (cache);
       else
         base = get_base_texture_rgba_pipeline (cache);
diff --git a/cogl-pango/cogl-pango-render.c b/cogl-pango/cogl-pango-render.c
index 082114d..0595c58 100644
--- a/cogl-pango/cogl-pango-render.c
+++ b/cogl-pango/cogl-pango-render.c
@@ -575,7 +575,7 @@ cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
      here */
   _COGL_RETURN_IF_FAIL (value->texture != NULL);
 
-  if (cogl_texture_get_format (value->texture) == COGL_PIXEL_FORMAT_A_8)
+  if (_cogl_texture_get_format (value->texture) == COGL_PIXEL_FORMAT_A_8)
     {
       format_cairo = CAIRO_FORMAT_A8;
       format_cogl = COGL_PIXEL_FORMAT_A_8;
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 337d59d..b9f63c3 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -77,6 +77,7 @@ cogl_deprecated_h = \
        $(srcdir)/deprecated/cogl-clutter.h             \
        $(srcdir)/deprecated/cogl-type-casts.h          \
        $(srcdir)/deprecated/cogl-framebuffer-deprecated.h \
+       $(srcdir)/deprecated/cogl-texture-deprecated.h  \
        $(NULL)
 
 # public 1.x api headers
@@ -403,6 +404,7 @@ cogl_sources_c = \
        $(srcdir)/deprecated/cogl-shader.c                      \
        $(srcdir)/deprecated/cogl-clutter.c                     \
        $(srcdir)/deprecated/cogl-framebuffer-deprecated.c      \
+       $(srcdir)/deprecated/cogl-texture-deprecated.c          \
        $(NULL)
 
 if USE_GLIB
@@ -539,7 +541,7 @@ libcogl_la_LDFLAGS = \
        -no-undefined \
        -version-info @COGL_LT_CURRENT@:@COGL_LT_REVISION@:@COGL_LT_AGE@ \
        -export-dynamic \
-       -export-symbols-regex 
"^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_foreach_sub_texture_in_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_).*"
+       -export-symbols-regex 
"^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_).*"
 
 libcogl_la_SOURCES = $(cogl_sources_c)
 nodist_libcogl_la_SOURCES = $(BUILT_SOURCES)
diff --git a/cogl/cogl-atlas-texture.c b/cogl/cogl-atlas-texture.c
index 2ae71b3..da27f0e 100644
--- a/cogl/cogl-atlas-texture.c
+++ b/cogl/cogl-atlas-texture.c
@@ -524,7 +524,7 @@ _cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex,
 
   /* We'll prepare to upload using the format of the actual texture of
      the atlas texture instead of the format reported by
-     cogl_texture_get_format which would be the original internal
+     _cogl_texture_get_format which would be the original internal
      format specified when the texture was created. However we'll
      preserve the premult status of the internal format because the
      images are all stored in the original premult format of the
diff --git a/cogl/cogl-blit.c b/cogl/cogl-blit.c
index 466d740..10cb666 100644
--- a/cogl/cogl-blit.c
+++ b/cogl/cogl-blit.c
@@ -151,8 +151,8 @@ _cogl_blit_framebuffer_begin (CoglBlitData *data)
 
   /* We can only blit between FBOs if both textures are the same
      format and the blit framebuffer extension is supported */
-  if ((cogl_texture_get_format (data->src_tex) & ~COGL_A_BIT) !=
-      (cogl_texture_get_format (data->dst_tex) & ~COGL_A_BIT) ||
+  if ((_cogl_texture_get_format (data->src_tex) & ~COGL_A_BIT) !=
+      (_cogl_texture_get_format (data->dst_tex) & ~COGL_A_BIT) ||
       !_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT))
     return FALSE;
 
@@ -269,7 +269,7 @@ _cogl_blit_copy_tex_sub_image_end (CoglBlitData *data)
 static CoglBool
 _cogl_blit_get_tex_data_begin (CoglBlitData *data)
 {
-  data->format = cogl_texture_get_format (data->src_tex);
+  data->format = _cogl_texture_get_format (data->src_tex);
   data->bpp = _cogl_pixel_format_get_bytes_per_pixel (data->format);
 
   data->image_data = g_malloc (data->bpp * data->src_width *
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 886155b..d024bb5 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -783,7 +783,7 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
       /* Forward the texture format as the internal format of the
        * framebuffer */
       framebuffer->internal_format =
-        cogl_texture_get_format (offscreen->texture);
+        _cogl_texture_get_format (offscreen->texture);
 
       if (!ctx->driver_vtable->offscreen_allocate (offscreen, error))
         return FALSE;
diff --git a/cogl/cogl-pipeline-layer.c b/cogl/cogl-pipeline-layer.c
index ec850c1..56a3225 100644
--- a/cogl/cogl-pipeline-layer.c
+++ b/cogl/cogl-pipeline-layer.c
@@ -110,7 +110,7 @@ _cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer)
     _cogl_pipeline_layer_get_authority (layer,
                                         COGL_PIPELINE_LAYER_STATE_TEXTURE_DATA);
   if (tex_authority->texture &&
-      cogl_texture_get_format (tex_authority->texture) & COGL_A_BIT)
+      _cogl_texture_get_format (tex_authority->texture) & COGL_A_BIT)
     {
       return TRUE;
     }
diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c
index 9a308be..f9a3562 100644
--- a/cogl/cogl-sub-texture.c
+++ b/cogl/cogl-sub-texture.c
@@ -419,7 +419,7 @@ _cogl_sub_texture_get_format (CoglTexture *tex)
 {
   CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
 
-  return cogl_texture_get_format (sub_tex->full_texture);
+  return _cogl_texture_get_format (sub_tex->full_texture);
 }
 
 static GLenum
diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c
index 9d8282b..e2e9f51 100644
--- a/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl-texture-2d-sliced.c
@@ -1080,7 +1080,7 @@ _cogl_texture_2d_sliced_new_from_foreign (CoglContext *ctx,
   /* The texture 2d backend may use a different pixel format if it
      queries the actual texture so we'll refetch the format it
      actually used */
-  format = cogl_texture_get_format (COGL_TEXTURE (tex_2d));
+  format = _cogl_texture_get_format (COGL_TEXTURE (tex_2d));
 
   /* Create new texture */
   tex_2ds = g_new0 (CoglTexture2DSliced, 1);
@@ -1404,7 +1404,7 @@ _cogl_texture_2d_sliced_set_region (CoglTexture *tex,
   CoglBool status;
 
   upload_bmp = _cogl_bitmap_convert_for_upload (bmp,
-                                                cogl_texture_get_format (tex),
+                                                _cogl_texture_get_format (tex),
                                                 FALSE, /* can't convert in
                                                           place */
                                                 error);
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h
index b17dc25..a18cd31 100644
--- a/cogl/cogl-texture-private.h
+++ b/cogl/cogl-texture-private.h
@@ -308,4 +308,7 @@ void
 _cogl_texture_set_allocated (CoglTexture *texture,
                              CoglBool allocated);
 
+CoglPixelFormat
+_cogl_texture_get_format (CoglTexture *texture);
+
 #endif /* __COGL_TEXTURE_PRIVATE_H */
diff --git a/cogl/cogl-texture-rectangle.c b/cogl/cogl-texture-rectangle.c
index 9468369..597d2a4 100644
--- a/cogl/cogl-texture-rectangle.c
+++ b/cogl/cogl-texture-rectangle.c
@@ -602,7 +602,7 @@ _cogl_texture_rectangle_set_region (CoglTexture *tex,
 
   upload_bmp =
     _cogl_bitmap_convert_for_upload (bmp,
-                                     cogl_texture_get_format (tex),
+                                     _cogl_texture_get_format (tex),
                                      FALSE, /* can't convert in place */
                                      error);
   if (upload_bmp == NULL)
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 09da3af..84b43ee 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -102,35 +102,6 @@ cogl_is_texture (void *object)
   return FALSE;
 }
 
-void *
-cogl_texture_ref (void *object)
-{
-  if (!cogl_is_texture (object))
-    return NULL;
-
-  _COGL_OBJECT_DEBUG_REF (CoglTexture, object);
-
-  cogl_object_ref (object);
-
-  return object;
-}
-
-void
-cogl_texture_unref (void *object)
-{
-  if (!cogl_is_texture (object))
-    {
-      g_warning (G_STRINGIFY (cogl_texture_unref)
-                 ": Ignoring unref of CoglObject "
-                 "due to type mismatch");
-      return;
-    }
-
-  _COGL_OBJECT_DEBUG_UNREF (CoglTexture, object);
-
-  cogl_object_unref (object);
-}
-
 void
 _cogl_texture_init (CoglTexture *texture,
                     CoglContext *context,
@@ -227,26 +198,13 @@ cogl_texture_get_height (CoglTexture *texture)
 }
 
 CoglPixelFormat
-cogl_texture_get_format (CoglTexture *texture)
+_cogl_texture_get_format (CoglTexture *texture)
 {
   if (!texture->allocated)
     cogl_texture_allocate (texture, NULL);
   return texture->vtable->get_format (texture);
 }
 
-unsigned int
-cogl_texture_get_rowstride (CoglTexture *texture)
-{
-  CoglPixelFormat format = cogl_texture_get_format (texture);
-  /* FIXME: This function should go away. It previously just returned
-     the rowstride that was used to upload the data as far as I can
-     tell. This is not helpful */
-
-  /* Just guess at a suitable rowstride */
-  return (_cogl_pixel_format_get_bytes_per_pixel (format)
-          * cogl_texture_get_width (texture));
-}
-
 int
 cogl_texture_get_max_waste (CoglTexture *texture)
 {
@@ -416,7 +374,7 @@ _cogl_texture_set_region_from_bitmap (CoglTexture *texture,
   /* Note that we don't prepare the bitmap for upload here because
      some backends may be internally using a different format for the
      actual GL texture than that reported by
-     cogl_texture_get_format. For example the atlas textures are
+     _cogl_texture_get_format. For example the atlas textures are
      always stored in an RGBA texture even if the texture format is
      advertised as RGB. */
 
@@ -750,7 +708,7 @@ _cogl_texture_draw_and_read (CoglTexture *texture,
    *
    * TODO: verify if this is still an issue
    */
-  if ((cogl_texture_get_format (texture) & COGL_A_BIT)/* && a_bits == 0*/)
+  if ((_cogl_texture_get_format (texture) & COGL_A_BIT)/* && a_bits == 0*/)
     {
       uint8_t *srcdata;
       uint8_t *dstdata;
@@ -1040,7 +998,7 @@ cogl_texture_get_data (CoglTexture *texture,
 
   CoglTextureGetData tg_data;
 
-  texture_format = cogl_texture_get_format (texture);
+  texture_format = _cogl_texture_get_format (texture);
 
   /* Default to internal format if none specified */
   if (format == COGL_PIXEL_FORMAT_ANY)
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index a371f5b..2e3f25b 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -279,50 +279,6 @@ unsigned int
 cogl_texture_get_height (CoglTexture *texture);
 
 /**
- * cogl_texture_get_format:
- * @texture: a #CoglTexture pointer.
- *
- * Queries the #CoglPixelFormat of a cogl texture.
- *
- * Return value: the #CoglPixelFormat of the GPU side texture
- */
-CoglPixelFormat
-cogl_texture_get_format (CoglTexture *texture);
-
-
-/**
- * cogl_texture_get_rowstride:
- * @texture a #CoglTexture pointer.
- *
- * Determines the bytes-per-pixel for the #CoglPixelFormat retrieved
- * from cogl_texture_get_format() and multiplies that by the texture's
- * width.
- *
- * <note>It's very unlikely that anyone would need to use this API to
- * query the internal rowstride of a #CoglTexture which can just be
- * considered an implementation detail. Actually it's not even useful
- * internally since underlying drivers are free to use a different
- * format</note>
- *
- * <note>This API is only here for backwards compatibility and
- * shouldn't be used in new code. In particular please don't be
- * mislead to pass the returned value to cogl_texture_get_data() for
- * the rowstride, since you should be passing the rowstride you desire
- * for your destination buffer not the rowstride of the source
- * texture.</note>
- *
- * Return value: The bytes-per-pixel for the current format
- *               multiplied by the texture's width
- *
- * Deprecated: 1.10: There's no replacement for the API but there's
- *                   also no known need for API either. It was just
- *                   a mistake that it was ever published.
- */
-COGL_DEPRECATED_IN_1_10
-unsigned int
-cogl_texture_get_rowstride (CoglTexture *texture);
-
-/**
  * cogl_texture_get_max_waste:
  * @texture: a #CoglTexture pointer.
  *
@@ -563,32 +519,6 @@ cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
                                    int sub_height);
 
 /**
- * cogl_texture_ref: (skip)
- * @texture: a #CoglTexture.
- *
- * Increment the reference count for a cogl texture.
- *
- * Deprecated: 1.2: Use cogl_object_ref() instead
- *
- * Return value: the @texture pointer.
- */
-COGL_DEPRECATED_FOR (cogl_object_ref)
-void *
-cogl_texture_ref (void *texture);
-
-/**
- * cogl_texture_unref: (skip)
- * @texture: a #CoglTexture.
- *
- * Decrement the reference count for a cogl texture.
- *
- * Deprecated: 1.2: Use cogl_object_unref() instead
- */
-COGL_DEPRECATED_FOR (cogl_object_unref)
-void
-cogl_texture_unref (void *texture);
-
-/**
  * cogl_texture_allocate:
  * @texture: A #CoglTexture
  * @error: A #CoglError to return exceptional errors or %NULL
diff --git a/cogl/cogl.h b/cogl/cogl.h
index b316cd1..56fd6c3 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -80,6 +80,7 @@
 #include <cogl/deprecated/cogl-material-compat.h>
 #include <cogl/deprecated/cogl-shader.h>
 #include <cogl/deprecated/cogl-framebuffer-deprecated.h>
+#include <cogl/deprecated/cogl-texture-deprecated.h>
 #endif
 
 /* It would be good to move these casts up into 1.x only api if we can
diff --git a/cogl/deprecated/cogl-texture-deprecated.c b/cogl/deprecated/cogl-texture-deprecated.c
new file mode 100644
index 0000000..df23a37
--- /dev/null
+++ b/cogl/deprecated/cogl-texture-deprecated.c
@@ -0,0 +1,79 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#include <config.h>
+
+#include "cogl-types.h"
+#include "cogl-texture.h"
+#include "cogl-texture-private.h"
+#include "cogl-object-private.h"
+#include "deprecated/cogl-texture-deprecated.h"
+
+CoglPixelFormat
+cogl_texture_get_format (CoglTexture *texture)
+{
+  return _cogl_texture_get_format (texture);
+}
+
+unsigned int
+cogl_texture_get_rowstride (CoglTexture *texture)
+{
+  CoglPixelFormat format = cogl_texture_get_format (texture);
+  /* FIXME: This function should go away. It previously just returned
+     the rowstride that was used to upload the data as far as I can
+     tell. This is not helpful */
+
+  /* Just guess at a suitable rowstride */
+  return (_cogl_pixel_format_get_bytes_per_pixel (format)
+          * cogl_texture_get_width (texture));
+}
+
+void *
+cogl_texture_ref (void *object)
+{
+  if (!cogl_is_texture (object))
+    return NULL;
+
+  _COGL_OBJECT_DEBUG_REF (CoglTexture, object);
+
+  cogl_object_ref (object);
+
+  return object;
+}
+
+void
+cogl_texture_unref (void *object)
+{
+  if (!cogl_is_texture (object))
+    {
+      g_warning (G_STRINGIFY (cogl_texture_unref)
+                 ": Ignoring unref of CoglObject "
+                 "due to type mismatch");
+      return;
+    }
+
+  _COGL_OBJECT_DEBUG_UNREF (CoglTexture, object);
+
+  cogl_object_unref (object);
+}
diff --git a/cogl/deprecated/cogl-texture-deprecated.h b/cogl/deprecated/cogl-texture-deprecated.h
new file mode 100644
index 0000000..2e981c9
--- /dev/null
+++ b/cogl/deprecated/cogl-texture-deprecated.h
@@ -0,0 +1,99 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#ifndef __COGL_TEXTURE_DEPRECATED_H__
+#define __COGL_TEXTURE_DEPRECATED_H__
+
+/**
+ * cogl_texture_get_format:
+ * @texture: a #CoglTexture pointer.
+ *
+ * Queries the #CoglPixelFormat of a cogl texture.
+ *
+ * Return value: the #CoglPixelFormat of the GPU side texture
+ * Deprecated: 1.18: This api is misleading
+ */
+COGL_DEPRECATED_IN_1_18
+CoglPixelFormat
+cogl_texture_get_format (CoglTexture *texture);
+
+/**
+ * cogl_texture_get_rowstride:
+ * @texture a #CoglTexture pointer.
+ *
+ * Determines the bytes-per-pixel for the #CoglPixelFormat retrieved
+ * from cogl_texture_get_format() and multiplies that by the texture's
+ * width.
+ *
+ * <note>It's very unlikely that anyone would need to use this API to
+ * query the internal rowstride of a #CoglTexture which can just be
+ * considered an implementation detail. Actually it's not even useful
+ * internally since underlying drivers are free to use a different
+ * format</note>
+ *
+ * <note>This API is only here for backwards compatibility and
+ * shouldn't be used in new code. In particular please don't be
+ * mislead to pass the returned value to cogl_texture_get_data() for
+ * the rowstride, since you should be passing the rowstride you desire
+ * for your destination buffer not the rowstride of the source
+ * texture.</note>
+ *
+ * Return value: The bytes-per-pixel for the current format
+ *               multiplied by the texture's width
+ *
+ * Deprecated: 1.10: There's no replacement for the API but there's
+ *                   also no known need for API either. It was just
+ *                   a mistake that it was ever published.
+ */
+COGL_DEPRECATED_IN_1_10
+unsigned int
+cogl_texture_get_rowstride (CoglTexture *texture);
+
+/**
+ * cogl_texture_ref: (skip)
+ * @texture: a #CoglTexture.
+ *
+ * Increment the reference count for a cogl texture.
+ *
+ * Deprecated: 1.2: Use cogl_object_ref() instead
+ *
+ * Return value: the @texture pointer.
+ */
+COGL_DEPRECATED_FOR (cogl_object_ref)
+void *
+cogl_texture_ref (void *texture);
+
+/**
+ * cogl_texture_unref: (skip)
+ * @texture: a #CoglTexture.
+ *
+ * Decrement the reference count for a cogl texture.
+ *
+ * Deprecated: 1.2: Use cogl_object_unref() instead
+ */
+COGL_DEPRECATED_FOR (cogl_object_unref)
+void
+cogl_texture_unref (void *texture);
+
+#endif /* __COGL_TEXTURE_DEPRECATED_H__ */
diff --git a/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/driver/gl/cogl-framebuffer-gl.c
index 5b62cd0..06a2d48 100644
--- a/cogl/driver/gl/cogl-framebuffer-gl.c
+++ b/cogl/driver/gl/cogl-framebuffer-gl.c
@@ -416,7 +416,7 @@ attach_depth_texture (CoglContext *ctx,
     {
       /* attach a GL_DEPTH_STENCIL texture to the GL_DEPTH_ATTACHMENT and
        * GL_STENCIL_ATTACHMENT attachement points */
-      g_assert (cogl_texture_get_format (depth_texture) ==
+      g_assert (_cogl_texture_get_format (depth_texture) ==
                 COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8);
 
       cogl_texture_get_gl_texture (depth_texture,
@@ -435,7 +435,7 @@ attach_depth_texture (CoglContext *ctx,
     {
       /* attach a newly created GL_DEPTH_COMPONENT16 texture to the
        * GL_DEPTH_ATTACHMENT attachement point */
-      g_assert (cogl_texture_get_format (depth_texture) ==
+      g_assert (_cogl_texture_get_format (depth_texture) ==
                 COGL_PIXEL_FORMAT_DEPTH_16);
 
       cogl_texture_get_gl_texture (COGL_TEXTURE (depth_texture),
diff --git a/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/driver/gl/cogl-texture-2d-gl.c
index b2829af..eea1792 100644
--- a/cogl/driver/gl/cogl-texture-2d-gl.c
+++ b/cogl/driver/gl/cogl-texture-2d-gl.c
@@ -571,7 +571,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
 
   upload_bmp =
     _cogl_bitmap_convert_for_upload (bmp,
-                                     cogl_texture_get_format (tex),
+                                     _cogl_texture_get_format (tex),
                                      FALSE, /* can't convert in place */
                                      error);
   if (upload_bmp == NULL)
diff --git a/cogl/winsys/cogl-texture-pixmap-x11.c b/cogl/winsys/cogl-texture-pixmap-x11.c
index 18f7373..1e01a93 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.c
+++ b/cogl/winsys/cogl-texture-pixmap-x11.c
@@ -994,7 +994,7 @@ _cogl_texture_pixmap_x11_get_format (CoglTexture *tex)
   CoglTexture *child_tex = _cogl_texture_pixmap_x11_get_texture (tex_pixmap);
 
   /* Forward on to the child texture */
-  return cogl_texture_get_format (child_tex);
+  return _cogl_texture_get_format (child_tex);
 }
 
 static GLenum
diff --git a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt 
b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt
index 1f757fe..d8f75b5 100644
--- a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt
+++ b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt
@@ -402,7 +402,6 @@ cogl_is_texture
 <SUBSECTION>
 cogl_texture_get_width
 cogl_texture_get_height
-cogl_texture_get_format
 cogl_texture_is_sliced
 cogl_texture_get_data
 cogl_texture_set_data


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