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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutImage.cpp

Issue 1728313003: Split ImageResourceClient into ResourceClient and ImageResourceObserver [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and reflect comment Created 4 years, 9 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/layout/LayoutImage.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutImage.cpp b/third_party/WebKit/Source/core/layout/LayoutImage.cpp
index bbb81831e358837ecc7c8e28b0520e71b81a2cc7..78265abfe5c678a0097ce4350504e72fb012fa64 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImage.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutImage.cpp
@@ -89,10 +89,10 @@ void LayoutImage::setImageResource(PassOwnPtrWillBeRawPtr<LayoutImageResource> i
{
ASSERT(!m_imageResource);
m_imageResource = imageResource;
- m_imageResource->initialize(this, this);
+ m_imageResource->initialize(this);
}
-void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
+void LayoutImage::imageChanged(bool isNotifyingFinish, WrappedImagePtr newImage, const IntRect* rect)
{
ASSERT(view());
ASSERT(view()->frameView());
@@ -100,11 +100,20 @@ void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
return;
if (hasBoxDecorationBackground() || hasMask() || hasShapeOutside())
- LayoutReplaced::imageChanged(newImage, rect);
+ LayoutReplaced::imageChanged(isNotifyingFinish, newImage, rect);
if (!m_imageResource)
return;
+ if (isNotifyingFinish) {
+ invalidateBackgroundObscurationStatus();
+ if (newImage == m_imageResource->cachedImage()) {
+ // tell any potential compositing layers
+ // that the image is done and they can reference it directly.
+ contentChanged(ImageChanged);
+ }
+ }
+
if (newImage != m_imageResource->imagePtr())
return;
@@ -175,23 +184,6 @@ void LayoutImage::invalidatePaintAndMarkForLayoutIfNeeded()
contentChanged(ImageChanged);
}
-void LayoutImage::notifyFinished(Resource* newImage)
-{
- if (!m_imageResource)
- return;
-
- if (documentBeingDestroyed())
- return;
-
- invalidateBackgroundObscurationStatus();
-
- if (newImage == m_imageResource->cachedImage()) {
- // tell any potential compositing layers
- // that the image is done and they can reference it directly.
- contentChanged(ImageChanged);
- }
-}
-
void LayoutImage::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
{
ImagePainter(*this).paintReplaced(paintInfo, paintOffset);

Powered by Google App Engine
This is Rietveld 408576698