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

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 in ImageFrame::copy/take. 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 d4b14e300c3491b823cb21bf9e03749feae2f3f4..f7b8ef4a3615d34b017653564ccc114040e672fa 100644
--- a/third_party/WebKit/Source/platform/exported/WebImage.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebImage.cpp
@@ -78,7 +78,7 @@ WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize)
}
ImageFrame* frame = decoder->frameBufferAtIndex(index);
- if (!frame)
+ if (!frame || decoder->failed())
return WebImage();
return WebImage(frame->bitmap());
Peter Kasting 2016/09/22 21:44:08 Nit: Shorter: return (frame && !decoder->failed
aleksandar.stojiljkovic 2016/09/27 18:08:28 Done.
@@ -114,9 +114,10 @@ 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) {
Peter Kasting 2016/09/22 21:44:08 Nit: No {}
aleksandar.stojiljkovic 2016/09/27 18:08:28 Done.
frames.append(WebImage(bitmap));
+ }
}
return frames;

Powered by Google App Engine
This is Rietveld 408576698