Index: src/effects/SkArithmeticMode.cpp |
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp |
index 052b06507c26a364d4c735c13a94718736ebdd7b..2121e3a81dadea597b4f21018e189152a8615425 100644 |
--- a/src/effects/SkArithmeticMode.cpp |
+++ b/src/effects/SkArithmeticMode.cpp |
@@ -23,11 +23,8 @@ static const bool gUseUnpremul = false; |
class SkArithmeticMode_scalar : public SkXfermode { |
public: |
- SkArithmeticMode_scalar(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4) { |
- fK[0] = k1; |
- fK[1] = k2; |
- fK[2] = k3; |
- fK[3] = k4; |
+ static SkArithmeticMode_scalar* Create(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4) { |
+ return SkNEW_ARGS(SkArithmeticMode_scalar, (k1, k2, k3, k4)); |
} |
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count, |
@@ -41,6 +38,13 @@ public: |
#endif |
private: |
+ SkArithmeticMode_scalar(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4) { |
+ fK[0] = k1; |
+ fK[1] = k2; |
+ fK[2] = k3; |
+ fK[3] = k4; |
+ } |
+ |
SkArithmeticMode_scalar(SkReadBuffer& buffer) : INHERITED(buffer) { |
fK[0] = buffer.readScalar(); |
fK[1] = buffer.readScalar(); |
@@ -216,7 +220,7 @@ SkXfermode* SkArithmeticMode::Create(SkScalar k1, SkScalar k2, |
return SkNEW_ARGS(SkArithmeticMode_linear, (i2, i3, i4)); |
#endif |
} |
- return SkNEW_ARGS(SkArithmeticMode_scalar, (k1, k2, k3, k4)); |
+ return SkArithmeticMode_scalar::Create(k1, k2, k3, k4); |
} |