1
0
Fork 0

cogl-atlas-texture: Add a debug option to disable the atlas

If the user specifies the 'disable-atlas' debug option then no texture
will be put in the atlas.
This commit is contained in:
Neil Roberts 2010-01-21 15:34:19 +00:00
parent 41a915ec00
commit 67fc6ead78
3 changed files with 9 additions and 2 deletions

View 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 */

View 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);

View 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