Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h

Issue 1460523002: GIF decoding to Index8, unit tests and misusing unit test as benchmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 acf7b75658dd96f53aafb5720e1a75db0ecc9826..8784400dad2afe20e7e47550fb6abb7509746642 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
@@ -70,7 +70,7 @@ public:
// Decodes and scales the specified frame at |index|. The dimensions and output
// format are given in SkImageInfo. Decoded pixels are written 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]);
@@ -91,6 +91,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:
ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer>, bool allDataReceived, bool isMultiFrame);
@@ -102,11 +106,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;
@@ -138,6 +142,7 @@ private:
#if COMPILER(MSVC)
friend struct ::WTF::OwnedPtrDeleter<ExternalMemoryAllocator>;
#endif
+ bool m_decoderCanDecodeToIndex8;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698