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

Unified Diff: third_party/WebKit/Source/platform/exported/WebImage.cpp

Issue 2155973002: Save a bitmap copy when advancing to dependent GIF and WebP animation frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK m_status in ImageFrame. Shortened commit message. Thanks kbr@. Created 4 years, 3 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/exported/WebImage.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebImage.cpp b/third_party/WebKit/Source/platform/exported/WebImage.cpp
index 15b0ecb5b216b33414e0389b92b8a055cca4aa4c..685cac9917583724e384850fc009949979fee865 100644
--- a/third_party/WebKit/Source/platform/exported/WebImage.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebImage.cpp
@@ -75,10 +75,7 @@ WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize)
}
ImageFrame* frame = decoder->frameBufferAtIndex(index);
- if (!frame)
- return WebImage();
-
- return WebImage(frame->bitmap());
+ return (frame && !decoder->failed()) ? WebImage(frame->bitmap()) : WebImage();
}
WebVector<WebImage> WebImage::framesFromData(const WebData& data)
@@ -108,8 +105,8 @@ WebVector<WebImage> WebImage::framesFromData(const WebData& data)
if (!frame)
continue;
- const SkBitmap& bitmap = frame->bitmap();
- if (!bitmap.isNull() && bitmap.isImmutable())
+ SkBitmap bitmap = frame->bitmap();
+ if (!bitmap.isNull() && frame->getStatus() == ImageFrame::FrameComplete)
frames.append(WebImage(bitmap));
}

Powered by Google App Engine
This is Rietveld 408576698