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

"Zhigang Gong" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]
> On Behalf Of Eric Anholt
> Sent: Wednesday, January 30, 2013 10:51 AM
> To: Henry (Yu) Song - SISA; [email protected]
> Subject: Re: [cairo] [patch] gl: do not force flush everytime uploading a
> glyph image to glyph cache
> 
> "Henry (Yu) Song - SISA" <[email protected]> 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.
From my point of view, cairo glyphs cache algorithm will not evict a used
cached glyph, so this may not be an issue. The corresponding code snippet
is as below:
@function:_cairo_gl_glyph_cache_add_glyph.

    /* search for an available slot */
    status = _cairo_rtree_insert (&cache->rtree, width, height, &node);
    /* search for an unlocked slot */
    if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
        status = _cairo_rtree_evict_random (&cache->rtree,
                                            width, height, &node);
        if (status == CAIRO_INT_STATUS_SUCCESS) {
            status = _cairo_rtree_node_insert (&cache->rtree,
                                               node, width, height, &node);
        }
    }

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.