diff options
author | Benjamin Otte <otte@redhat.com> | 2010-05-12 21:14:36 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-05-13 12:11:09 +0200 |
commit | c69143e3f9c95ab3937a7efb8e4de170c4edb648 (patch) | |
tree | 0b98ff736fba7fb987e083ebea4ca2b0d304192c | |
parent | ec1ca17b71b41159ea8754d42954863b62623536 (diff) |
gl: Don't keep a temporary surface in the device
We get circular references that way.
If it turns out later such a cache is critical, we'll need to invent a
way to avoid circling references. For now, just pretend it's not
important.
-rw-r--r-- | src/cairo-gl-glyphs.c | 36 | ||||
-rw-r--r-- | src/cairo-gl-private.h | 1 |
2 files changed, 8 insertions, 29 deletions
diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c index f283f56a..217f4fb4 100644 --- a/src/cairo-gl-glyphs.c +++ b/src/cairo-gl-glyphs.c @@ -672,32 +672,13 @@ _cairo_gl_surface_show_glyphs_via_mask (cairo_gl_surface_t *dst, return status; /* XXX: For non-CA, this should be CAIRO_CONTENT_ALPHA to save memory */ - mask = NULL; - if (ctx->glyphs_temporary_mask) { - if (glyph_extents->width <= ctx->glyphs_temporary_mask->width && - glyph_extents->height <= ctx->glyphs_temporary_mask->height) - { - status = _cairo_gl_surface_clear (ctx->glyphs_temporary_mask); - if (unlikely (status)) { - _cairo_gl_context_release (ctx); - return status; - } - - mask = &ctx->glyphs_temporary_mask->base; - } else { - cairo_surface_destroy (&ctx->glyphs_temporary_mask->base); - ctx->glyphs_temporary_mask = NULL; - } - } - if (mask == NULL) { - mask = cairo_gl_surface_create (dst->base.device, - CAIRO_CONTENT_COLOR_ALPHA, - glyph_extents->width, - glyph_extents->height); - if (unlikely (mask->status)) { - _cairo_gl_context_release (ctx); - return mask->status; - } + mask = cairo_gl_surface_create (dst->base.device, + CAIRO_CONTENT_COLOR_ALPHA, + glyph_extents->width, + glyph_extents->height); + if (unlikely (mask->status)) { + _cairo_gl_context_release (ctx); + return mask->status; } for (i = 0; i < num_glyphs; i++) { @@ -730,8 +711,7 @@ _cairo_gl_surface_show_glyphs_via_mask (cairo_gl_surface_t *dst, *remaining_glyphs = num_glyphs; } - if (ctx->glyphs_temporary_mask == NULL) - ctx->glyphs_temporary_mask = (cairo_gl_surface_t *) mask; + cairo_surface_destroy (mask); _cairo_gl_context_release (ctx); diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h index 15e5466c..83836e77 100644 --- a/src/cairo-gl-private.h +++ b/src/cairo-gl-private.h @@ -135,7 +135,6 @@ typedef struct _cairo_gl_context { [CAIRO_GL_SHADER_IN_COUNT]; cairo_gl_surface_t *current_target; - cairo_gl_surface_t *glyphs_temporary_mask; cairo_gl_glyph_cache_t glyph_cache[2]; cairo_list_t fonts; |