diff options
Diffstat (limited to 'src/core/SkGlyphCache.cpp')
-rw-r--r-- | src/core/SkGlyphCache.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp index 3734b96ee2..79e714758c 100644 --- a/src/core/SkGlyphCache.cpp +++ b/src/core/SkGlyphCache.cpp @@ -155,6 +155,12 @@ SkGlyph* SkGlyphCache::lookupByPackedGlyphID(SkPackedGlyphID packedGlyphID, Metr } else { if (type == kFull_MetricsType && glyph->isJustAdvance()) { fScalerContext->getMetrics(glyph); + + // Just in case someone allocated an image in the getMetrics call, be sure to account + // for the memory used. + if (glyph->fImage != nullptr) { + fMemoryUsed += glyph->computeImageSize(); + } } } return glyph; |