mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
36c0a428a3
commit
99f75b810d
@ -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)
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user