Chromium Code Reviews| Index: include/codec/SkCodec.h |
| diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
| index c3a5873d7f9fb77e03027f684d573061bc9c3dd2..cf6694b36248fa3ee1131cce2cb9a0c9557f8f2e 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,13 @@ public: |
| const SkImageInfo& getInfo() const { return fSrcInfo; } |
| /** |
| + * Returns the color space associated with the codec. |
| + * Does not affect ownership. |
| + * 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 +510,11 @@ public: |
| int outputScanline(int inputScanline) const; |
| protected: |
| - SkCodec(const SkImageInfo&, SkStream*); |
| + /** |
| + * Takes ownership of SkStream* |
| + * Refs SkColorSpace* |
|
scroggo
2016/02/24 18:31:36
It looks like this does not call ref on the SkColo
msarett
2016/02/29 21:47:54
Gotcha of course. The SkColorSpace* will be delet
|
| + */ |
| + SkCodec(const SkImageInfo&, SkStream*, SkColorSpace* = nullptr); |
| virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const { |
| // By default, scaling is not supported. |
| @@ -630,13 +642,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; |
| + SkAutoTUnref<SkColorSpace> fColorSpace; |
| + |
| // 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. |