diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-28 12:47:26 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-28 12:47:26 +0100 |
commit | 5b2254838eb89bf77eeb893c73eecb8c737822f4 (patch) | |
tree | 29abfa10b2bfa21c4a6a7da5e84f9b6ef911955f /uxa/uxa-glyphs.c | |
parent | 11581dda99cb2e4ae78fc73be4b02185b3be58ed (diff) |
uxa: Make the glyph caches' fixed size explicit.
Until we actual resize the glyph cache dynamically, make it obvious to
the reader and the compiler that the size is fixed.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa/uxa-glyphs.c')
-rw-r--r-- | uxa/uxa-glyphs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c index b0fdd5f7..f5495d61 100644 --- a/uxa/uxa-glyphs.c +++ b/uxa/uxa-glyphs.c @@ -67,6 +67,7 @@ * rendering to the mask or destination surface. */ #define GLYPH_BUFFER_SIZE 256 +#define GLYPH_CACHE_SIZE 256 typedef struct { PicturePtr source; @@ -128,7 +129,6 @@ void uxa_glyphs_init(ScreenPtr pScreen) for (i = 0; i < UXA_NUM_GLYPH_CACHES; i++) { uxa_screen->glyphCaches[i].columns = CACHE_PICTURE_WIDTH / uxa_screen->glyphCaches[i].glyphWidth; - uxa_screen->glyphCaches[i].size = 256; } } @@ -195,7 +195,7 @@ static Bool uxa_realize_glyph_caches(ScreenPtr pScreen, unsigned int format) cache->yOffset = height; - rows = (cache->size + cache->columns - 1) / cache->columns; + rows = (GLYPH_CACHE_SIZE + cache->columns - 1) / cache->columns; height += rows * cache->glyphHeight; } @@ -231,13 +231,13 @@ static Bool uxa_realize_glyph_caches(ScreenPtr pScreen, unsigned int format) cache->picture = pPicture; cache->picture->refcnt++; cache->glyphs = - xcalloc(sizeof(GlyphPtr), cache->size); + xcalloc(sizeof(GlyphPtr), GLYPH_CACHE_SIZE); cache->glyphCount = 0; if (!cache->glyphs) goto bail; - cache->evictionPosition = rand() % cache->size; + cache->evictionPosition = rand() % GLYPH_CACHE_SIZE; } /* Each cache references the picture individually */ @@ -357,7 +357,7 @@ uxa_glyph_cache_buffer_glyph(ScreenPtr pScreen, cache->format == PICT_a8 ? "A" : "ARGB", (long)*(CARD32 *) pGlyph->sha1)); - if (cache->glyphCount < cache->size) { + if (cache->glyphCount < GLYPH_CACHE_SIZE) { /* Space remaining; we fill from the start */ pos = cache->glyphCount++; DBG_GLYPH_CACHE((" storing glyph in free space at %d\n", pos)); @@ -394,7 +394,7 @@ uxa_glyph_cache_buffer_glyph(ScreenPtr pScreen, } /* And pick a new eviction position */ - cache->evictionPosition = rand() % cache->size; + cache->evictionPosition = rand() % GLYPH_CACHE_SIZE; } /* Now actually upload the glyph into the cache picture; if |