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 19ed900844e6134debd272d79dc5a90b4a48d498..6bd22c923ea3ab9b77ed1e4398427c6af54cfd5c 100644 |
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp |
@@ -384,10 +384,17 @@ bool BitmapImage::frameHasAlphaAtIndex(size_t index) |
if (m_frames.size() <= index) |
return true; |
+ if (m_frames[index].m_haveMetadata && !m_frames[index].m_hasAlpha) |
+ return false; |
+ |
+ // m_hasAlpha may change after m_haveMetadata is set to true, so always ask |
+ // ImageSource for the value if the cached value is the default value. |
+ bool hasAlpha = m_source.frameHasAlphaAtIndex(index); |
Stephen Chennney
2016/08/09 14:22:31
Based on trying a similar change I believe this ha
Xianzhu
2016/08/09 18:51:48
Which benchmark do you think the best to reflect t
Stephen Chennney
2016/08/09 19:06:04
I would try a cluster telemetry run. Here's the on
|
+ |
if (m_frames[index].m_haveMetadata) |
- return m_frames[index].m_hasAlpha; |
+ m_frames[index].m_hasAlpha = hasAlpha; |
- return m_source.frameHasAlphaAtIndex(index); |
+ return hasAlpha; |
} |
bool BitmapImage::currentFrameKnownToBeOpaque(MetadataMode metadataMode) |