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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.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/graphics/gpu/WebGLImageConversion.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
index 8a05ea3ff90fcb443fc5731ca2ba45f8a20c4de3..0b30ee2bc1d00285bf5816863eca5e1b845e9edf 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -1947,7 +1947,6 @@ bool frameIsValid(const SkBitmap& frameBitmap)
{
return !frameBitmap.isNull()
&& !frameBitmap.empty()
- && frameBitmap.isImmutable()
&& frameBitmap.colorType() == kN32_SkColorType;
}
@@ -2173,11 +2172,10 @@ void WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha, b
if (!frameIsValid(bitmap))
return;
- // TODO(fmalita): Partial frames are not supported currently: frameIsValid ensures that
- // only immutable/fully decoded frames make it through. We could potentially relax this
- // and allow SkImage::NewFromBitmap to make a copy.
- ASSERT(bitmap.isImmutable());
- skiaImage = SkImage::MakeFromBitmap(bitmap);
+ // TODO(fmalita): Partial frames are not supported currently: only fully
+ // decoded frames make it through. We could potentially relax this and
+ // use SkImage::MakeFromBitmap(bitmap) to make a copy.
+ skiaImage = frame->finalizePixelsAndGetImage();
info = bitmap.info();
if (hasAlpha && premultiplyAlpha)

Powered by Google App Engine
This is Rietveld 408576698