Index: third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
index 39d3c40b00713a5849d327db5aa0bc9b17454317..3615fefabfb10770ed9ef745b409889d2233d9f9 100644 |
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
@@ -68,7 +68,7 @@ public: |
// into |pixels| with a stride of |rowBytes|. |
// |
// Returns true if decoding was successful. |
- bool decodeAndScale(const SkImageInfo&, size_t index, void* pixels, size_t rowBytes); |
+ bool decodeAndScale(const SkImageInfo&, size_t index, void* pixels, size_t rowBytes, SkPMColor ctable[] = nullptr, int* ctableCount = nullptr); |
// Decodes YUV components directly into the provided memory planes. |
bool decodeToYUV(SkISize componentSizes[3], void* planes[3], size_t rowBytes[3]); |
@@ -87,6 +87,10 @@ public: |
bool getYUVComponentSizes(SkISize componentSizes[3]); |
+ // Specifies that there is decoder support, to optimize when to call canDecodeTo(). |
+ void setDecoderCanDecodeToIndex8(bool canIt) { m_decoderCanDecodeToIndex8 = canIt; } |
+ bool canDecodeTo(size_t index, SkColorType outputType); |
+ |
private: |
class ExternalMemoryAllocator; |
friend class ImageFrameGeneratorTest; |
@@ -97,11 +101,11 @@ private: |
void setHasAlpha(size_t index, bool hasAlpha); |
// These methods are called while m_decodeMutex is locked. |
- SkBitmap tryToResumeDecode(const SkISize& scaledSize, size_t index); |
+ SkBitmap tryToResumeDecode(const SkISize& scaledSize, size_t index, SkColorType outputColor); |
// Use the given decoder to decode. If a decoder is not given then try to create one. |
// Returns true if decoding was complete. |
- bool decode(size_t index, ImageDecoder**, SkBitmap*); |
+ bool decode(size_t index, ImageDecoder**, SkBitmap*, SkColorType); |
SkISize m_fullSize; |
ThreadSafeDataTransport m_data; |
@@ -120,6 +124,8 @@ private: |
// Protect concurrent access to m_hasAlpha. |
Mutex m_alphaMutex; |
+ |
+ bool m_decoderCanDecodeToIndex8; |
}; |
} // namespace blink |