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

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

Issue 1302993003: Cleanup bitfield accessors for slimming paint v2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « no previous file | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.h
diff --git a/Source/core/layout/LayoutObject.h b/Source/core/layout/LayoutObject.h
index c045fc528054a209c40b805334411db8bb5fefc9..06e8d0270fba1af8f836169364b4e2f30ebf0d3b 100644
--- a/Source/core/layout/LayoutObject.h
+++ b/Source/core/layout/LayoutObject.h
@@ -1018,19 +1018,11 @@ public:
virtual void clearPaintInvalidationState(const PaintInvalidationState&);
- // Indicates whether this layout object was re-laid-out since the last frame.
- // The flag will be cleared during invalidateTreeIfNeeded.
- bool layoutDidGetCalledSinceLastFrame() const { return m_bitfields.layoutDidGetCalledSinceLastFrame(); }
-
bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInvalidation(); }
void setMayNeedPaintInvalidation();
bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidateSelection(); }
void setShouldInvalidateSelection();
- void clearShouldInvalidateSelection() { m_bitfields.setShouldInvalidateSelection(false); }
-
- bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayoutBecauseOfChildren(); }
- void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutBecauseOfChildren(b); }
bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInvalidationState) const
{
@@ -1042,7 +1034,7 @@ public:
bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() const
{
- return layoutDidGetCalledSinceLastFrame() || mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection();
+ return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation();
}
virtual bool supportsPaintInvalidationStateCachedOffsets() const { return !hasTransformRelatedProperty() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); }
@@ -1144,8 +1136,6 @@ protected:
virtual void updateAnonymousChildStyle(const LayoutObject& child, ComputedStyle& style) const { }
protected:
- void setSelfMayNeedPaintInvalidation();
-
virtual void willBeDestroyed();
virtual void insertedIntoTree();
@@ -1178,7 +1168,7 @@ protected:
#if ENABLE(ASSERT)
virtual bool paintInvalidationStateIsDirty() const
{
- return neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
+ return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
}
#endif
@@ -1224,11 +1214,6 @@ private:
inline void invalidateContainerPreferredLogicalWidths();
- void clearMayNeedPaintInvalidation();
-
- void setLayoutDidGetCalledSinceLastFrame();
- void clearLayoutDidGetCalledSinceLastFrame() { m_bitfields.setLayoutDidGetCalledSinceLastFrame(false); }
-
void invalidatePaintIncludingNonCompositingDescendantsInternal(const LayoutBoxModelObject& repaintContainer);
LayoutRect previousSelectionRectForPaintInvalidation() const;
@@ -1291,8 +1276,7 @@ private:
LayoutObjectBitfields(Node* node)
: m_selfNeedsLayout(false)
, m_shouldInvalidateOverflowForPaint(false)
- // FIXME: We should remove mayNeedPaintInvalidation once we are able to
- // use the other layout flags to detect the same cases. crbug.com/370118
+ , m_childShouldCheckForPaintInvalidation(false)
, m_mayNeedPaintInvalidation(false)
, m_shouldInvalidateSelection(false)
, m_neededLayoutBecauseOfChildren(false)
@@ -1318,7 +1302,6 @@ private:
, m_hasCounterNodeMap(false)
, m_everHadLayout(false)
, m_ancestorLineBoxDirty(false)
- , m_layoutDidGetCalledSinceLastFrame(false)
, m_hasPendingResourceUpdate(false)
, m_isInsideFlowThread(false)
, m_subtreeChangeListenerRegistered(false)
@@ -1337,10 +1320,11 @@ private:
// 32 bits have been used in the first word, and 16 in the second.
ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
- ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint);
+ ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint); // TODO(wangxianzhu): Remove for slimming paint v2.
+ ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCheckForPaintInvalidation);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
- ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection);
- ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren);
+ 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(needsPositionedMovementLayout, NeedsPositionedMovementLayout);
ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
@@ -1367,8 +1351,6 @@ private:
ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout);
ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty);
- ADD_BOOLEAN_BITFIELD(layoutDidGetCalledSinceLastFrame, LayoutDidGetCalledSinceLastFrame);
-
ADD_BOOLEAN_BITFIELD(hasPendingResourceUpdate, HasPendingResourceUpdate);
ADD_BOOLEAN_BITFIELD(isInsideFlowThread, IsInsideFlowThread);
@@ -1529,15 +1511,19 @@ inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat
inline void LayoutObject::clearNeedsLayout()
{
- setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren());
- setLayoutDidGetCalledSinceLastFrame();
- setSelfNeedsLayout(false);
+ // Set flags for later stages/cycles.
setEverHadLayout(true);
+ setMayNeedPaintInvalidation();
+ m_bitfields.setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren());
+
+ // Clear needsLayout flags.
+ setSelfNeedsLayout(false);
setPosChildNeedsLayout(false);
setNeedsSimplifiedNormalFlowLayout(false);
setNormalChildNeedsLayout(false);
setNeedsPositionedMovementLayout(false);
setAncestorLineBoxDirty(false);
+
#if ENABLE(ASSERT)
checkBlockPositionedObjectsNeedLayout();
#endif
« no previous file with comments | « no previous file | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698