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

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

Issue 360833002: Divorce PaintInvalidationState from LayoutState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT again... 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
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index a271f68e5c85d7445c3f92f35ebfe153e096c7d8..f7ec67306de5cbf0cca3e93f9b28bf9d25ea7942 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1319,7 +1319,7 @@ void RenderObject::addChildFocusRingRects(Vector<IntRect>& rects, const LayoutPo
}
// FIXME: In repaint-after-layout, we should be able to change the logic to remove the need for this function. See crbug.com/368416.
-LayoutPoint RenderObject::positionFromPaintInvalidationContainer(const RenderLayerModelObject* paintInvalidationContainer) const
+LayoutPoint RenderObject::positionFromPaintInvalidationContainer(const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
{
// FIXME: This assert should be re-enabled when we move paint invalidation to after compositing update. crbug.com/360286
// ASSERT(containerForPaintInvalidation() == paintInvalidationContainer);
@@ -1328,7 +1328,7 @@ LayoutPoint RenderObject::positionFromPaintInvalidationContainer(const RenderLay
if (paintInvalidationContainer == this)
return offset;
- return roundedIntPoint(localToContainerPoint(offset, paintInvalidationContainer));
+ return roundedIntPoint(localToContainerPoint(offset, paintInvalidationContainer, 0, 0, paintInvalidationState));
}
IntRect RenderObject::absoluteBoundingBoxRect() const
@@ -1474,9 +1474,9 @@ static PassRefPtr<TraceEvent::ConvertableToTraceFormat> jsonObjectForPaintInvali
return value.finish();
}
-LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObject* paintInvalidationContainer) const
+LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
{
- return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer);
+ return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationState);
}
void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationReason) const
@@ -1535,11 +1535,11 @@ void RenderObject::paintInvalidationForWholeRenderer() const
invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationRect, InvalidationPaint);
}
-LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer) const
+LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
{
if (!paintInvalidationContainer)
- return computePaintInvalidationRect(paintInvalidationContainer);
- return RenderLayer::computePaintInvalidationRect(this, paintInvalidationContainer->layer());
+ return computePaintInvalidationRect(paintInvalidationContainer, paintInvalidationState);
+ return RenderLayer::computePaintInvalidationRect(this, paintInvalidationContainer->layer(), paintInvalidationState);
}
void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const
@@ -1596,7 +1596,7 @@ const char* RenderObject::invalidationReasonToString(InvalidationReason reason)
return "";
}
-void RenderObject::invalidateTreeAfterLayout(const RenderLayerModelObject& paintInvalidationContainer)
+void RenderObject::invalidateTreeAfterLayout(const PaintInvalidationState& paintInvalidationState)
{
// If we didn't need paint invalidation then our children don't need as well.
// Skip walking down the tree as everything should be fine below us.
@@ -1607,7 +1607,7 @@ void RenderObject::invalidateTreeAfterLayout(const RenderLayerModelObject& paint
for (RenderObject* child = slowFirstChild(); child; child = child->nextSibling()) {
if (!child->isOutOfFlowPositioned())
- child->invalidateTreeAfterLayout(paintInvalidationContainer);
+ child->invalidateTreeAfterLayout(paintInvalidationState);
}
}
@@ -1732,20 +1732,20 @@ bool RenderObject::checkForPaintInvalidation() const
return !document().view()->needsFullPaintInvalidation() && everHadLayout();
}
-LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth) const
+LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidationState* paintInvalidationState) const
{
- LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContainer));
+ LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationState));
r.inflate(outlineWidth);
return r;
}
-LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject*) const
+LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject*, const PaintInvalidationState*) const
{
ASSERT_NOT_REACHED();
return LayoutRect();
}
-void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed) const
+void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidationState* paintInvalidationState) const
{
if (paintInvalidationContainer == this)
return;
@@ -1764,11 +1764,11 @@ void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
return;
}
- o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, fixed);
+ o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, fixed, paintInvalidationState);
}
}
-void RenderObject::computeFloatRectForPaintInvalidation(const RenderLayerModelObject*, FloatRect&, bool) const
+void RenderObject::computeFloatRectForPaintInvalidation(const RenderLayerModelObject*, FloatRect&, bool, const PaintInvalidationState*) const
{
ASSERT_NOT_REACHED();
}
@@ -2318,7 +2318,7 @@ FloatQuad RenderObject::absoluteToLocalQuad(const FloatQuad& quad, MapCoordinate
return transformState.lastPlanarQuad();
}
-void RenderObject::mapLocalToContainer(const RenderLayerModelObject* paintInvalidationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
+void RenderObject::mapLocalToContainer(const RenderLayerModelObject* paintInvalidationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const
{
if (paintInvalidationContainer == this)
return;
@@ -2340,7 +2340,7 @@ void RenderObject::mapLocalToContainer(const RenderLayerModelObject* paintInvali
if (o->hasOverflowClip())
transformState.move(-toRenderBox(o)->scrolledContentOffset());
- o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, wasFixed);
+ o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, wasFixed, paintInvalidationState);
}
const RenderObject* RenderObject::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
@@ -2411,10 +2411,10 @@ FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, const R
return transformState.lastPlanarQuad();
}
-FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, const RenderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode, bool* wasFixed) const
+FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, const RenderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode, bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const
{
TransformState transformState(TransformState::ApplyTransformDirection, localPoint);
- mapLocalToContainer(paintInvalidationContainer, transformState, mode | ApplyContainerFlip | UseTransforms, wasFixed);
+ mapLocalToContainer(paintInvalidationContainer, transformState, mode | ApplyContainerFlip | UseTransforms, wasFixed, paintInvalidationState);
transformState.flatten();
return transformState.lastPlanarPoint();

Powered by Google App Engine
This is Rietveld 408576698