[Cogl] [PATCH 07/13] atlas: make zero size a programmer error

Robert Bragg robert at sixbynine.org
Wed Dec 11 10:31:28 PST 2013


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

Instead of throwing a CoglError exception if an application tries to
allocate a zero size atlas texture this make that a programmer error
instead.
---
 cogl/cogl-atlas-texture.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/cogl/cogl-atlas-texture.c b/cogl/cogl-atlas-texture.c
index cc231ae..ce7a9ea 100644
--- a/cogl/cogl-atlas-texture.c
+++ b/cogl/cogl-atlas-texture.c
@@ -651,15 +651,8 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
   CoglAtlasTexture *atlas_tex;
 
   /* We can't atlas zero-sized textures because it breaks the atlas
-     data structure */
-  if (width < 1 || height < 1)
-    {
-      _cogl_set_error (error,
-                       COGL_TEXTURE_ERROR,
-                       COGL_TEXTURE_ERROR_SIZE,
-                       "1x1 atlas textures not supported");
-      return NULL;
-    }
+   * data structure */
+  _COGL_RETURN_VAL_IF_FAIL (width > 0 && height > 0, NULL);
 
   /* If we can't use FBOs then it will be too slow to migrate textures
      and we shouldn't use the atlas */
-- 
1.8.3.1



More information about the Cogl mailing list