| Index: Source/platform/image-decoders/ImageDecoder.h
|
| diff --git a/Source/platform/image-decoders/ImageDecoder.h b/Source/platform/image-decoders/ImageDecoder.h
|
| index 559213011fae93fa14db64b85678ba0c704652f1..b9dfb75fb809a368db8ab1c12316c3e16606da03 100644
|
| --- a/Source/platform/image-decoders/ImageDecoder.h
|
| +++ b/Source/platform/image-decoders/ImageDecoder.h
|
| @@ -49,6 +49,20 @@
|
|
|
| namespace blink {
|
|
|
| +// ImagePlanes can be used to decode color components into provided buffers instead of using an ImageFrame.
|
| +class PLATFORM_EXPORT ImagePlanes {
|
| +public:
|
| + ImagePlanes();
|
| +
|
| + void set(void* planes[3], size_t rowBytes[3]);
|
| + void* plane(int);
|
| + size_t rowBytes(int) const;
|
| +
|
| +private:
|
| + void* m_planes[3];
|
| + size_t m_rowBytes[3];
|
| +};
|
| +
|
| // ImageDecoder is a base for all format-specific decoders
|
| // (e.g. JPEGImageDecoder). This base manages the ImageFrame cache.
|
| //
|
| @@ -102,6 +116,10 @@ public:
|
| // return the actual decoded size.
|
| virtual IntSize decodedSize() const { return size(); }
|
|
|
| + // Decoders which support YUV decoding can override this to
|
| + // give potentially different sizes per component.
|
| + virtual IntSize decodedYUVSize(int component) const { return decodedSize(); }
|
| +
|
| // This will only differ from size() for ICO (where each frame is a
|
| // different icon) or other formats where different frames are different
|
| // sizes. This does NOT differ from size() for GIF or WebP, since
|
| @@ -252,6 +270,10 @@ public:
|
| m_frameBufferCache[0].setMemoryAllocator(allocator);
|
| }
|
|
|
| + virtual bool YUVDecoding() const { return false; }
|
| + virtual bool decodeToYUV() { return false; }
|
| + virtual void setImagePlanes(OwnPtr<ImagePlanes>&) { }
|
| +
|
| protected:
|
| // Calculates the most recent frame whose image data may be needed in
|
| // order to decode frame |frameIndex|, based on frame disposal methods
|
|
|