DM: don't leak the null canvas in NullSink.
Also make NullSink a real boy: declared among the other Sinks, impl in .cpp.
BUG=skia:
Review URL: https://codereview.chromium.org/922293003
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index b0df70b..4e3668f 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 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+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,