From a4e8e6dff9a0c26944a325e4017faa68d93ae5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 10 Sep 2014 16:20:46 +0900 Subject: [PATCH] glamor: Move 'glyph caches realized' check to glamor_realize_glyph_caches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And rename the boolean to reflect what it's about. Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher Signed-off-by: Keith Packard --- glamor/glamor_glyphs.c | 15 ++++++--------- glamor/glamor_priv.h | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/glamor/glamor_glyphs.c b/glamor/glamor_glyphs.c index f570d7519..b49176852 100644 --- a/glamor/glamor_glyphs.c +++ b/glamor/glamor_glyphs.c @@ -269,7 +269,7 @@ glamor_unrealize_glyph_caches(ScreenPtr pScreen) glamor_screen_private *glamor = glamor_get_screen_private(pScreen); int i; - if (!glamor->glyph_cache_initialized) + if (!glamor->glyph_caches_realized) return; for (i = 0; i < GLAMOR_NUM_GLYPH_CACHE_FORMATS; i++) { @@ -284,7 +284,7 @@ glamor_unrealize_glyph_caches(ScreenPtr pScreen) if (mask_cache[i]) free(mask_cache[i]); } - glamor->glyph_cache_initialized = FALSE; + glamor->glyph_caches_realized = FALSE; } void @@ -314,6 +314,9 @@ glamor_realize_glyph_caches(ScreenPtr pScreen) }; int i; + if (glamor->glyph_caches_realized) + return TRUE; + memset(glamor->glyphCaches, 0, sizeof(glamor->glyphCaches)); for (i = 0; i < sizeof(formats) / sizeof(formats[0]); i++) { @@ -359,6 +362,7 @@ glamor_realize_glyph_caches(ScreenPtr pScreen) } assert(i == GLAMOR_NUM_GLYPH_CACHE_FORMATS); + glamor->glyph_caches_realized = TRUE; return TRUE; bail: @@ -375,17 +379,10 @@ glamor_realize_glyph_caches(ScreenPtr pScreen) Bool glamor_glyphs_init(ScreenPtr pScreen) { - glamor_screen_private *glamor = glamor_get_screen_private(pScreen); - - if (glamor->glyph_cache_initialized) - return TRUE; - if (!dixRegisterPrivateKey(&glamor_glyph_key, PRIVATE_GLYPH, sizeof(struct glamor_glyph))) return FALSE; - glamor->glyph_cache_initialized = TRUE; - return TRUE; } diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index 385c0279d..6ebb7b392 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -268,7 +268,7 @@ typedef struct glamor_screen_private { [SHADER_MASK_COUNT] [SHADER_IN_COUNT]; glamor_glyph_cache_t glyphCaches[GLAMOR_NUM_GLYPH_CACHE_FORMATS]; - Bool glyph_cache_initialized; + Bool glyph_caches_realized; /* shaders to restore a texture to another texture. */ GLint finish_access_prog[2];