summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-06-23 21:06:48 +0100
committerRobert Bragg <robert@linux.intel.com>2014-01-01 17:43:06 +0000
commitd3eaeedc86d408669b81d6c43ef2b0ab9d859c85 (patch)
treee63b411c2fb098cbebad02f68d62b0144f653f72
parent4868582812dbcd5125495b312d858f751fc31e9d (diff)
downloadcogl-d3eaeedc86d408669b81d6c43ef2b0ab9d859c85.tar.gz
atlas: make zero size a programmer error
Instead of throwing a CoglError exception if an application tries to allocate a zero size atlas texture this make that a programmer error instead. Reviewed-by: Neil Roberts <neil@linux.intel.com>
-rw-r--r--cogl/cogl-atlas-texture.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/cogl/cogl-atlas-texture.c b/cogl/cogl-atlas-texture.c
index cc231aec..ce7a9eab 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 */