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

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: fix whitespace 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..991efa998162f1fbea24e880aef5148caa2eb63b 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) {
@@ -1807,6 +1812,13 @@ void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties,
rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion
}
+#ifdef SK_BUILD_FOR_ANDROID
+ SkOrderedWriteBuffer androidBuffer(128);
+ fPaintOptionsAndroid.flatten(androidBuffer);
+ descSize += androidBuffer.size();
+ entryCount += 1;
+#endif
+
///////////////////////////////////////////////////////////////////////////
// Now that we're done tweaking the rec, call the PostMakeRec cleanup
SkScalerContext::PostMakeRec(*this, &rec);
@@ -1819,6 +1831,10 @@ void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties,
desc->init();
desc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec);
+#ifdef SK_BUILD_FOR_ANDROID
+ add_flattenable(desc, kAndroidOpts_SkDescriptorTag, &androidBuffer);
+#endif
+
if (pe) {
add_flattenable(desc, kPathEffect_SkDescriptorTag, &peBuffer);
}

Powered by Google App Engine
This is Rietveld 408576698