Index: src/effects/gradients/SkRadialGradient.cpp |
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp |
index a6a2e366b22a3f90cfaf7723a061c959b61c820a..fb1d40a7ab0d9c92b66169aca5c785138fbf2a73 100644 |
--- a/src/effects/gradients/SkRadialGradient.cpp |
+++ b/src/effects/gradients/SkRadialGradient.cpp |
@@ -252,11 +252,24 @@ SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const { |
return kRadial_GradientType; |
} |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
SkRadialGradient::SkRadialGradient(SkReadBuffer& buffer) |
: INHERITED(buffer), |
fCenter(buffer.readPoint()), |
fRadius(buffer.readScalar()) { |
} |
+#endif |
+ |
+SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) { |
+ DescriptorScope desc; |
+ if (!desc.unflatten(buffer)) { |
+ return NULL; |
+ } |
+ const SkPoint center = buffer.readPoint(); |
+ const SkScalar radius = buffer.readScalar(); |
+ return SkGradientShader::CreateRadial(center, radius, desc.fColors, desc.fPos, desc.fCount, |
+ desc.fTileMode, desc.fGradFlags, desc.fLocalMatrix); |
+} |
void SkRadialGradient::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |