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

Unified Diff: src/core/SkPaint.cpp

Issue 14761003: API modifications needed to upstream Android font changes. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: refactored for upstream Created 7 years, 7 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
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index aa1b8e4803b956ca5b899ee8e6dfc9c9c5f039ab..24bc26d821801c435bf29d669b45dd6d08422618 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -180,14 +180,19 @@ uint32_t SkPaint::getGenerationID() const {
void SkPaint::setGenerationID(uint32_t generationID) {
fGenerationID = generationID;
}
-#endif
-#ifdef SK_BUILD_FOR_ANDROID
unsigned SkPaint::getBaseGlyphCount(SkUnichar text) const {
SkAutoGlyphCache autoCache(*this, NULL, NULL);
SkGlyphCache* cache = autoCache.getCache();
return cache->getBaseGlyphCount(text);
}
+
+void SkPaint::setPaintOptionsAndroid(const SkPaintOptionsAndroid& options) {
+ if(!memcmp(&fPaintOptionsAndroid, &options, sizeof(SkPaintOptionsAndroid))) {
+ fPaintOptionsAndroid = options;
+ GEN_ID_INC;
+ }
+}
#endif
void SkPaint::setHinting(Hinting hintingLevel) {
@@ -1651,6 +1656,10 @@ void SkScalerContext::MakeRec(const SkPaint& paint,
#endif
rec->fReservedAlign = 0;
+
+#ifdef SK_BUILD_FOR_ANDROID
+ rec->fPaintOptionsAndroid = paint.getPaintOptionsAndroid();
+#endif //SK_BUILD_FOR_ANDROID
/* Allow the fonthost to modify our rec before we use it as a key into the
cache. This way if we're asking for something that they will ignore,

Powered by Google App Engine
This is Rietveld 408576698