From 99f75b810dfb82643c829d1f6906fb052d0e4af1 Mon Sep 17 00:00:00 2001 From: Ojan Vafai Date: Wed, 14 Jan 2015 16:18:39 -0800 Subject: [PATCH] Inline paintInvalidationOrMarkForLayout. The name doesn't really match what it does at all. R=abarth@chromium.org Review URL: https://codereview.chromium.org/854573003 --- engine/core/rendering/RenderImage.cpp | 37 ++++++++++++--------------- engine/core/rendering/RenderImage.h | 1 - 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/engine/core/rendering/RenderImage.cpp b/engine/core/rendering/RenderImage.cpp index 8e757119190..f04aabd61fb 100644 --- a/engine/core/rendering/RenderImage.cpp +++ b/engine/core/rendering/RenderImage.cpp @@ -113,27 +113,6 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) if (hasBoxDecorationBackground() || hasMask()) RenderReplaced::imageChanged(newImage, rect); - paintInvalidationOrMarkForLayout(rect); -} - -void RenderImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize) -{ - if (m_imageResource->errorOccurred() || !m_imageResource->hasImage()) - return; - setIntrinsicSize(newSize); -} - -void RenderImage::updateInnerContentRect() -{ - // Propagate container size to the image resource. - LayoutRect containerRect = replacedContentRect(); - IntSize containerSize(containerRect.width(), containerRect.height()); - if (!containerSize.isEmpty()) - m_imageResource->setContainerSizeForRenderer(containerSize); -} - -void RenderImage::paintInvalidationOrMarkForLayout(const IntRect* rect) -{ ASSERT(isRooted()); LayoutSize oldIntrinsicSize = intrinsicSize(); @@ -167,6 +146,22 @@ void RenderImage::paintInvalidationOrMarkForLayout(const IntRect* rect) } } +void RenderImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize) +{ + if (m_imageResource->errorOccurred() || !m_imageResource->hasImage()) + return; + setIntrinsicSize(newSize); +} + +void RenderImage::updateInnerContentRect() +{ + // Propagate container size to the image resource. + LayoutRect containerRect = replacedContentRect(); + IntSize containerSize(containerRect.width(), containerRect.height()); + if (!containerSize.isEmpty()) + m_imageResource->setContainerSizeForRenderer(containerSize); +} + void RenderImage::notifyFinished(Resource* newImage) { if (!m_imageResource) diff --git a/engine/core/rendering/RenderImage.h b/engine/core/rendering/RenderImage.h index 63984b706a3..829bd7fb97e 100644 --- a/engine/core/rendering/RenderImage.h +++ b/engine/core/rendering/RenderImage.h @@ -78,7 +78,6 @@ private: virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox*) const override final; - void paintInvalidationOrMarkForLayout(const IntRect* = 0); void updateIntrinsicSizeIfNeeded(const LayoutSize& newSize); // Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect. void updateInnerContentRect();