cogl-atlas-texture: Add a debug option to disable the atlas
authorNeil Roberts <neil@linux.intel.com>
Thu, 21 Jan 2010 15:34:19 +0000 (15:34 +0000)
committerNeil Roberts <neil@linux.intel.com>
Fri, 22 Jan 2010 15:54:15 +0000 (15:54 +0000)
If the user specifies the 'disable-atlas' debug option then no texture
will be put in the atlas.

clutter/cogl/cogl/cogl-atlas-texture.c
clutter/cogl/cogl/cogl-debug.c
clutter/cogl/cogl/cogl-debug.h

index 202f1e4..7d22918 100644 (file)
@@ -956,6 +956,11 @@ _cogl_atlas_texture_new_from_bitmap (CoglHandle       bmp_handle,
 
   g_return_val_if_fail (bmp_handle != COGL_INVALID_HANDLE, COGL_INVALID_HANDLE);
 
+  /* Don't put textures in the atlas if the user has explicitly
+     requested to disable it */
+  if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_ATLAS))
+    return COGL_INVALID_HANDLE;
+
   /* We can't put the texture in the atlas if there are any special
      flags. This precludes textures with COGL_TEXTURE_NO_ATLAS and
      COGL_TEXTURE_NO_SLICING from being atlased */
index bba75e5..1ee1805 100644 (file)
@@ -49,7 +49,8 @@ static const GDebugKey cogl_debug_keys[] = {
   { "matrices", COGL_DEBUG_MATRICES },
   { "force-scanline-paths", COGL_DEBUG_FORCE_SCANLINE_PATHS },
   { "atlas", COGL_DEBUG_ATLAS },
-  { "dump-atlas-image", COGL_DEBUG_DUMP_ATLAS_IMAGE }
+  { "dump-atlas-image", COGL_DEBUG_DUMP_ATLAS_IMAGE },
+  { "disable-atlas", COGL_DEBUG_DISABLE_ATLAS }
 };
 
 static const gint n_cogl_debug_keys = G_N_ELEMENTS (cogl_debug_keys);
index 864f50a..0c6fb4d 100644 (file)
@@ -47,7 +47,8 @@ typedef enum {
   COGL_DEBUG_MATRICES         = 1 << 15,
   COGL_DEBUG_FORCE_SCANLINE_PATHS = 1 << 16,
   COGL_DEBUG_ATLAS            = 1 << 17,
-  COGL_DEBUG_DUMP_ATLAS_IMAGE = 1 << 18
+  COGL_DEBUG_DUMP_ATLAS_IMAGE = 1 << 18,
+  COGL_DEBUG_DISABLE_ATLAS    = 1 << 19
 } CoglDebugFlags;
 
 #ifdef COGL_ENABLE_DEBUG