diff options
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DMSrcSink.cpp | 8 | ||||
-rw-r--r-- | dm/DMSrcSink.h | 20 |
2 files changed, 18 insertions, 10 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index b0df70b124..4e3668f15e 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -3,6 +3,7 @@ #include "SkCommonFlags.h" #include "SkDocument.h" #include "SkMultiPictureDraw.h" +#include "SkNullCanvas.h" #include "SkOSFile.h" #include "SkPictureRecorder.h" #include "SkRandom.h" @@ -132,6 +133,13 @@ Name SKPSrc::name() const { return SkOSPath::Basename(fPath.c_str()); } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +Error NullSink::draw(const Src& src, SkBitmap*, SkWStream*, SkString*) const { + SkAutoTDelete<SkCanvas> canvas(SkCreateNullCanvas()); + return src.draw(canvas); +} + +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + DEFINE_bool(gpuStats, false, "Append GPU stats to the log for each GPU task?"); GPUSink::GPUSink(GrContextFactory::GLContextType ct, diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index 48c572b1a7..4c15c92cb6 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -8,7 +8,6 @@ #include "SkCanvas.h" #include "SkData.h" #include "SkGPipe.h" -#include "SkNullCanvas.h" #include "SkPicture.h" #include "gm.h" @@ -86,6 +85,16 @@ private: /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +class NullSink : public Sink { +public: + NullSink() {} + + Error draw(const Src& src, SkBitmap*, SkWStream*, SkString*) const SK_OVERRIDE; + int enclave() const SK_OVERRIDE { return kAnyThread_Enclave; } + const char* fileExtension() const SK_OVERRIDE { return ""; } +}; + + class GPUSink : public Sink { public: GPUSink(GrContextFactory::GLContextType, GrGLStandard, int samples, bool dfText, bool threaded); @@ -189,15 +198,6 @@ private: SkAutoTDelete<Sink> fSink; }; -class NullSink : public Sink { -public: - Error draw(const Src& src, SkBitmap*, SkWStream*, SkString*) const SK_OVERRIDE { - return src.draw(SkCreateNullCanvas()); - } - int enclave() const SK_OVERRIDE { return kAnyThread_Enclave; } - const char* fileExtension() const SK_OVERRIDE { return ""; } -}; - } // namespace DM #endif//DMSrcSink_DEFINED |