[cairo] [patch] gl: do not force flush everytime uploading a glyph image to glyph cache

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Tue Jan 29 19:02:32 PST 2013

Hi, Eric

Are you referring the following code in cairo-gl-glyphs.c?

line 312
		status = _cairo_gl_glyph_cache_add_glyph (ctx, cache, scaled_glyph);

		    /* Cache is full, so flush existing prims and try again. */
		    _cairo_gl_composite_flush (ctx);
		    _cairo_gl_glyph_cache_unlock (cache);
		    status = _cairo_gl_glyph_cache_add_glyph (ctx, cache, scaled_glyph);

If the glyph cache is full, it flushes the pending draw - if I understand correctly.



From: Eric Anholt [eric at anholt.net]
Sent: Tuesday, January 29, 2013 6:51 PM
To: Henry (Yu) Song - SISA; cairo at cairographics.org
Subject: RE: [cairo] [patch] gl: do not force flush everytime uploading a glyph image to glyph cache

"Henry (Yu) Song - SISA" <hsong at sisa.samsung.com> writes:

> Hi, Eric
> Thanks for review and comment.  I will reformat the message.
> Each glyph uploading causes a flush of previous glDrawXXX().  A single
> glyph uploading is done by _cairo_gl_surface_draw_image(), in which
> _cairo_gl_composite_flush() is called.
> If I understand correctly, the question is how to ensure all glyph
> drawings are flushed before we start draw something else.  correct me
> if I am wrong.
> _cairo_gl_composite_flush () is called in multiple points, for example
> when mask surface has changed.  In glyph rendering, we uses two
> particular mask surface - one is the glyph cache that stores
> alpha-only glyphs, the second one is the rgba-glyph cache that stores
> lcd/subpixel images.  It is ensured all glyphs will be glDraw() before
> we switch to draw something else in _cairo_gl_operand_needs_setup(),
> where it checks the new mask vs the ctx->mask.

>From what I can see, add_glyph is inside of the loop rendering glyphs to
the temp mask.  I want to know how the rendering of former glyphs to the
into the temp mask gets flushed when a new glyph is being put into the
glyph cache that may overwrite a previous glyph.

More information about the cairo mailing list