Index: src/effects/gradients/SkLinearGradient.cpp |
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp |
index 4f85da39d378b260bfd883fa0749e9a6f53599c5..9d939bf4a22a85d02628d2134d6daf547c548c18 100644 |
--- a/src/effects/gradients/SkLinearGradient.cpp |
+++ b/src/effects/gradients/SkLinearGradient.cpp |
@@ -60,11 +60,25 @@ SkLinearGradient::SkLinearGradient(const SkPoint pts[2], const Descriptor& desc) |
pts_to_unit_matrix(pts, &fPtsToUnit); |
} |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
SkLinearGradient::SkLinearGradient(SkReadBuffer& buffer) |
: INHERITED(buffer) |
, fStart(buffer.readPoint()) |
, fEnd(buffer.readPoint()) { |
} |
+#endif |
+ |
+SkFlattenable* SkLinearGradient::CreateProc(SkReadBuffer& buffer) { |
+ DescriptorScope desc; |
+ if (!desc.unflatten(buffer)) { |
+ return NULL; |
+ } |
+ SkPoint pts[2]; |
+ pts[0] = buffer.readPoint(); |
+ pts[1] = buffer.readPoint(); |
+ return SkGradientShader::CreateLinear(pts, desc.fColors, desc.fPos, desc.fCount, |
+ desc.fTileMode, desc.fGradFlags, desc.fLocalMatrix); |
+} |
void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |