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

Unified Diff: third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp

Issue 2000483003: Rework timeline/frame scheduling logic for SVGImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unittest Created 4 years, 7 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/core/css/CSSCrossfadeValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
index 7b399d4d31cf00cb68767f44bde5271fd7d8a60e..7f90cf8f0f02b5ac4389ec5c3d26974b2f8198fb 100644
--- a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
@@ -249,12 +249,28 @@ void CSSCrossfadeValue::crossfadeChanged(const IntRect&)
}
}
+bool CSSCrossfadeValue::willRenderImage() const
+{
+ for (const auto& curr : clients()) {
+ if (const_cast<LayoutObject*>(curr.key)->willRenderImage())
+ return true;
+ }
+ return false;
+}
+
void CSSCrossfadeValue::CrossfadeSubimageObserverProxy::imageChanged(ImageResource*, const IntRect* rect)
{
if (m_ready)
m_ownerValue->crossfadeChanged(*rect);
}
+bool CSSCrossfadeValue::CrossfadeSubimageObserverProxy::willRenderImage()
+{
+ // If the images are not ready/loaded we won't paint them. If the images
+ // are ready then ask the clients.
+ return m_ready && m_ownerValue->willRenderImage();
+}
+
bool CSSCrossfadeValue::hasFailedOrCanceledSubresources() const
{
if (m_cachedFromImage && m_cachedFromImage->loadFailedOrCanceled())

Powered by Google App Engine
This is Rietveld 408576698