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

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

Issue 2495183002: Pull up initFrameBuffer to ImageDecoder. (Closed)
Patch Set: Make ImageDecoder::initFrameBuffer const-correct. 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
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 d6169b58aeebc72104ed8a14f883ad644a14f644..1aa1b93c3ae2e61f757a6486f695e61293e709e5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -301,6 +301,16 @@ 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 callee must verify that the frame exists.
scroggo_chromium 2016/11/14 13:51:45 caller*
joostouwerling 2016/11/14 16:25:09 Done.
+ virtual bool initFrameBuffer(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; }
scroggo_chromium 2016/11/14 13:51:45 This one doesn't actually need to be virtual. We n
joostouwerling 2016/11/14 16:25:09 For only GIF and WebP, this would be fine, but for
+
// 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) {}

Powered by Google App Engine
This is Rietveld 408576698