Optimize glyph cache texture uploads

Only upload the changed area of the glyph cache, not the entire
bitmap. Note that we can't do the full-on optimization here of copying a sub-rect
of the bitmap because of GL ES 2 limitations, but we can at least copy the
horizontal stripe containing the dirty rect, which can still be a big
savings over uploading the entire bitmap.

Issue #7158326 Bad framerates on MR1 (Mako, Manta, Prime)

Change-Id: Iab38d53202650f757ead4658cf4287bdad2b3cb9
This commit is contained in:
Chet Haase
2012-09-21 08:40:46 -07:00
parent 7b770b0ec4
commit b92d8f7979
3 changed files with 22 additions and 7 deletions

View File

@ -171,6 +171,9 @@ bool CacheTexture::fitBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint32_
}
mDirty = true;
const Rect r(*retOriginX - TEXTURE_BORDER_SIZE, *retOriginY - TEXTURE_BORDER_SIZE,
*retOriginX + glyphW, *retOriginY + glyphH);
mDirtyRect.unionWith(r);
mNumGlyphs++;
#if DEBUG_FONT_RENDERER