Index: dm/DMSrcSink.h |
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h |
index 3a7d4ee516cfa7ccb87e9a0e9c7cfbe3c7d19634..7daf8dbba092be42a486581874682abb1b19d127 100644 |
--- a/dm/DMSrcSink.h |
+++ b/dm/DMSrcSink.h |
@@ -20,6 +20,10 @@ |
namespace DM { |
+// Return the extension of the provided SkString. Returns a pointer into the SkString's |
+// data, so its lifetime is the same as the SkString. |
+const char* SkStringExtension(const SkString&); |
scroggo
2016/02/08 18:57:52
I needed this in more than one place, and both of
mtklein
2016/02/08 21:26:55
Better call this FileExtension() or FileNameExtens
|
+ |
// This is just convenience. It lets you use either return "foo" or return SkStringPrintf(...). |
struct ImplicitString : public SkString { |
template <typename T> |
@@ -58,6 +62,14 @@ struct SinkFlags { |
enum { kDirect, kIndirect } approach; |
}; |
+enum { kAnyThread_Enclave, |
+ kGPU_Enclave, |
+#ifdef SK_CODEC_DECODES_RAW |
mtklein
2016/02/08 21:26:55
Why the #ifdef?
|
+ kRAW_Enclave, |
+#endif |
+ kNumEnclaves, |
+ }; |
+ |
struct Src { |
// All Srcs must be thread safe. |
mtklein
2016/02/08 21:26:55
Better update / remove this.
|
virtual ~Src() {} |
@@ -66,6 +78,8 @@ struct Src { |
virtual Name name() const = 0; |
virtual void modifyGrContextOptions(GrContextOptions* options) const {} |
virtual bool veto(SinkFlags) const { return false; } |
+ // If not kAnyThread_Enclave, overrides the Sink's enclave |
+ virtual int enclave() const { return kAnyThread_Enclave; } |
}; |
struct Sink { |
@@ -82,9 +96,6 @@ struct Sink { |
virtual SinkFlags flags() const = 0; |
}; |
-enum { kAnyThread_Enclave, kGPU_Enclave }; |
-static const int kNumEnclaves = kGPU_Enclave + 1; |
- |
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ |
class GMSrc : public Src { |
@@ -124,6 +135,7 @@ public: |
SkISize size() const override; |
Name name() const override; |
bool veto(SinkFlags) const override; |
+ int enclave() const override; |
private: |
Path fPath; |
Mode fMode; |