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

Unified Diff: dm/DMSrcSink.h

Issue 1117183007: DM: add Via abstract class (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 7 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 0d612d0b933997358086d8ad35c4f0dfc861959e..903755eb7e6c7204eb7e024120a84d03022ffc40 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -214,96 +214,68 @@ public:
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-class ViaMatrix : public Sink {
+class Via : public Sink {
public:
- ViaMatrix(SkMatrix, Sink*);
-
- Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
+ explicit Via(Sink* sink) : fSink(sink) {}
const char* fileExtension() const override { return fSink->fileExtension(); }
-private:
- SkMatrix fMatrix;
+ int enclave() const override { return fSink->enclave(); }
+protected:
SkAutoTDelete<Sink> fSink;
};
-class ViaUpright : public Sink {
+class ViaMatrix : public Via {
public:
- ViaUpright(SkMatrix, Sink*);
-
+ ViaMatrix(SkMatrix, Sink*);
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
- const char* fileExtension() const override { return fSink->fileExtension(); }
private:
- SkMatrix fMatrix;
- SkAutoTDelete<Sink> fSink;
+ const SkMatrix fMatrix;
};
-class ViaPipe : public Sink {
+class ViaUpright : public Via {
public:
- explicit ViaPipe(Sink*);
-
+ ViaUpright(SkMatrix, Sink*);
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
- const char* fileExtension() const override { return fSink->fileExtension(); }
private:
- SkAutoTDelete<Sink> fSink;
+ const SkMatrix fMatrix;
};
-class ViaDeferred : public Sink {
+class ViaPipe : public Via {
public:
- explicit ViaDeferred(Sink*);
-
+ explicit ViaPipe(Sink* sink) : Via(sink) {}
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
- const char* fileExtension() const override { return fSink->fileExtension(); }
-private:
- SkAutoTDelete<Sink> fSink;
};
-class ViaSerialization : public Sink {
+class ViaDeferred : public Via {
public:
- explicit ViaSerialization(Sink*);
+ explicit ViaDeferred(Sink* sink) : Via(sink) {}
+ Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
+};
+class ViaSerialization : public Via {
+public:
+ explicit ViaSerialization(Sink* sink) : Via(sink) {}
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
- const char* fileExtension() const override { return fSink->fileExtension(); }
-private:
- SkAutoTDelete<Sink> fSink;
};
-class ViaTiles : public Sink {
+class ViaTiles : public Via {
public:
ViaTiles(int w, int h, SkBBHFactory*, Sink*);
-
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
- const char* fileExtension() const override { return fSink->fileExtension(); }
private:
const int fW, fH;
SkAutoTDelete<SkBBHFactory> fFactory;
- SkAutoTDelete<Sink> fSink;
};
-class ViaSecondPicture : public Sink {
+class ViaSecondPicture : public Via {
public:
- explicit ViaSecondPicture(Sink*);
-
+ explicit ViaSecondPicture(Sink* sink) : Via(sink) {}
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
- const char* fileExtension() const override { return fSink->fileExtension(); }
-private:
- SkAutoTDelete<Sink> fSink;
};
-class ViaSingletonPictures : public Sink {
+class ViaSingletonPictures : public Via {
public:
- explicit ViaSingletonPictures(Sink*);
-
+ explicit ViaSingletonPictures(Sink* sink) : Via(sink) {}
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
- int enclave() const override { return fSink->enclave(); }
- const char* fileExtension() const override { return fSink->fileExtension(); }
-private:
- SkAutoTDelete<Sink> fSink;
};
} // namespace DM
« 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