diff options
-rw-r--r-- | include/core/SkPaint.h | 1 | ||||
-rw-r--r-- | src/core/SkPaint.cpp | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index f4b325f..f336f5b 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -817,6 +817,7 @@ public: #ifdef ANDROID const SkGlyph& getUnicharMetrics(SkUnichar); + const SkGlyph& getGlyphMetrics(uint16_t); const void* findImage(const SkGlyph&); uint32_t getGenerationID() const; diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 14c0397..52b0163 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -364,6 +364,16 @@ const SkGlyph& SkPaint::getUnicharMetrics(SkUnichar text) { return glyph; } +const SkGlyph& SkPaint::getGlyphMetrics(uint16_t glyphId) { + SkGlyphCache* cache; + descriptorProc(NULL, DetachDescProc, &cache, true); + + const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphId); + + SkGlyphCache::AttachCache(cache); + return glyph; +} + const void* SkPaint::findImage(const SkGlyph& glyph) { // See ::detachCache() SkGlyphCache* cache; |