summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-24 20:25:27 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-24 20:29:57 +0000
commitc6dc27562abbc8ca9e873ad502ca49ae010461d2 (patch)
treeebc797d70e40fccf5b790a570acadcd8e5e71454
parent5baa63c634990810a66c3150b4f2b76fcee2df38 (diff)
uxa: Only recreate the glyph cache on *generational* updates
The screen resources are recreated when the screen is rotated as well, without being finalized. In this case, we do not need to reconstuct the cache (or if we did, we would need to tear it down first). Reported-by: Till Matthiesen <entropy@everymail.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33412 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--uxa/uxa-glyphs.c20
-rw-r--r--uxa/uxa-priv.h1
2 files changed, 10 insertions, 11 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 420e8915..0f5dddad 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -111,6 +111,9 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
int i;
+ if (!uxa_screen->glyph_cache_initialized)
+ return;
+
for (i = 0; i < UXA_NUM_GLYPH_CACHE_FORMATS; i++) {
uxa_glyph_cache_t *cache = &uxa_screen->glyphCaches[i];
@@ -120,6 +123,7 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
if (cache->glyphs)
free(cache->glyphs);
}
+ uxa_screen->glyph_cache_initialized = FALSE;
}
void uxa_glyphs_fini(ScreenPtr pScreen)
@@ -145,6 +149,10 @@ static Bool uxa_realize_glyph_caches(ScreenPtr pScreen)
};
int i;
+ if (uxa_screen->glyph_cache_initialized)
+ return TRUE;
+
+ uxa_screen->glyph_cache_initialized = TRUE;
memset(uxa_screen->glyphCaches, 0, sizeof(uxa_screen->glyphCaches));
for (i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) {
@@ -214,17 +222,7 @@ Bool uxa_glyphs_init(ScreenPtr pScreen)
if (uxa_get_screen(pScreen)->force_fallback)
return TRUE;
- /* We are trying to initialise per screen resources prior to the
- * complete initialisation of the screen. So ensure the components
- * that we depend upon are initialsed prior to our use.
- */
- if (!CreateScratchPixmapsForScreen(pScreen->myNum))
- return FALSE;
-
- if (!uxa_realize_glyph_caches(pScreen))
- return FALSE;
-
- return TRUE;
+ return uxa_realize_glyph_caches(pScreen);
}
/* The most efficient thing to way to upload the glyph to the screen
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index 92536cc0..ac206af2 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -139,6 +139,7 @@ typedef struct {
unsigned offScreenCounter;
uxa_glyph_cache_t glyphCaches[UXA_NUM_GLYPH_CACHE_FORMATS];
+ Bool glyph_cache_initialized;
PicturePtr solid_clear, solid_black, solid_white;
uxa_solid_cache_t solid_cache[UXA_NUM_SOLID_CACHE];