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

Unified Diff: dm/DMSrcSink.h

Issue 1681553003: Optionally run RAW images serially (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 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
« dm/DM.cpp ('K') | « 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 3a7d4ee516cfa7ccb87e9a0e9c7cfbe3c7d19634..b251762b9aadd0880e5e52e62e65fa045c24b6e9 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&);
+
// 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
+ kRAW_Enclave,
+#endif
+ kNumEnclaves,
+ };
+
struct Src {
// All Srcs must be thread safe.
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,12 +135,14 @@ public:
SkISize size() const override;
Name name() const override;
bool veto(SinkFlags) const override;
+ int enclave() const override { return fEnclave; }
private:
Path fPath;
Mode fMode;
DstColorType fDstColorType;
SkAlphaType fDstAlphaType;
float fScale;
+ int fEnclave;
};
class AndroidCodecSrc : public Src {
@@ -147,12 +160,14 @@ public:
SkISize size() const override;
Name name() const override;
bool veto(SinkFlags) const override;
+ int enclave() const override { return fEnclave; }
private:
Path fPath;
Mode fMode;
CodecSrc::DstColorType fDstColorType;
SkAlphaType fDstAlphaType;
int fSampleSize;
+ int fEnclave;
};
// Allows for testing of various implementations of Android's BitmapRegionDecoder
« dm/DM.cpp ('K') | « dm/DM.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698