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

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 1482953002: Drop dependency on LayoutObject in fetch/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fix Created 5 years, 1 month 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/BitmapImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
index 80d9482b1ad892bd8a88d69a286dbfa96fa314f8..38cbbf4e99cc85906d010162e9da773bf0b1b5b3 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -436,8 +436,13 @@ bool BitmapImage::frameHasAlphaAtIndex(size_t index)
return m_source.frameHasAlphaAtIndex(index);
}
-bool BitmapImage::currentFrameKnownToBeOpaque()
+bool BitmapImage::currentFrameKnownToBeOpaque(MetadataMode metadataMode)
{
+ if (metadataMode == PreCacheMetadata) {
+ // frameHasAlphaAtIndex() conservatively returns false for uncached frames. To increase the
+ // chance of an accurate answer, pre-cache the current frame metadata.
+ frameAtIndex(currentFrame());
+ }
return !frameHasAlphaAtIndex(currentFrame());
}

Powered by Google App Engine
This is Rietveld 408576698