Don't serialize anything for SkEmptyShader.

BUG=skia:3735

Review URL: https://codereview.chromium.org/1097433002
This commit is contained in:
mtklein 2015-04-16 07:59:12 -07:00 committed by Commit bot
parent 6318016469
commit 6ef68ab2cd
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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;
};