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