Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1194)

Unified Diff: tests/ImageFilterTest.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/GLProgramsTest.cpp ('k') | tests/LayerRasterizerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageFilterTest.cpp
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index ee3de50c48108a36fbe47fe35761f98bcc890537..214aed950cd388df429931da5eb4ac9f2e9d88de 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -56,12 +56,15 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter)
protected:
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
explicit MatrixTestImageFilter(SkReadBuffer& buffer) : SkImageFilter(0, NULL) {
fReporter = static_cast<skiatest::Reporter*>(buffer.readFunctionPtr());
buffer.readMatrix(&fExpectedMatrix);
}
+#endif
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
+ this->INHERITED::flatten(buffer);
buffer.writeFunctionPtr(fReporter);
buffer.writeMatrix(fExpectedMatrix);
}
@@ -69,10 +72,20 @@ protected:
private:
skiatest::Reporter* fReporter;
SkMatrix fExpectedMatrix;
+
+ typedef SkImageFilter INHERITED;
};
}
+SkFlattenable* MatrixTestImageFilter::CreateProc(SkReadBuffer& buffer) {
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
+ skiatest::Reporter* reporter = (skiatest::Reporter*)buffer.readFunctionPtr();
+ SkMatrix matrix;
+ buffer.readMatrix(&matrix);
+ return SkNEW_ARGS(MatrixTestImageFilter, (reporter, matrix));
+}
+
static void make_small_bitmap(SkBitmap& bitmap) {
bitmap.allocN32Pixels(kBitmapSize, kBitmapSize);
SkCanvas canvas(bitmap);
« no previous file with comments | « tests/GLProgramsTest.cpp ('k') | tests/LayerRasterizerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698