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

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 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/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 e294d1ffcbcc80f7936e30bb4d45f16b7e0f5584..9af45fa90a64480150a8813b0c18c46e6341604a 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -1928,7 +1928,6 @@ bool frameIsValid(const SkBitmap& frameBitmap)
{
return !frameBitmap.isNull()
&& !frameBitmap.empty()
- && frameBitmap.isImmutable()
&& frameBitmap.colorType() == kN32_SkColorType;
}
@@ -2157,11 +2156,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 = fromSkSp(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 = fromSkSp(frame->finalizePixelsAndGetImage());
info = bitmap.info();
if (hasAlpha && premultiplyAlpha)

Powered by Google App Engine
This is Rietveld 408576698