[cogl-texture-2d-sliced] allow COGL_FORMAT_ANY with _new_with_size()
authorRobert Bragg <robert@linux.intel.com>
Sat, 31 Oct 2009 00:01:44 +0000 (00:01 +0000)
committerRobert Bragg <robert@linux.intel.com>
Wed, 4 Nov 2009 03:34:07 +0000 (03:34 +0000)
It's useful when initialzing offscreen draw buffers to be able to ask
Cogl to create a texture of a given size and with the default internal
pixel format.

clutter/cogl/cogl/cogl-texture-2d-sliced.c

index 9b70860..52eec49 100644 (file)
@@ -907,7 +907,7 @@ _cogl_texture_2d_sliced_new_with_size (unsigned int     width,
 
   /* Since no data, we need some internal format */
   if (internal_format == COGL_PIXEL_FORMAT_ANY)
-    return COGL_INVALID_HANDLE;
+    internal_format = COGL_PIXEL_FORMAT_RGBA_8888_PRE;
 
   /* Rowstride from width */
   bpp = _cogl_get_format_bpp (internal_format);