aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkShader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkShader.cpp')
-rw-r--r--src/core/SkShader.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 816d6fd329..39e8ed35f5 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -46,6 +46,17 @@ SkShader::SkShader(const SkMatrix* localMatrix) {
}
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
+SkShader::SkShader(SkReadBuffer& buffer) : INHERITED(buffer) {
+ inc_shader_counter();
+ if (buffer.readBool()) {
+ buffer.readMatrix(&fLocalMatrix);
+ } else {
+ fLocalMatrix.reset();
+ }
+}
+#endif
+
SkShader::~SkShader() {
dec_shader_counter();
}
@@ -260,6 +271,12 @@ bool SkColorShader::isOpaque() const {
return SkColorGetA(fColor) == 255;
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
+SkColorShader::SkColorShader(SkReadBuffer& b) : INHERITED(b) {
+ fColor = b.readColor();
+}
+#endif
+
SkFlattenable* SkColorShader::CreateProc(SkReadBuffer& buffer) {
return SkNEW_ARGS(SkColorShader, (buffer.readColor()));
}