[Cogl] [PATCH] texture: removes cogl_texture_new_from_sub_texture

Robert Bragg robert at sixbynine.org
Fri Sep 7 06:31:15 PDT 2012


From: Robert Bragg <robert at linux.intel.com>

cogl_texture_new_from_sub_texture is redundant since it's just a thin
wrapper around cogl_sub_texture_new() which relies on the
_COGL_GET_CONTEXT() macro we are trying to eradicated. This patch removes
the wrapper.
---
 cogl/cogl-texture.c |   13 -------------
 cogl/cogl-texture.h |   30 ------------------------------
 cogl/cogl.symbols   |    1 -
 3 files changed, 0 insertions(+), 44 deletions(-)

diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 1d7e938..116f077 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -516,19 +516,6 @@ _cogl_texture_is_foreign (CoglTexture *texture)
     return FALSE;
 }
 
-CoglTexture *
-cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
-                                   int sub_x,
-                                   int sub_y,
-                                   int sub_width,
-                                   int sub_height)
-{
-  _COGL_GET_CONTEXT (ctx, NULL);
-  return COGL_TEXTURE (cogl_sub_texture_new (ctx,
-                                             full_texture, sub_x, sub_y,
-                                             sub_width, sub_height));
-}
-
 unsigned int
 cogl_texture_get_width (CoglTexture *texture)
 {
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 7f2d48f..87260c8 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -454,36 +454,6 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
                                      unsigned int dst_height,
                                      CoglBitmap *bitmap);
 
-/**
- * cogl_texture_new_from_sub_texture:
- * @full_texture: a #CoglTexture pointer
- * @sub_x: X coordinate of the top-left of the subregion
- * @sub_y: Y coordinate of the top-left of the subregion
- * @sub_width: Width in pixels of the subregion
- * @sub_height: Height in pixels of the subregion
- *
- * Creates a new texture which represents a subregion of another
- * texture. The GL resources will be shared so that no new texture
- * data is actually allocated.
- *
- * Sub textures have undefined behaviour texture coordinates outside
- * of the range [0,1] are used. They also do not work with
- * CoglVertexBuffers.
- *
- * The sub texture will keep a reference to the full texture so you do
- * not need to keep one separately if you only want to use the sub
- * texture.
- *
- * Return value: A newly created #CoglTexture or %NULL on failure
- * Since: 1.2
- */
-CoglTexture *
-cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
-                                   int sub_x,
-                                   int sub_y,
-                                   int sub_width,
-                                   int sub_height);
-
 G_END_DECLS
 
 #endif /* __COGL_TEXTURE_H__ */
diff --git a/cogl/cogl.symbols b/cogl/cogl.symbols
index 9deeece..041de9f 100644
--- a/cogl/cogl.symbols
+++ b/cogl/cogl.symbols
@@ -567,7 +567,6 @@ cogl_texture_new_from_bitmap
 cogl_texture_new_from_data
 cogl_texture_new_from_file
 cogl_texture_new_from_foreign
-cogl_texture_new_from_sub_texture
 cogl_texture_new_with_size
 #ifdef COGL_HAS_X11
 cogl_texture_pixmap_x11_error_domain
-- 
1.7.7.6



More information about the Cogl mailing list