aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/codec
diff options
context:
space:
mode:
Diffstat (limited to 'include/codec')
-rw-r--r--include/codec/SkAndroidCodec.h3
-rw-r--r--include/codec/SkCodec.h7
-rw-r--r--include/codec/SkEncodedInfo.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/include/codec/SkAndroidCodec.h b/include/codec/SkAndroidCodec.h
index 3571108edd..cc93bf18c4 100644
--- a/include/codec/SkAndroidCodec.h
+++ b/include/codec/SkAndroidCodec.h
@@ -41,8 +41,9 @@ public:
*/
static std::unique_ptr<SkAndroidCodec> MakeFromData(sk_sp<SkData>, SkPngChunkReader* = nullptr);
- virtual ~SkAndroidCodec() {}
+ virtual ~SkAndroidCodec();
+ const SkEncodedInfo& getEncodedInfo() const;
const SkImageInfo& getInfo() const { return fInfo; }
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index fb4f165dbf..8ec44c8539 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -846,6 +846,13 @@ private:
bool fStartedIncrementalDecode;
/**
+ * Return whether {srcColor, srcIsOpaque, srcCS} can convert to dst.
+ *
+ * Will be called for the appropriate frame, prior to initializing the colorXform.
+ */
+ virtual bool conversionSupported(const SkImageInfo& dst, SkEncodedInfo::Color srcColor,
+ bool srcIsOpaque, const SkColorSpace* srcCS) const;
+ /**
* Return whether these dimensions are supported as a scale.
*
* The codec may choose to cache the information about scale and subset.
diff --git a/include/codec/SkEncodedInfo.h b/include/codec/SkEncodedInfo.h
index 3b1ce48713..dce88cadc1 100644
--- a/include/codec/SkEncodedInfo.h
+++ b/include/codec/SkEncodedInfo.h
@@ -156,6 +156,8 @@ public:
Color color() const { return fColor; }
Alpha alpha() const { return fAlpha; }
+ bool opaque() const { return fAlpha == kOpaque_Alpha; }
+
uint8_t bitsPerComponent() const { return fBitsPerComponent; }
uint8_t bitsPerPixel() const {