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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 1813383002: Move all fast-path paint invalidation mapping into PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorganize conditions in PaintInvalidationState constructor Created 4 years, 9 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: third_party/WebKit/Source/core/layout/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index ba9865117d4388186b5d571d30fdee028a71d129..5f1b8a488cbb11f89a64eb543264d171b6398f61 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -323,7 +323,7 @@ public:
layoutObject->assertLaidOut();
}
- void assertClearedPaintInvalidationState() const
+ void assertClearedPaintInvalidationFlags() const
{
#ifndef NDEBUG
if (paintInvalidationStateIsDirty()) {
@@ -333,10 +333,10 @@ public:
#endif
}
- void assertSubtreeClearedPaintInvalidationState() const
+ void assertSubtreeClearedPaintInvalidationFlags() const
{
for (const LayoutObject* layoutObject = this; layoutObject; layoutObject = layoutObject->nextInPreOrder())
- layoutObject->assertClearedPaintInvalidationState();
+ layoutObject->assertClearedPaintInvalidationFlags();
}
#endif
@@ -996,7 +996,7 @@ public:
// If TraverseDocumentBoundaries is specified, the result will be in the space of the local root frame.
// Otherwise, the result will be in the space of the containing frame.
FloatQuad localToAncestorQuad(const FloatQuad&, const LayoutBoxModelObject* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const;
- FloatPoint localToAncestorPoint(const FloatPoint&, const LayoutBoxModelObject* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr, const PaintInvalidationState* = nullptr) const;
+ FloatPoint localToAncestorPoint(const FloatPoint&, const LayoutBoxModelObject* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const;
void localToAncestorRects(Vector<LayoutRect>&, const LayoutBoxModelObject* ancestor, const LayoutPoint& preOffset, const LayoutPoint& postOffset) const;
// Return the transformation matrix to map points from local to the coordinate system of a container, taking transforms into account.
@@ -1108,17 +1108,6 @@ public:
bool isPaintInvalidationContainer() const;
- LayoutRect computePaintInvalidationRect()
- {
- return computePaintInvalidationRect(containerForPaintInvalidation());
- }
-
- // Returns the paint invalidation rect for this LayoutObject in the coordinate space of the paint backing (typically a GraphicsLayer) for |paintInvalidationContainer|.
- LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState* = nullptr) const;
-
- // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the layoutObject backing of |paintInvalidationContainer|
- LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState* = nullptr) const;
-
// Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space
// of the GraphicsLayer backing of |paintInvalidationContainer|. Note that this coordinaten space is not the same
// as the local coordinate space of |paintInvalidationContainer| in the presence of layer squashing.
@@ -1145,12 +1134,15 @@ public:
// Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's
// coordinate space. This method deals with outlines and overflow.
virtual LayoutRect absoluteClippedOverflowRect() const;
- virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const;
+
+ // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the object's
+ // local coordinate space.
+ virtual LayoutRect localOverflowRectForPaintInvalidation() const;
// Given a rect in the object's coordinate space, compute a rect in the coordinate space of |ancestor|. If
// intermediate containers have clipping or scrolling of any kind, it is applied; but overflow clipping is *not*
// applied for |ancestor| itself. The output rect is suitable for purposes such as paint invalidation.
- virtual void mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect&, const PaintInvalidationState*) const;
+ virtual void mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect&) const;
// Return the offset to the column in which the specified point (in flow-thread coordinates)
// lives. This is used to convert a flow-thread point to a visual point.
@@ -1173,8 +1165,8 @@ public:
bool canUpdateSelectionOnRootLineBoxes() const;
// A single rectangle that encompasses all of the selected objects within this object. Used to determine the tightest
- // possible bounding box for the selection. The rect returned is in the coordinate space of the paint invalidation container's backing.
- virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObject* /* paintInvalidationContainer */) const { return LayoutRect(); }
+ // possible bounding box for the selection. The rect returned is in the object's local coordinate space.
+ virtual LayoutRect localSelectionRect() const { return LayoutRect(); }
// View coordinates means the coordinate space of |view()|.
LayoutRect selectionRectInViewCoordinates() const;
@@ -1250,7 +1242,7 @@ public:
// Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use
// localToAbsolute/absoluteToLocal methods instead.
- virtual void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const PaintInvalidationState* = nullptr) const;
+ virtual void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr) const;
// If the LayoutBoxModelObject ancestor is non-null, the input quad is in the space of the ancestor.
// Otherwise:
// If TraverseDocumentBoundaries is specified, the input quad is in the space of the local root frame.
@@ -1367,8 +1359,6 @@ public:
return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation();
}
- virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !hasTransformRelatedProperty() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); }
-
virtual LayoutRect viewRect() const;
void invalidateDisplayItemClient(const DisplayItemClient&) const;

Powered by Google App Engine
This is Rietveld 408576698