[Cogl] [PATCH] texture: remove cogl_texture_get_rowstride
Robert Bragg
robert at sixbynine.org
Fri Sep 7 06:31:21 PDT 2012
From: Robert Bragg <robert at linux.intel.com>
cogl_texture_get_rowstride was a nonsensical api to have ever been added
and has been marked as deprecated for some time now so this patch
removes the function.
---
cogl/cogl-texture.c | 13 -------------
cogl/cogl-texture.h | 39 +++------------------------------------
cogl/cogl.symbols | 1 -
3 files changed, 3 insertions(+), 50 deletions(-)
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 116f077..3ef45cf 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -534,19 +534,6 @@ cogl_texture_get_format (CoglTexture *texture)
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)
{
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 87260c8..69d6da0 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -276,38 +276,6 @@ cogl_texture_get_height (CoglTexture *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.
- */
-unsigned int
-cogl_texture_get_rowstride (CoglTexture *texture);
-
/**
* cogl_texture_get_max_waste:
* @texture a #CoglTexture pointer.
@@ -366,10 +334,9 @@ cogl_texture_get_gl_texture (CoglTexture *texture,
*
* Copies the pixel data from a cogl texture to system memory.
*
- * <note>Don't pass the value of cogl_texture_get_rowstride() as the
- * @rowstride argument, the rowstride should be the rowstride you
- * want for the destination @data buffer not the rowstride of the
- * source texture</note>
+ * <note>The rowstride should be the rowstride you want for the
+ * destination @data buffer you don't need to try and calculate the
+ * rowstride of the source texture</note>
*
* Return value: the size of the texture data in bytes
*/
diff --git a/cogl/cogl.symbols b/cogl/cogl.symbols
index 041de9f..71ee4de 100644
--- a/cogl/cogl.symbols
+++ b/cogl/cogl.symbols
@@ -560,7 +560,6 @@ cogl_texture_get_format
cogl_texture_get_gl_texture
cogl_texture_get_height
cogl_texture_get_max_waste
-cogl_texture_get_rowstride
cogl_texture_get_width
cogl_texture_is_sliced
cogl_texture_new_from_bitmap
--
1.7.7.6
More information about the Cogl
mailing list