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

Unified Diff: dm/DMSrcSink.h

Issue 922293003: DM: don't leak the null canvas in NullSink. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | dm/DMSrcSink.cpp » ('j') | 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 48c572b1a7d8e771a0186b395ebb7fc0b9e60c46..4c15c92cb6cc67fbaece5db6c6b08f40eebc7a5d 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
« no previous file with comments | « no previous file | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698