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

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

Issue 2060053002: Set paintingLayerNeedsRepaint() in layout tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set paintingLayerNeedsRepaint() in layout tree Created 4 years, 6 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 f417cda7e924dfa9a6c8d8b82ffda4a83e200ad5..41a2807ddbc189c152358986fc7c44e981ecc024 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -338,7 +338,7 @@ public:
void assertClearedPaintInvalidationFlags() const
{
#ifndef NDEBUG
- if (paintInvalidationStateIsDirty()) {
+ if (paintInvalidationFlagsAreDirty()) {
showLayoutTreeForThis();
ASSERT_NOT_REACHED();
}
@@ -1127,8 +1127,7 @@ public:
void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalidationContainer, const LayoutRect&, PaintInvalidationReason) const;
// Invalidate the paint of a specific subrectangle within a given object. The rect is in the object's coordinate space.
- void invalidatePaintRectangle(const LayoutRect&) const;
- void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutRect&) const;
+ void invalidatePaintRectangle(const LayoutRect&);
// Walk the tree after layout issuing paint invalidations for layoutObjects that have changed or moved, updating bounds that have changed, and clearing paint invalidation state.
virtual void invalidateTreeIfNeeded(const PaintInvalidationState&);
@@ -1371,13 +1370,25 @@ public:
bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() const
{
- return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation();
+ return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation() || paintingLayerNeedsRepaint();
}
+ // Set flag on this object indicating that its painting layer will need repaint during the next paint.
+ // The painting layer will be set needs repaint after paint invalidation of this object.
+ void setPaintingLayerNeedsRepaint();
+ bool paintingLayerNeedsRepaint() const { return m_bitfields.paintingLayerNeedsRepaint(); }
+
virtual LayoutRect viewRect() const;
- void invalidateDisplayItemClient(const DisplayItemClient&) const;
- void invalidateDisplayItemClientsIncludingNonCompositingDescendants(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReason) const;
+ void invalidateDisplayItemClient(const DisplayItemClient&);
+
+ // When this object is invalidated for paint, this method is called to invalidate any DisplayItemClients
+ // owned by this object, including the object itself, LayoutText/LayoutInline line boxes, etc.,
+ // not including children which will be invalidated normally during invalidateTreeIfNeeded() and
+ // parts which are invalidated separately (e.g. scrollbars).
+ virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason);
+
+ void invalidateDisplayItemClientsIncludingNonCompositingDescendants(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReason);
// Called before anonymousChild.setStyle(). Override to set custom styles for the child.
virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, ComputedStyle& style) const { }
@@ -1548,7 +1559,7 @@ protected:
virtual bool hasNonCompositedScrollbars() const { return false; }
#if ENABLE(ASSERT)
- virtual bool paintInvalidationStateIsDirty() const
+ virtual bool paintInvalidationFlagsAreDirty() const
{
return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
}
@@ -1570,20 +1581,6 @@ protected:
// by invalidatePaintOfSubtreesIfNeeded.
virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidationState&);
- // When this object is invalidated for paint, this method is called to invalidate any DisplayItemClients
- // owned by this object, including the object itself, LayoutText/LayoutInline line boxes, etc.,
- // not including children which will be invalidated normally during invalidateTreeIfNeeded() and
- // parts which are invalidated separately (e.g. scrollbars).
- // The caller should ensure the painting layer has been setNeedsRepaint before calling this function.
- virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason) const;
-
- // If possible, use the faster paintInvalidationState.paintingLayer().setNeedsRepaint().
- void setPaintingLayerNeedsRepaint() const;
-
- // Sets enclosing layer needsRepaint, then calls invalidateDisplayItemClients().
- // Should use this version when PaintInvalidationState is available.
- void invalidateDisplayItemClientsWithPaintInvalidationState(const LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState&, PaintInvalidationReason) const;
-
void setIsBackgroundAttachmentFixedObject(bool);
void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(false); }
@@ -1634,9 +1631,6 @@ private:
inline void invalidateContainerPreferredLogicalWidths();
- void invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(const LayoutBoxModelObject& paintInvalidationContainer);
-
- // The caller should ensure the painting layer has been setNeedsRepaint before calling this function.
void invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason);
LayoutRect previousSelectionRectForPaintInvalidation() const;
@@ -1664,9 +1658,6 @@ private:
static bool isAllowedToModifyLayoutTreeStructure(Document&);
- // The passed rect is mutated into the coordinate space of the paint invalidation container.
- const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRect&) const;
-
// Returns the parent for paint invalidation.
// - For LayoutView, returns the owner layout object in the containing frame if any or nullptr;
// - For multi-column spanner, returns the spanner placeholder;
@@ -1739,6 +1730,7 @@ private:
, m_mayNeedPaintInvalidationSubtree(false)
, m_shouldInvalidateSelection(false)
, m_neededLayoutBecauseOfChildren(false)
+ , m_paintingLayerNeedsRepaint(false)
, m_floating(false)
, m_isAnonymous(!node)
, m_isText(false)
@@ -1772,7 +1764,7 @@ private:
{
}
- // 32 bits have been used in the first word, and 18 in the second.
+ // 32 bits have been used in the first word, and 19 in the second.
// Self needs layout means that this layout object is marked for a full layout.
// This is the default layout but it is expensive as it recomputes everything.
@@ -1820,12 +1812,15 @@ private:
// widths.
ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidthsDirty);
- ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint); // TODO(wangxianzhu): Remove for slimming paint v2.
+ // The following bitfields are paint invalidation flags which are set before or during paint
+ // invalidation and cleared after paint invalidation.
+ ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint);
ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCheckForPaintInvalidation);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, MayNeedPaintInvalidationSubtree);
- ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection); // TODO(wangxianzhu): Remove for slimming paint v2.
- ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren); // TODO(wangxianzhu): Remove for slimming paint v2.
+ ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection);
+ ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren);
+ ADD_BOOLEAN_BITFIELD(paintingLayerNeedsRepaint, PaintingLayerNeedsRepaint);
// This boolean is the cached value of 'float'
// (see ComputedStyle::isFloating).
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698