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 |