Expose extra matrix parameter in glyph cache APIs
Change-Id: Id331cea931fbc29611fdc32e4267bc9ecc463994
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index d2233f0..8e46deb 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -885,9 +885,9 @@
SkPath* path) const;
#ifdef SK_BUILD_FOR_ANDROID
- const SkGlyph& getUnicharMetrics(SkUnichar);
- const SkGlyph& getGlyphMetrics(uint16_t);
- const void* findImage(const SkGlyph&);
+ const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
+ const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
+ const void* findImage(const SkGlyph&, const SkMatrix*);
uint32_t getGenerationID() const;
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 35b5b38..56630ae 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -419,9 +419,9 @@
}
#ifdef SK_BUILD_FOR_ANDROID
-const SkGlyph& SkPaint::getUnicharMetrics(SkUnichar text) {
+const SkGlyph& SkPaint::getUnicharMetrics(SkUnichar text, const SkMatrix* deviceMatrix) {
SkGlyphCache* cache;
- descriptorProc(NULL, DetachDescProc, &cache, true);
+ descriptorProc(deviceMatrix, DetachDescProc, &cache, true);
const SkGlyph& glyph = cache->getUnicharMetrics(text);
@@ -429,9 +429,9 @@
return glyph;
}
-const SkGlyph& SkPaint::getGlyphMetrics(uint16_t glyphId) {
+const SkGlyph& SkPaint::getGlyphMetrics(uint16_t glyphId, const SkMatrix* deviceMatrix) {
SkGlyphCache* cache;
- descriptorProc(NULL, DetachDescProc, &cache, true);
+ descriptorProc(deviceMatrix, DetachDescProc, &cache, true);
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphId);
@@ -439,10 +439,10 @@
return glyph;
}
-const void* SkPaint::findImage(const SkGlyph& glyph) {
+const void* SkPaint::findImage(const SkGlyph& glyph, const SkMatrix* deviceMatrix) {
// See ::detachCache()
SkGlyphCache* cache;
- descriptorProc(NULL, DetachDescProc, &cache, true);
+ descriptorProc(deviceMatrix, DetachDescProc, &cache, true);
const void* image = cache->findImage(glyph);