From 6d9458debb9eaa7db6750f5eb35c9f322c0b8b7e Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 30 Mar 2011 16:39:38 +0100 Subject: [PATCH] cogl-debug: Add an option to disable atlasing sharing If COGL_DEBUG contains disable-shared-atlas Cogl will not try to share the atlas between glyphs and images. --- clutter/cogl/cogl/cogl-debug-options.h | 6 ++++++ clutter/cogl/cogl/cogl-debug.c | 1 + clutter/cogl/cogl/cogl-debug.h | 1 + clutter/cogl/pango/cogl-pango-glyph-cache.c | 3 +++ 4 files changed, 11 insertions(+) diff --git a/clutter/cogl/cogl/cogl-debug-options.h b/clutter/cogl/cogl/cogl-debug-options.h index 38027f58f..58d1283ea 100644 --- a/clutter/cogl/cogl/cogl-debug-options.h +++ b/clutter/cogl/cogl/cogl-debug-options.h @@ -112,6 +112,12 @@ OPT (DISABLE_ATLAS, "disable-atlas", "Disable texture atlasing", "Disable use of texture atlasing") +OPT (DISABLE_SHARED_ATLAS, + "Root Cause", + "disable-shared-atlas", + "Disable sharing the texture atlas between text and images", + "When this is set the glyph cache will always use a separate texture " + "for its atlas. Otherwise it will try to share the atlas with images.") OPT (DISABLE_TEXTURING, "Root Cause", "disable-texturing", diff --git a/clutter/cogl/cogl/cogl-debug.c b/clutter/cogl/cogl/cogl-debug.c index c0f28d4c1..5b3ecc82b 100644 --- a/clutter/cogl/cogl/cogl-debug.c +++ b/clutter/cogl/cogl/cogl-debug.c @@ -68,6 +68,7 @@ static const GDebugKey cogl_behavioural_debug_keys[] = { { "disable-software-transform", COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM }, { "dump-atlas-image", COGL_DEBUG_DUMP_ATLAS_IMAGE }, { "disable-atlas", COGL_DEBUG_DISABLE_ATLAS }, + { "disable-shared-atlas", COGL_DEBUG_DISABLE_SHARED_ATLAS }, { "disable-texturing", COGL_DEBUG_DISABLE_TEXTURING}, { "disable-arbfp", COGL_DEBUG_DISABLE_ARBFP}, { "disable-fixed", COGL_DEBUG_DISABLE_FIXED}, diff --git a/clutter/cogl/cogl/cogl-debug.h b/clutter/cogl/cogl/cogl-debug.h index 15de706ff..294de8463 100644 --- a/clutter/cogl/cogl/cogl-debug.h +++ b/clutter/cogl/cogl/cogl-debug.h @@ -49,6 +49,7 @@ typedef enum { COGL_DEBUG_ATLAS, COGL_DEBUG_DUMP_ATLAS_IMAGE, COGL_DEBUG_DISABLE_ATLAS, + COGL_DEBUG_DISABLE_SHARED_ATLAS, COGL_DEBUG_OPENGL, COGL_DEBUG_DISABLE_TEXTURING, COGL_DEBUG_DISABLE_ARBFP, diff --git a/clutter/cogl/pango/cogl-pango-glyph-cache.c b/clutter/cogl/pango/cogl-pango-glyph-cache.c index 3c6ec5a59..bbcfe8f7c 100644 --- a/clutter/cogl/pango/cogl-pango-glyph-cache.c +++ b/clutter/cogl/pango/cogl-pango-glyph-cache.c @@ -204,6 +204,9 @@ cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache, { CoglHandle texture; + if (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_SHARED_ATLAS)) + return FALSE; + /* If the cache is using mipmapping then we can't use the global atlas because it would just get migrated back out */ if (cache->use_mipmapping)