Index: src/core/SkPaint.cpp |
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp |
index df8b292cedf2e5c69549e359a473397334c543af..62d09d659cb1518358fe58f654b94a5a3753eb37 100644 |
--- a/src/core/SkPaint.cpp |
+++ b/src/core/SkPaint.cpp |
@@ -2045,8 +2045,6 @@ void SkPaint::flatten(SkFlattenableWriteBuffer& buffer) const { |
ptr = write_scalar(ptr, this->getTextSize()); |
ptr = write_scalar(ptr, this->getTextScaleX()); |
ptr = write_scalar(ptr, this->getTextSkewX()); |
- // Dummy value for obsolete hinting scale factor. TODO: remove with next picture version |
- ptr = write_scalar(ptr, SK_Scalar1); |
ptr = write_scalar(ptr, this->getStrokeWidth()); |
ptr = write_scalar(ptr, this->getStrokeMiter()); |
*ptr++ = this->getColor(); |
@@ -2063,8 +2061,6 @@ void SkPaint::flatten(SkFlattenableWriteBuffer& buffer) const { |
buffer.writeScalar(fTextSize); |
buffer.writeScalar(fTextScaleX); |
buffer.writeScalar(fTextSkewX); |
- // Dummy value for obsolete hinting scale factor. TODO: remove with next picture version |
- buffer.writeScalar(SK_Scalar1); |
buffer.writeScalar(fWidth); |
buffer.writeScalar(fMiterLimit); |
buffer.writeColor(fColor); |
@@ -2095,6 +2091,10 @@ void SkPaint::flatten(SkFlattenableWriteBuffer& buffer) const { |
buffer.writeFlattenable(this->getImageFilter()); |
buffer.writeFlattenable(this->getAnnotation()); |
} |
+ |
+#if SK_BUILD_FOR_ANDROID |
+ this->getPaintOptionsAndroid().flatten(buffer); |
+#endif |
} |
void SkPaint::unflatten(SkFlattenableReadBuffer& buffer) { |
@@ -2110,8 +2110,6 @@ void SkPaint::unflatten(SkFlattenableReadBuffer& buffer) { |
this->setTextSize(read_scalar(pod)); |
this->setTextScaleX(read_scalar(pod)); |
this->setTextSkewX(read_scalar(pod)); |
- // Skip the hinting scalar factor, which is not supported. |
- read_scalar(pod); |
this->setStrokeWidth(read_scalar(pod)); |
this->setStrokeMiter(read_scalar(pod)); |
this->setColor(*pod++); |
@@ -2138,8 +2136,6 @@ void SkPaint::unflatten(SkFlattenableReadBuffer& buffer) { |
this->setTextSize(buffer.readScalar()); |
this->setTextScaleX(buffer.readScalar()); |
this->setTextSkewX(buffer.readScalar()); |
- // Skip the hinting scalar factor, which is not supported. |
- buffer.readScalar(); |
this->setStrokeWidth(buffer.readScalar()); |
this->setStrokeMiter(buffer.readScalar()); |
this->setColor(buffer.readColor()); |
@@ -2180,6 +2176,11 @@ void SkPaint::unflatten(SkFlattenableReadBuffer& buffer) { |
this->setLooper(NULL); |
this->setImageFilter(NULL); |
} |
+#if SK_BUILD_FOR_ANDROID |
+ SkPaintOptionsAndroid options; |
+ options.unflatten(buffer); |
+ this->setPaintOptionsAndroid(options); |
+#endif |
} |
/////////////////////////////////////////////////////////////////////////////// |