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

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: 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/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..f338a9d305c1a272844e8fe59d8ffeaafd374723 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -1924,14 +1924,6 @@ void FormatConverter::convert()
return;
}
-bool frameIsValid(const SkBitmap& frameBitmap)
-{
- return !frameBitmap.isNull()
- && !frameBitmap.empty()
- && frameBitmap.isImmutable()
- && frameBitmap.colorType() == kN32_SkColorType;
-}
-
} // anonymous namespace
WebGLImageConversion::PixelStoreParams::PixelStoreParams()
@@ -2150,18 +2142,17 @@ void WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha, b
if (!decoder->frameCount())
return;
ImageFrame* frame = decoder->frameBufferAtIndex(0);
+
+ // TODO(fmalita): Partial frames are not supported currently: only fully
+ // decoded frames make it through. We could potentially relax this and
+ // allow ImageFrame::finalizePixelsAndGetImage to make a copy.
Peter Kasting 2016/08/30 06:59:40 Isn't it already allowed to make a copy? Does thi
aleksandar.stojiljkovic 2016/09/21 20:56:57 By early return if "frame->getStatus() != ImageFra
if (!frame || frame->getStatus() != ImageFrame::FrameComplete)
return;
hasAlpha = frame->hasAlpha();
SkBitmap bitmap = frame->bitmap();
- 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));
+ DCHECK_EQ(bitmap.colorType(), kN32_SkColorType);
Peter Kasting 2016/08/30 06:59:40 Same comment as in ImageBitmap.cpp.
aleksandar.stojiljkovic 2016/09/21 20:56:57 Done.
+ skiaImage = frame->finalizePixelsAndGetImage();
info = bitmap.info();
if (hasAlpha && premultiplyAlpha)

Powered by Google App Engine
This is Rietveld 408576698