Inline paintInvalidationOrMarkForLayout.

The name doesn't really match what it does at all.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/854573003
This commit is contained in:
Ojan Vafai 2015-01-14 16:18:39 -08:00
parent 36c0a428a3
commit 99f75b810d
2 changed files with 16 additions and 22 deletions

View File

@ -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)

View File

@ -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();