Index: src/effects/SkEmbossMaskFilter.cpp |
diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp |
index cdd55fcc5b836e00328e6fba0aca41ac50097f56..4841b92816459ccd9c61b7e413d0b885cdeb38a1 100644 |
--- a/src/effects/SkEmbossMaskFilter.cpp |
+++ b/src/effects/SkEmbossMaskFilter.cpp |
@@ -124,17 +124,26 @@ bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src, |
return true; |
} |
-SkEmbossMaskFilter::SkEmbossMaskFilter(SkReadBuffer& buffer) |
- : SkMaskFilter(buffer) { |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
+SkEmbossMaskFilter::SkEmbossMaskFilter(SkReadBuffer& buffer) : SkMaskFilter(buffer) { |
SkASSERT(buffer.getArrayCount() == sizeof(Light)); |
buffer.readByteArray(&fLight, sizeof(Light)); |
SkASSERT(fLight.fPad == 0); // for the font-cache lookup to be clean |
fBlurSigma = buffer.readScalar(); |
} |
+#endif |
-void SkEmbossMaskFilter::flatten(SkWriteBuffer& buffer) const { |
- this->INHERITED::flatten(buffer); |
+SkFlattenable* SkEmbossMaskFilter::CreateProc(SkReadBuffer& buffer) { |
+ Light light; |
+ if (buffer.readByteArray(&light, sizeof(Light))) { |
+ light.fPad = 0; // for the font-cache lookup to be clean |
+ const SkScalar sigma = buffer.readScalar(); |
+ return Create(sigma, light); |
+ } |
+ return NULL; |
+} |
+void SkEmbossMaskFilter::flatten(SkWriteBuffer& buffer) const { |
Light tmpLight = fLight; |
tmpLight.fPad = 0; // for the font-cache lookup to be clean |
buffer.writeByteArray(&tmpLight, sizeof(tmpLight)); |