From 1eb721680865658ed8ff04e13c81eb6a32b2b44c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 3 Feb 2012 15:29:20 +0100 Subject: Pass context explicitly to hash table functions. --- draw/draw_glyph.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'draw') diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c index 1edcef4a..d7704a57 100644 --- a/draw/draw_glyph.c +++ b/draw/draw_glyph.c @@ -49,19 +49,19 @@ fz_evict_glyph_cache(fz_context *ctx) fz_pixmap *pixmap; int i; - for (i = 0; i < fz_hash_len(cache->hash); i++) + for (i = 0; i < fz_hash_len(ctx, cache->hash); i++) { - key = fz_hash_get_key(cache->hash, i); + key = fz_hash_get_key(ctx, cache->hash, i); if (key->font) fz_drop_font(ctx, key->font); - pixmap = fz_hash_get_val(cache->hash, i); + pixmap = fz_hash_get_val(ctx, cache->hash, i); if (pixmap) fz_drop_pixmap(ctx, pixmap); } cache->total = 0; - fz_empty_hash(cache->hash); + fz_empty_hash(ctx, cache->hash); } void @@ -71,7 +71,7 @@ fz_free_glyph_cache_context(fz_context *ctx) return; fz_evict_glyph_cache(ctx); - fz_free_hash(ctx->glyph_cache->hash); + fz_free_hash(ctx, ctx->glyph_cache->hash); fz_free(ctx, ctx->glyph_cache); ctx->glyph_cache = NULL; } @@ -113,7 +113,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color key.e = (ctm.e - floorf(ctm.e)) * 256; key.f = (ctm.f - floorf(ctm.f)) * 256; - val = fz_hash_find(cache->hash, &key); + val = fz_hash_find(ctx, cache->hash, &key); if (val) return fz_keep_pixmap(ctx, val); @@ -142,7 +142,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color fz_evict_glyph_cache(ctx); fz_try(ctx) { - fz_hash_insert(cache->hash, &key, val); + fz_hash_insert(ctx, cache->hash, &key, val); fz_keep_font(key.font); val = fz_keep_pixmap(ctx, val); } -- cgit v1.2.3