Index: Source/core/rendering/RenderInline.cpp |
diff --git a/Source/core/rendering/RenderInline.cpp b/Source/core/rendering/RenderInline.cpp |
index 1eae3588d0e03de0dc2a1f1038eef16a2d848234..80041d5a9347a75ed72c0db09d8dfafa1641db3b 100644 |
--- a/Source/core/rendering/RenderInline.cpp |
+++ b/Source/core/rendering/RenderInline.cpp |
@@ -989,8 +989,10 @@ LayoutRect RenderInline::linesVisualOverflowBoundingBox() const |
return rect; |
} |
-LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const |
+LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer) const |
{ |
+ ASSERT(!view() || !view()->layoutStateCachedOffsetsEnabled()); |
+ |
if (!firstLineBoxIncludingCulling() && !continuation()) |
return LayoutRect(); |
@@ -1022,7 +1024,7 @@ LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay |
if (cb->hasOverflowClip()) |
cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect); |
- cb->mapRectToPaintInvalidationBacking(paintInvalidationContainer, repaintRect, paintInvalidationState); |
+ cb->mapRectToPaintInvalidationBacking(paintInvalidationContainer, repaintRect); |
if (outlineSize) { |
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { |
@@ -1037,25 +1039,29 @@ LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay |
return repaintRect; |
} |
-LayoutRect RenderInline::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidationState* paintInvalidationState) const |
+LayoutRect RenderInline::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth) const |
{ |
- LayoutRect r(RenderBoxModelObject::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth, paintInvalidationState)); |
+ LayoutRect r(RenderBoxModelObject::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth)); |
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { |
if (!curr->isText()) |
- r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth, paintInvalidationState)); |
+ r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth)); |
} |
return r; |
} |
-void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidationState* paintInvalidationState) const |
+void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed) const |
{ |
- if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) { |
- if (style()->hasInFlowPosition() && layer()) |
- rect.move(layer()->offsetForInFlowPosition()); |
- rect.move(paintInvalidationState->paintOffset()); |
- if (paintInvalidationState->isClipped()) |
- rect.intersect(paintInvalidationState->clipRect()); |
- return; |
+ if (RenderView* v = view()) { |
+ // LayoutState is only valid for root-relative repainting |
+ if (v->canMapUsingLayoutStateForContainer(paintInvalidationContainer)) { |
+ LayoutState* layoutState = v->layoutState(); |
+ if (style()->hasInFlowPosition() && layer()) |
+ rect.move(layer()->offsetForInFlowPosition()); |
+ rect.move(layoutState->paintOffset()); |
+ if (layoutState->isClipped()) |
+ rect.intersect(layoutState->clipRect()); |
+ return; |
+ } |
} |
if (paintInvalidationContainer == this) |
@@ -1103,7 +1109,7 @@ void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec |
return; |
} |
- o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, fixed, paintInvalidationState); |
+ o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, fixed); |
} |
LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, const LayoutPoint& point, bool* offsetDependsOnPoint) const |
@@ -1128,17 +1134,20 @@ LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, cons |
return offset; |
} |
-void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const |
+void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const |
{ |
if (repaintContainer == this) |
return; |
- if (paintInvalidationState && paintInvalidationState->canMapToContainer(repaintContainer)) { |
- LayoutSize offset = paintInvalidationState->paintOffset(); |
- if (style()->hasInFlowPosition() && layer()) |
- offset += layer()->offsetForInFlowPosition(); |
- transformState.move(offset); |
- return; |
+ if (RenderView *v = view()) { |
+ if (v->canMapUsingLayoutStateForContainer(repaintContainer)) { |
+ LayoutState* layoutState = v->layoutState(); |
+ LayoutSize offset = layoutState->paintOffset(); |
+ if (style()->hasInFlowPosition() && layer()) |
+ offset += layer()->offsetForInFlowPosition(); |
+ transformState.move(offset); |
+ return; |
+ } |
} |
bool containerSkipped; |
@@ -1172,7 +1181,7 @@ void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont |
return; |
} |
- o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed, paintInvalidationState); |
+ o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed); |
} |
void RenderInline::updateDragState(bool dragOn) |
@@ -1560,12 +1569,10 @@ void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) |
regions.append(region); |
} |
-void RenderInline::invalidateTreeAfterLayout(const PaintInvalidationState& paintInvalidationState) |
+void RenderInline::invalidateTreeAfterLayout(const RenderLayerModelObject& paintInvalidationContainer) |
{ |
- bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer(); |
- const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer()); |
- PaintInvalidationState childPaintInvalidationState(paintInvalidationState, *this, newPaintInvalidationContainer); |
- RenderObject::invalidateTreeAfterLayout(paintInvalidationState); |
+ LayoutState state(*this); |
+ RenderObject::invalidateTreeAfterLayout(paintInvalidationContainer); |
} |
} // namespace WebCore |