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

Unified Diff: third_party/WebKit/Source/core/frame/ImageBitmap.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: finalizePixelsAndGetImage. Created 4 years, 4 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/core/frame/ImageBitmap.cpp
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
index 990fd97df9293e470145e6e37e5d0c9368ae8726..c87e3eb627e6bc5ac6d4830b2a9ca93db0cce713 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -42,12 +42,6 @@ static inline IntRect normalizeRect(const IntRect& rect)
std::max(rect.height(), -rect.height()));
}
-static bool frameIsValid(const SkBitmap& frameBitmap)
-{
- ASSERT(!frameBitmap.isNull() && !frameBitmap.empty() && frameBitmap.isImmutable());
- return frameBitmap.colorType() == kN32_SkColorType;
-}
-
ParsedOptions parseOptions(const ImageBitmapOptions& options, Optional<IntRect> cropRect, IntSize sourceSize)
{
ParsedOptions parsedOptions;
@@ -180,10 +174,8 @@ PassRefPtr<SkImage> ImageBitmap::getSkImageFromDecoder(std::unique_ptr<ImageDeco
ImageFrame* frame = decoder->frameBufferAtIndex(0);
if (!frame || frame->getStatus() != ImageFrame::FrameComplete)
return nullptr;
- SkBitmap bitmap = frame->bitmap();
- if (!frameIsValid(bitmap))
- return nullptr;
- return fromSkSp(SkImage::MakeFromBitmap(bitmap));
+ DCHECK_EQ(frame->bitmap().colorType(), kN32_SkColorType);
Peter Kasting 2016/08/30 06:59:40 The old code handled this conditionally, so this i
aleksandar.stojiljkovic 2016/09/21 20:56:57 Done. Didn't see how it could be different from kN
+ return frame->finalizePixelsAndGetImage();
}
bool ImageBitmap::isResizeOptionValid(const ImageBitmapOptions& options, ExceptionState& exceptionState)

Powered by Google App Engine
This is Rietveld 408576698