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..8bc902f86eab8818d214315a0bec74fc09cdabcd 100644 |
--- a/Source/platform/image-decoders/ImageDecoder.h |
+++ b/Source/platform/image-decoders/ImageDecoder.h |
@@ -49,6 +49,20 @@ |
namespace blink { |
+// DecodingBuffers can be used to decode color components into provided buffers instead of using an ImageFrame. |
+class DecodingBuffers { |
Alpha Left Google
2014/07/24 22:07:27
This should be called ImagePlanes to be clear.
sugoi1
2014/07/24 23:16:35
Acknowledged.
|
+public: |
+ DecodingBuffers(); |
+ |
+ void set(void* planes[3], size_t rowBytes[3]); |
Alpha Left Google
2014/07/24 22:07:27
It will not always be 3 planes but it's good for n
sugoi1
2014/07/24 23:16:35
Acknowledged.
|
+ void* getPlane(int); |
Noel Gordon
2014/07/25 15:55:01
blink webcore convention: no "get" prefix in class
sugoi1
2014/07/25 16:56:48
Done.
|
+ size_t getRowBytes(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. |
// |
@@ -100,7 +114,7 @@ public: |
// Decoders which downsample images should override this method to |
// return the actual decoded size. |
- virtual IntSize decodedSize() const { return size(); } |
+ virtual IntSize decodedSize(int component = 0) const { return size(); } |
Noel Gordon
2014/07/25 15:55:01
I believe the Androids might downsample when decod
sugoi1
2014/07/25 16:56:48
Looking at DecodingImageGenerator::onGetPixels() :
|
// This will only differ from size() for ICO (where each frame is a |
// different icon) or other formats where different frames are different |
@@ -252,6 +266,11 @@ public: |
m_frameBufferCache[0].setMemoryAllocator(allocator); |
} |
Alpha Left Google
2014/07/24 22:07:26
How do I know if the code that uses this decoder c
sugoi1
2014/07/24 23:16:35
I'm not sure I understand your question. The code
Alpha Left Google
2014/07/24 23:30:56
I mean there's different types of subsampling. My
sugoi1
2014/07/25 02:55:13
Well, the caller first receives the size of the Y,
|
+ virtual void setAcceleratedYUVDecoding(bool) { } |
Alpha Left Google
2014/07/24 22:07:26
nit: drop "accelerated" from methods names. Decodi
sugoi1
2014/07/24 23:16:35
Acknowledged.
|
+ virtual bool acceleratedYUVDecoding() const { return false; } |
+ virtual bool doAcceleratedYUVDecoding() { return false; } |
+ virtual void setDecodingBuffers(OwnPtr<DecodingBuffers>&) { } |
+ |
protected: |
// Calculates the most recent frame whose image data may be needed in |
// order to decode frame |frameIndex|, based on frame disposal methods |