From 47f1b2ebc917f5a6d6e4122c165bd9155acd3fe9 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 16 Feb 2010 12:01:18 +0000 Subject: [PATCH] cogl-atlas-texture: Don't use the atlas if FBOs aren't supported If FBOs aren't supported then it will end up very slow to reorganize the atlas. Also currently the CoglTexture2D backend will refuse to create any textures anyway so the full atlas texture won't be created. --- cogl/cogl-atlas-texture.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cogl/cogl-atlas-texture.c b/cogl/cogl-atlas-texture.c index 35cc9861c..4d91a9000 100644 --- a/cogl/cogl-atlas-texture.c +++ b/cogl/cogl-atlas-texture.c @@ -955,9 +955,11 @@ _cogl_atlas_texture_new_from_bitmap (CoglHandle bmp_handle, if (bmp->width < 1 || bmp->height < 1) return COGL_INVALID_HANDLE; - /* If we can't read back texture data then it will be too slow to - migrate textures and we shouldn't use the atlas */ - if (!cogl_features_available (COGL_FEATURE_TEXTURE_READ_PIXELS)) + /* If we can't use FBOs or we can't read back texture data then it + will be too slow to migrate textures and we shouldn't use the + atlas */ + if (!cogl_features_available (COGL_FEATURE_TEXTURE_READ_PIXELS) || + !cogl_features_available (COGL_FEATURE_OFFSCREEN)) return COGL_INVALID_HANDLE; COGL_NOTE (ATLAS, "Adding texture of size %ix%i", bmp->width, bmp->height);