test (and fix) clip_restriction in canvas
BUG=skia:
Change-Id: I86d25d0fd82be35d01471fba59f77b360be5373c
Reviewed-on: https://skia-review.googlesource.com/9995
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 0a53d47..e10aece 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -232,6 +232,18 @@
static int SizeOfPackedUInt(size_t value);
};
+class SK_API SkNullWStream : public SkWStream {
+public:
+ SkNullWStream() : fBytesWritten(0) {}
+
+ bool write(const void*, size_t n) override { fBytesWritten += n; return true; }
+ void flush() override {}
+ size_t bytesWritten() const override { return fBytesWritten; }
+
+private:
+ size_t fBytesWritten;
+};
+
////////////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>