Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a glyph cache thread. #565

Merged
merged 1 commit into from Nov 28, 2016
Merged

Introduce a glyph cache thread. #565

merged 1 commit into from Nov 28, 2016

Commits on Nov 28, 2016

  1. Introduce a glyph cache thread.

    This is the first step towards making the glyph cache more efficient
    and also run asynchronously to allow rendering to continue if the
    glyph rasterizing becomes a bottleneck (e.g. during animated zooms).
    
    Previously, we collected the list of glyphs that were required for
    a frame, and ran a rayon loop to rasterize any that weren't in the
    glyph cache. However, this meant that the glyph rasterizion could
    not start until we knew the list of all required glyphs.
    
    Now, all requests for text run glyphs are sent immediately to the
    glyph cache thread. The glyph cache thread uses a worker thread
    pool to immediately begin rasterizing any uncached glyphs as soon
    as they are requested.
    
    In the future, the idea is that instead of waiting at the block()
    method for all pending glyphs to be rasterized, the backend thread
    will instead receive small numbers of glyphs as they are rasterized.
    This will allow the backend thread to make a decision that glyph
    rasterizing is taking too long for this frame, and that we should
    just draw a frame with the currently cached glyph sizes available.
    When this occurs, the glyph cache thread will signal that a new frame
    should be rendered when it completes rasterizing any pending glyphs.
    This will allow us to keep rendering at 60fps during zoom, even
    if the glyph rasterizing threads can't keep up (at a quality
    tradeoff of using lower resolution glyphs).
    gw3583 committed Nov 28, 2016
You can’t perform that action at this time.