Chromium Code Reviews| 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 |