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

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

Issue 2229643002: Don't invalidate paint on background image change if it's obscured (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@BackgroundObscured
Patch Set: - 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/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)

Powered by Google App Engine
This is Rietveld 408576698