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

Unified Diff: dm/DMSrcSink.h

Issue 1239953004: Allow Srcs to veto Sinks based on their broad type. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: scroggo Created 5 years, 5 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 | « dm/DM.cpp ('k') | 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 b7c28edf006f17e1c32504364c7d2456fff8d97a..d65c1a26c9100d9cf36c181b671022d3d8c016c4 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -53,6 +53,8 @@ private:
bool fFatal;
};
+enum SinkType { kGPU_SinkType, kVector_SinkType, kRaster_SinkType };
+
struct Src {
// All Srcs must be thread safe.
virtual ~Src() {}
@@ -60,6 +62,7 @@ struct Src {
virtual SkISize size() const = 0;
virtual Name name() const = 0;
virtual void modifyGrContextOptions(GrContextOptions* options) const {}
+ virtual bool veto(SinkType) const { return false; }
};
struct Sink {
@@ -110,6 +113,7 @@ public:
Error draw(SkCanvas*) const override;
SkISize size() const override;
Name name() const override;
+ bool veto(SinkType) const override;
private:
Path fPath;
Mode fMode;
@@ -127,6 +131,7 @@ public:
Error draw(SkCanvas*) const override;
SkISize size() const override;
Name name() const override;
+ bool veto(SinkType) const override;
private:
Path fPath;
const int fDivisor;
« no previous file with comments | « dm/DM.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698