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

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

Issue 2618633004: Add support for Animated PNG (Closed)
Patch Set: Fix LayoutTest due to accept header change Created 3 years, 9 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/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 de85ae0cfac38c1ec639927926eaff9bc04a4254..fa0a989994df1bcca5748e9c2570c18a630631c2 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -258,13 +258,15 @@ class PLATFORM_EXPORT ImageDecoder {
// and returns true. Otherwise returns false.
virtual bool hotSpot(IntPoint&) const { return false; }
- virtual void setMemoryAllocator(SkBitmap::Allocator* allocator) {
+ void setMemoryAllocator(SkBitmap::Allocator* allocator) {
// FIXME: this doesn't work for images with multiple frames.
if (m_frameBufferCache.isEmpty()) {
- m_frameBufferCache.resize(1);
- m_frameBufferCache[0].setRequiredPreviousFrameIndex(
- findRequiredPreviousFrame(0, false));
+ // Ensure that initializeNewFrame is called, after parsing if
+ // necessary.
+ if (!frameCount())
+ return;
}
+
m_frameBufferCache[0].setMemoryAllocator(allocator);
}
@@ -313,9 +315,11 @@ class PLATFORM_EXPORT ImageDecoder {
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.
+ // provided and previous frame's characteristics. Returns true on success.
+ // Before calling this method, the caller must verify that the frame exists.
+ // On failure, the client should call setFailed. This method does not call
+ // setFailed itself because that might delete the object directly making this
+ // call.
bool initFrameBuffer(size_t);
// Performs any additional setup of the requested frame after it has been

Powered by Google App Engine
This is Rietveld 408576698