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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

Issue 2495183002: Pull up initFrameBuffer to ImageDecoder. (Closed)
Patch Set: Solved merge conflict with crrev.com/2494363002 Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
index cb8ccebc0d91dd6a8319b1342863ece1bd302189..05197ff5a7f3971d5c9433248f39137f41d47dd1 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -304,6 +304,12 @@ class PLATFORM_EXPORT ImageDecoder {
// returns that number.
virtual size_t decodeFrameCount() { return 1; }
+ // Called to initialize the frame buffer with the given index, based on the
+ // provided and previous frame's characteristics. Returns true on success. On
+ // failure, this will mark the image as failed. Before calling this method,
+ // the caller must verify that the frame exists.
+ bool initFrameBuffer(size_t);
+
// Performs any additional setup of the requested frame after it has been
// initially created, e.g. setting a duration or disposal method.
virtual void initializeNewFrame(size_t) {}
@@ -358,6 +364,14 @@ class PLATFORM_EXPORT ImageDecoder {
bool m_purgeAggressively;
+ // This methods gets called at the end of initFrameBuffer. Subclasses can do
+ // format specific initialization, for e.g. alpha settings, here.
+ virtual void onInitFrameBuffer(size_t){};
+
+ // Called by initFrameBuffer to determine if it can take the bitmap of the
+ // previous frame. This condition is different for GIF and WEBP.
+ virtual bool canReusePreviousFrameBuffer(size_t) const { return false; }
+
IntSize m_size;
bool m_sizeAvailable = false;
bool m_isAllDataReceived = false;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698