Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: Source/core/rendering/RenderInline.cpp

Issue 380583003: Revert of Revert of Divorce PaintInvalidationState from LayoutState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderInline.h ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 @@
return rect;
}
-LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer) const
-{
- ASSERT(!view() || !view()->layoutStateCachedOffsetsEnabled());
-
+LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
+{
if (!firstLineBoxIncludingCulling() && !continuation())
return LayoutRect();
@@ -1024,7 +1022,7 @@
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 @@
return repaintRect;
}
-LayoutRect RenderInline::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth) const
-{
- LayoutRect r(RenderBoxModelObject::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth));
+LayoutRect RenderInline::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidationState* paintInvalidationState) const
+{
+ 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
-{
- 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;
- }
+void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidationState* paintInvalidationState) 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 (paintInvalidationContainer == this)
@@ -1109,7 +1103,7 @@
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 @@
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 @@
return;
}
- o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
+ o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed, paintInvalidationState);
}
void RenderInline::updateDragState(bool dragOn)
@@ -1569,10 +1560,12 @@
regions.append(region);
}
-void RenderInline::invalidateTreeAfterLayout(const RenderLayerModelObject& paintInvalidationContainer)
-{
- LayoutState state(*this);
- RenderObject::invalidateTreeAfterLayout(paintInvalidationContainer);
+void RenderInline::invalidateTreeAfterLayout(const PaintInvalidationState& paintInvalidationState)
+{
+ bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer();
+ const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
+ PaintInvalidationState childPaintInvalidationState(paintInvalidationState, *this, newPaintInvalidationContainer);
+ RenderObject::invalidateTreeAfterLayout(paintInvalidationState);
}
} // namespace WebCore
« no previous file with comments | « Source/core/rendering/RenderInline.h ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698