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

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: Comment #25 processed. Created 4 years, 11 months 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 a177341eb26952ef934cffeeb18943f947fa3976..ad79c15693af2019680c3eaf40d84876ea35cbb8 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
@@ -77,7 +77,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(size_t index, const SkImageInfo&, void* pixels, size_t rowBytes);
+ bool decodeAndScale(size_t index, const SkImageInfo&, void* pixels, size_t rowBytes, SkPMColor ctable[] = nullptr, int* ctableCount = nullptr);
// Decodes YUV components directly into the provided memory planes.
bool decodeToYUV(size_t index, 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);
@@ -135,6 +139,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