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

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.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/graphics/DeferredImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
index df4b86994d13c1d7ef177299c069132d5ffbdb52..2b69e002ee42b784fce005fc1de2c7976fabb38f 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -117,6 +117,8 @@ PassRefPtr<SkImage> DeferredImageDecoder::createFrameAtIndex(size_t index)
if (!frame || frame->getStatus() == ImageFrame::FrameEmpty)
return nullptr;
+ if (frame->getStatus() == ImageFrame::FrameComplete)
+ return fromSkSp(frame->finalizePixelsAndGetImage());
return fromSkSp(SkImage::MakeFromBitmap(frame->bitmap()));
Peter Kasting 2016/09/22 21:44:08 Nit: Avoids duplicating fromSkSp() call: return
aleksandar.stojiljkovic 2016/09/27 18:08:28 Done. The most recent refactoring removed the need
}

Powered by Google App Engine
This is Rietveld 408576698