diff --git a/cogl/cogl-auto-texture.c b/cogl/cogl-auto-texture.c index cf65e795b..b92212daa 100644 --- a/cogl/cogl-auto-texture.c +++ b/cogl/cogl-auto-texture.c @@ -109,14 +109,19 @@ cogl_texture_new_with_size (unsigned int width, internal_format)); } + /* NB: This api existed before Cogl introduced lazy allocation of + * textures and so we maintain its original synchronous allocation + * semantics and return NULL if allocation fails... */ + if (!cogl_texture_allocate (tex, &skip_error)) + { + cogl_error_free (skip_error); + cogl_object_unref (tex); + return NULL; + } + if (tex && flags & COGL_TEXTURE_NO_AUTO_MIPMAP) { - /* To be able to iterate the slices of a #CoglTexture2DSliced we - * need to ensure the texture is allocated... */ - if (!cogl_texture_allocate (tex, NULL)) - return NULL; - cogl_meta_texture_foreach_in_region (COGL_META_TEXTURE (tex), 0, 0, 1, 1, COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE, diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h index 6f304ab6d..46788847e 100644 --- a/cogl/cogl-texture.h +++ b/cogl/cogl-texture.h @@ -112,14 +112,7 @@ uint32_t cogl_texture_error_quark (void); * * Creates a new #CoglTexture with the specified dimensions and pixel format. * - * The storage for the texture is not necesarily created before this - * function returns. The storage can be explicitly allocated using - * cogl_texture_allocate() or preferably you can let Cogl - * automatically allocate the storage lazily when uploading data when - * Cogl may know more about how the texture will be used and can - * optimize how it is allocated. - * - * Return value: A newly created #CoglTexture + * Return value: A newly created #CoglTexture or %NULL on failure * * Since: 0.8 */