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); |
} |