Chromium Code Reviews| Index: Source/core/rendering/RenderObject.cpp |
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
| index 35f06e3a4147574ce162536bc6ce6959ae9ec2d1..fab4cf3f4bef068f5e7cd6c09573fd70a1a5b3e7 100644 |
| --- a/Source/core/rendering/RenderObject.cpp |
| +++ b/Source/core/rendering/RenderObject.cpp |
| @@ -746,13 +746,19 @@ void RenderObject::invalidateContainerPreferredLogicalWidths() |
| void RenderObject::setLayerNeedsFullRepaint() |
| { |
| ASSERT(hasLayer()); |
| - toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsFullRepaint); |
| + if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| + setShouldDoFullRepaintAfterLayout(true); |
| + else |
| + toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsFullRepaint); |
| } |
| void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout() |
| { |
| ASSERT(hasLayer()); |
| - toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsFullRepaintForPositionedMovementLayout); |
| + if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| + setShouldDoFullRepaintAfterLayout(true); |
|
Julien - ping for review
2014/03/04 18:22:10
This is wrong :-/
It's OK to put a FIXME but this
dsinclair
2014/03/04 19:21:52
Done.
Had to store another flag in this case so w
|
| + else |
| + toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsFullRepaintForPositionedMovementLayout); |
| } |
| RenderBlock* RenderObject::containerForFixedPosition(const RenderLayerModelObject* repaintContainer, bool* repaintContainerSkipped) const |
| @@ -1600,6 +1606,9 @@ void RenderObject::repaintOverflow() |
| bool RenderObject::checkForRepaint() const |
| { |
| + if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| + return !document().view()->needsFullRepaint() && everHadLayout(); |
|
Julien - ping for review
2014/03/04 18:22:10
FYI I think we shouldn't check everHadLayout() her
dsinclair
2014/03/04 19:21:52
Ack.
|
| + |
| return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayout(); |
| } |
| @@ -3314,6 +3323,64 @@ bool RenderObject::isRelayoutBoundaryForInspector() const |
| return objectIsRelayoutBoundary(this); |
| } |
| +const LayoutRect RenderObject::newOutlineRect() |
| +{ |
| + ASSERT(hasOutline()); |
|
Julien - ping for review
2014/03/04 18:22:10
The outline rectangle includes the box shadow too
dsinclair
2014/03/04 19:21:52
So, then the shadow isn't included in the repaint
Julien - ping for review
2014/03/07 18:26:38
It is actually included in the repaint rect (see a
|
| + |
| + OutlineRects* outlineRects = view()->outlineRects(); |
| + OutlineRects::iterator it = outlineRects->find(this); |
| + if (it == outlineRects->end()) |
| + return outlineBoundsForRepaint(containerForRepaint()); |
| + return it->value.newOutlineRect; |
| +} |
| + |
| +void RenderObject::setNewOutlineRect(const LayoutRect& rect) |
| +{ |
| + ASSERT(hasOutline()); |
| + |
| + OutlineRects* outlineRects = view()->outlineRects(); |
| + OutlineRects::iterator it = outlineRects->find(this); |
| + if (it == outlineRects->end()) |
| + outlineRects->set(this, OutlineRectInfo()); |
| + |
| + outlineRects->get(this).newOutlineRect = rect; |
| +} |
| + |
| +const LayoutRect RenderObject::oldOutlineRect() |
|
Julien - ping for review
2014/03/04 18:22:10
I don't see the point in making a copy of LayoutRe
dsinclair
2014/03/04 19:21:52
Done.
|
| +{ |
| + ASSERT(hasOutline()); |
| + |
| + OutlineRects* outlineRects = view()->outlineRects(); |
| + OutlineRects::iterator it = outlineRects->find(this); |
| + if (it == outlineRects->end()) |
| + return LayoutRect(); |
| + return it->value.oldOutlineRect; |
| +} |
| + |
| +void RenderObject::setOldOutlineRect(const LayoutRect& rect) |
| +{ |
| + ASSERT(hasOutline()); |
| + |
| + OutlineRects* outlineRects = view()->outlineRects(); |
| + OutlineRects::iterator it = outlineRects->find(this); |
| + if (it == outlineRects->end()) |
| + outlineRects->set(this, OutlineRectInfo()); |
| + outlineRects->get(this).oldOutlineRect = rect; |
| +} |
| + |
| +void RenderObject::clearRepaintState() |
| +{ |
| + setShouldDoFullRepaintAfterLayout(false); |
| + setShouldDoFullRepaintIfSelfPaintingLayer(false); |
| + setShouldRepaintOverflowIfNeeded(false); |
| + setLayoutDidGetCalled(false); |
| + |
| + OutlineRects* outlineRects = view()->outlineRects(); |
| + OutlineRects::iterator it = outlineRects->find(this); |
| + if (it != outlineRects->end()) |
| + outlineRects->remove(it); |
| +} |
| + |
| } // namespace WebCore |
| #ifndef NDEBUG |