Chromium Code Reviews| Index: include/codec/SkCodec.h |
| diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
| index c3a5873d7f9fb77e03027f684d573061bc9c3dd2..097578d764ee360e1baa6688d67c7d983a17a603 100644 |
| --- a/include/codec/SkCodec.h |
| +++ b/include/codec/SkCodec.h |
| @@ -10,6 +10,7 @@ |
| #include "../private/SkTemplates.h" |
| #include "SkColor.h" |
| +#include "SkColorSpace.h" |
| #include "SkEncodedFormat.h" |
| #include "SkImageInfo.h" |
| #include "SkSize.h" |
| @@ -99,6 +100,12 @@ public: |
| const SkImageInfo& getInfo() const { return fSrcInfo; } |
| /** |
| + * Returns the color space associated with the codec. |
|
scroggo
2016/02/24 13:58:12
Does not affect ownership
msarett
2016/02/24 17:32:35
Done.
|
| + * Might be NULL. |
| + */ |
| + SkColorSpace* getColorSpace() const { return fColorSpace; } |
| + |
| + /** |
| * Return a size that approximately supports the desired scale factor. |
| * The codec may not be able to scale efficiently to the exact scale |
| * factor requested, so return a size that approximates that scale. |
| @@ -502,7 +509,7 @@ public: |
| int outputScanline(int inputScanline) const; |
| protected: |
| - SkCodec(const SkImageInfo&, SkStream*); |
| + SkCodec(const SkImageInfo&, SkStream*, SkColorSpace* colorSpace = nullptr); |
|
scroggo
2016/02/24 13:58:12
Takes ownership (I guess it already does with SkSt
msarett
2016/02/24 17:32:35
I'm going with "Refs the SkColorSpace*". Done.
|
| virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const { |
| // By default, scaling is not supported. |
| @@ -630,13 +637,15 @@ protected: |
| virtual int onOutputScanline(int inputScanline) const; |
| private: |
| - const SkImageInfo fSrcInfo; |
| - SkAutoTDelete<SkStream> fStream; |
| - bool fNeedsRewind; |
| + const SkImageInfo fSrcInfo; |
| + SkAutoTDelete<SkStream> fStream; |
| + bool fNeedsRewind; |
| + SkAutoTDelete<SkColorSpace> fColorSpace; |
|
scroggo
2016/02/24 13:58:12
It looks like SkColorSpace is ref-counted, so this
msarett
2016/02/24 17:32:35
Yes I think you're right.
|
| + |
| // These fields are only meaningful during scanline decodes. |
| - SkImageInfo fDstInfo; |
| - SkCodec::Options fOptions; |
| - int fCurrScanline; |
| + SkImageInfo fDstInfo; |
| + SkCodec::Options fOptions; |
| + int fCurrScanline; |
| /** |
| * Return whether these dimensions are supported as a scale. |