Index: src/effects/SkArithmeticMode.cpp |
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp |
index 7d9997a1dfebfd47a2d8ac887d0e55429fc2d16b..d3be82600789cba0d62622eaf9093644c4a5d477 100644 |
--- a/src/effects/SkArithmeticMode.cpp |
+++ b/src/effects/SkArithmeticMode.cpp |
@@ -47,6 +47,7 @@ private: |
fEnforcePMColor = enforcePMColor; |
} |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
SkArithmeticMode_scalar(SkReadBuffer& buffer) : INHERITED(buffer) { |
fK[0] = buffer.readScalar(); |
fK[1] = buffer.readScalar(); |
@@ -54,9 +55,9 @@ private: |
fK[3] = buffer.readScalar(); |
fEnforcePMColor = buffer.readBool(); |
} |
+#endif |
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { |
- INHERITED::flatten(buffer); |
buffer.writeScalar(fK[0]); |
buffer.writeScalar(fK[1]); |
buffer.writeScalar(fK[2]); |
@@ -66,9 +67,20 @@ private: |
SkScalar fK[4]; |
bool fEnforcePMColor; |
+ friend class SkArithmeticMode; |
+ |
typedef SkXfermode INHERITED; |
}; |
+SkFlattenable* SkArithmeticMode_scalar::CreateProc(SkReadBuffer& buffer) { |
+ const SkScalar k1 = buffer.readScalar(); |
+ const SkScalar k2 = buffer.readScalar(); |
+ const SkScalar k3 = buffer.readScalar(); |
+ const SkScalar k4 = buffer.readScalar(); |
+ const bool enforcePMColor = buffer.readBool(); |
+ return Create(k1, k2, k3, k4, enforcePMColor); |
+} |
+ |
static int pinToByte(int value) { |
if (value < 0) { |
value = 0; |