aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-04-16 07:59:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-16 07:59:12 -0700
commit6ef68ab2cd0597a6f1141b686f82f64ac1e89ccf (patch)
tree5b027b440cb3b594f0266b977ba4e993cfaf4c4f
parent6318016469a832b1b40cf1d443fd8396854f75c5 (diff)
Don't serialize anything for SkEmptyShader.
-rw-r--r--gm/badpaint.cpp2
-rw-r--r--src/core/SkEmptyShader.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/gm/badpaint.cpp b/gm/badpaint.cpp
index 45b17f85fe..cce81465ad 100644
--- a/gm/badpaint.cpp
+++ b/gm/badpaint.cpp
@@ -30,12 +30,10 @@ protected:
SkMatrix badMatrix;
badMatrix.setAll(0, 0, 0, 0, 0, 0, 0, 0, 0);
-#if 0 // This crashes pipe!
// Empty bitmap.
fPaints.push_back().setColor(SK_ColorGREEN);
fPaints.back().setShader(SkShader::CreateBitmapShader(emptyBmp, SkShader::kClamp_TileMode,
SkShader::kClamp_TileMode))->unref();
-#endif
// Non-invertible local matrix.
fPaints.push_back().setColor(SK_ColorGREEN);
diff --git a/src/core/SkEmptyShader.h b/src/core/SkEmptyShader.h
index 8809d5f958..7b87c284f7 100644
--- a/src/core/SkEmptyShader.h
+++ b/src/core/SkEmptyShader.h
@@ -34,6 +34,12 @@ protected:
return NULL;
}
+ void flatten(SkWriteBuffer& buffer) const override {
+ // Do nothing.
+ // We just don't want to fall through to SkShader::flatten(),
+ // which will write data we don't care to serialize or decode.
+ }
+
private:
typedef SkShader INHERITED;
};