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

Unified Diff: dm/DMSrcSink.h

Issue 2023593002: SkMultiPictureDocument & SkMultiPictureDocumentReader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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
Index: dm/DMSrcSink.h
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h
index 84096bf0fe9ab4f2ca31af3bc152502836581053..6bc31ef26ebc71ee22d67cf21f6fdaa2332fc296 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -15,6 +15,7 @@
#include "SkBitmapRegionDecoder.h"
#include "SkCanvas.h"
#include "SkData.h"
+#include "SkMultiPictureDocumentReader.h"
#include "SkPicture.h"
#include "gm.h"
@@ -66,6 +67,11 @@ struct Src {
virtual void modifyGrContextOptions(GrContextOptions* options) const {}
virtual bool veto(SinkFlags) const { return false; }
+ virtual int pageCount() const { return 1; }
+ virtual Error SK_WARN_UNUSED_RESULT draw(int, SkCanvas* canvas) const {
+ return this->draw(canvas);
+ }
+ virtual SkISize size(int) const { return this->size(); }
// Force Tasks using this Src to run on the main thread?
virtual bool serial() const { return false; }
};
@@ -239,6 +245,24 @@ private:
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+class MSKPSrc : public Src {
+public:
+ explicit MSKPSrc(Path path);
+
+ int pageCount() const override;
+ Error draw(SkCanvas* c) const override;
+ Error draw(int, SkCanvas*) const override;
+ SkISize size() const override;
+ SkISize size(int) const override;
+ Name name() const override;
+
+private:
+ Path fPath;
+ SkMultiPictureDocumentReader fReader;
+};
+
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
class NullSink : public Sink {
public:
NullSink() {}

Powered by Google App Engine
This is Rietveld 408576698