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

Unified Diff: dm/DMSrcSink.h

Issue 873723007: DM::NullSink (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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
« dm/DM.cpp ('K') | « dm/DM.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.h
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h
index e163a24253f88e4ed58b2ca956588b0b16c96c24..4dcd280bb35dcefa2f785043f466e744fff60a92 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -8,6 +8,7 @@
#include "SkCanvas.h"
#include "SkData.h"
#include "SkGPipe.h"
+#include "SkNullCanvas.h"
#include "SkPicture.h"
#include "gm.h"
@@ -175,6 +176,16 @@ private:
SkAutoTDelete<Sink> fSink;
};
+class NullSink : public Sink {
+public:
+ Error draw(const Src& src, SkBitmap*, SkWStream* out) const SK_OVERRIDE {
+ (void)out->writeText("0\n");
mtklein 2015/01/29 20:00:12 Is this so we don't try to encode an empty bitmap?
hal.canary 2015/01/30 18:43:24 Done.
+ return src.draw(SkCreateNullCanvas());
+ }
+ int enclave() const SK_OVERRIDE { return kAnyThread_Enclave; }
+ const char* fileExtension() const SK_OVERRIDE { return "null"; }
mtklein 2015/01/29 20:00:12 or even, ""?
hal.canary 2015/01/30 18:43:24 Done.
+};
+
} // namespace DM
#endif//DMSrcSink_DEFINED
« dm/DM.cpp ('K') | « dm/DM.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698