Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: src/core/SkPaint.cpp

Issue 12699002: Upstream changes from Android. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: more fiex Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkThread_platform.h ('k') | src/core/SkPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 07d1c33bd47b747f3711be4fe75a988b0f98a08b..37edfbb6fe8f5e3b7b332fe6a54c96d9d17a7c6b 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -176,6 +176,10 @@ void SkPaint::reset() {
uint32_t SkPaint::getGenerationID() const {
return fGenerationID;
}
+
+void SkPaint::setGenerationID(uint32_t generationID) {
+ fGenerationID = generationID;
+}
#endif
#ifdef SK_BUILD_FOR_ANDROID
@@ -415,9 +419,10 @@ static void DetachDescProc(const SkDescriptor* desc, void* context) {
}
#ifdef SK_BUILD_FOR_ANDROID
-const SkGlyph& SkPaint::getUnicharMetrics(SkUnichar text) {
+const SkGlyph& SkPaint::getUnicharMetrics(SkUnichar text,
+ const SkMatrix* deviceMatrix) {
SkGlyphCache* cache;
- descriptorProc(NULL, NULL, DetachDescProc, &cache, true);
+ descriptorProc(NULL, deviceMatrix, DetachDescProc, &cache, true);
const SkGlyph& glyph = cache->getUnicharMetrics(text);
@@ -425,9 +430,10 @@ const SkGlyph& SkPaint::getUnicharMetrics(SkUnichar text) {
return glyph;
}
-const SkGlyph& SkPaint::getGlyphMetrics(uint16_t glyphId) {
+const SkGlyph& SkPaint::getGlyphMetrics(uint16_t glyphId,
+ const SkMatrix* deviceMatrix) {
SkGlyphCache* cache;
- descriptorProc(NULL, NULL, DetachDescProc, &cache, true);
+ descriptorProc(NULL, deviceMatrix, DetachDescProc, &cache, true);
const SkGlyph& glyph = cache->getGlyphIDMetrics(glyphId);
@@ -435,10 +441,11 @@ const SkGlyph& SkPaint::getGlyphMetrics(uint16_t glyphId) {
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, NULL, DetachDescProc, &cache, true);
+ descriptorProc(NULL, deviceMatrix, DetachDescProc, &cache, true);
const void* image = cache->findImage(glyph);
@@ -900,17 +907,26 @@ public:
fTextSize = paint->getTextSize();
fStyle = paint->getStyle();
fPaint->setStyle(SkPaint::kFill_Style);
+#ifdef SK_BUILD_FOR_ANDROID
+ fGenerationID = fPaint->getGenerationID();
+#endif
}
~SkAutoRestorePaintTextSizeAndFrame() {
fPaint->setStyle(fStyle);
fPaint->setTextSize(fTextSize);
+#ifdef SK_BUILD_FOR_ANDROID
+ fPaint->setGenerationID(fGenerationID);
+#endif
}
private:
SkPaint* fPaint;
SkScalar fTextSize;
SkPaint::Style fStyle;
+#ifdef SK_BUILD_FOR_ANDROID
+ uint32_t fGenerationID;
+#endif
};
static void set_bounds(const SkGlyph& g, SkRect* bounds) {
« no previous file with comments | « include/core/SkThread_platform.h ('k') | src/core/SkPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698