From d29b3c8f81d235aeac648df330bbd1a3acedfee6 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 1 Mar 2010 13:54:03 -0500 Subject: [PATCH] Fall back in _cogl_texture_2d_new_from_bitmap() Just like _cogl_texture_2d_new_with_size(), _cogl_texture_2d_new_from_bitmap() needs to check if an unsliced texture can be created at the given size, or if hardware limitations prevent this. http://bugzilla.openedhand.com/show_bug.cgi?id=2014 Signed-off-by: Neil Roberts --- cogl/cogl-texture-2d.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c index a6fb75d77..ff1d23c63 100644 --- a/cogl/cogl-texture-2d.c +++ b/cogl/cogl-texture-2d.c @@ -286,6 +286,9 @@ _cogl_texture_2d_new_from_bitmap (CoglHandle bmp_handle, g_return_val_if_fail (bmp_handle != COGL_INVALID_HANDLE, COGL_INVALID_HANDLE); + if (!_cogl_texture_2d_can_create (bmp->width, bmp->height, internal_format)) + return COGL_INVALID_HANDLE; + if (!_cogl_texture_prepare_for_upload (bmp, internal_format, &internal_format,