Index: src/effects/gradients/SkSweepGradient.cpp |
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp |
index a5392160504e9e2b29dde872e01b82a339805c2c..1bb595cb3c262ef5a8557f22d0fb797a4f2522a3 100644 |
--- a/src/effects/gradients/SkSweepGradient.cpp |
+++ b/src/effects/gradients/SkSweepGradient.cpp |
@@ -41,10 +41,22 @@ SkShader::GradientType SkSweepGradient::asAGradient(GradientInfo* info) const { |
return kSweep_GradientType; |
} |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
SkSweepGradient::SkSweepGradient(SkReadBuffer& buffer) |
: INHERITED(buffer), |
fCenter(buffer.readPoint()) { |
} |
+#endif |
+ |
+SkFlattenable* SkSweepGradient::CreateProc(SkReadBuffer& buffer) { |
+ DescriptorScope desc; |
+ if (!desc.unflatten(buffer)) { |
+ return NULL; |
+ } |
+ const SkPoint center = buffer.readPoint(); |
+ return SkGradientShader::CreateSweep(center.x(), center.y(), desc.fColors, desc.fPos, |
+ desc.fCount, desc.fGradFlags, desc.fLocalMatrix); |
+} |
void SkSweepGradient::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |