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:
@ -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
|
||||
|
Reference in New Issue
Block a user