Chromium Code Reviews| Index: include/core/SkImageDecoder.h |
| diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h |
| index b258afedce184e79f3907c7cf8f29a6318c068ba..cf506e7ef191a2ec3b92a87e3b569d095d6ec768 100644 |
| --- a/include/core/SkImageDecoder.h |
| +++ b/include/core/SkImageDecoder.h |
| @@ -46,6 +46,19 @@ public: |
| */ |
| virtual Format getFormat() const; |
| + |
| + /** Returns the sizes of each component of the image |
| + */ |
| + virtual bool getComponentSizes(SkStream* stream, SkISize sizes[3]) { |
| + return this->onGetComponentSizes(stream, sizes); |
| + } |
| + |
| + /* Assigns buffers for YUV decoding |
| + */ |
| + void setYUVBuffers(void* yuv[3], size_t rowBytes[3]) { |
| + this->onSetYUVBuffers(yuv, rowBytes); |
| + } |
| + |
| /** Return the format of the SkStreamRewindable or kUnknown_Format if it cannot be determined. |
| Rewinds the stream before returning. |
| */ |
| @@ -384,6 +397,16 @@ protected: |
| return false; |
| } |
| + /* If the decoder wants to support YUV based decoding, this method must be overridden. |
| + */ |
| + virtual void onSetYUVBuffers(void* yuv[3], size_t rowBytes[3]) {} |
|
scroggo
2014/07/25 20:48:34
Why not create a new entry point? Right now the cl
|
| + |
| + /** Returns the sizes of each component of the image |
| + */ |
| + virtual bool onGetComponentSizes(SkStream*, SkISize sizes[3]) { |
| + return false; |
| + } |
| + |
| /* |
| * Crop a rectangle from the src Bitmap to the dest Bitmap. src and dst are |
| * both sampled by sampleSize from an original Bitmap. |