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

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

Issue 1302993003: Cleanup bitfield accessors for slimming paint v2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clear ChildShouldCheckForPaintInvalidation 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
« Source/core/layout/LayoutObject.h ('K') | « Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index adccc386674f10835f452bac266ec018d934a3f3..87252ba212edd3f5e6cbbcee26b05c202460b985 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -675,7 +675,7 @@ LayoutFlowThread* LayoutObject::locateFlowThreadContainingBlock() const
bool LayoutObject::skipInvalidationWhenLaidOutChildren() const
{
- if (!neededLayoutBecauseOfChildren())
+ if (!m_bitfields.neededLayoutBecauseOfChildren())
return false;
// SVG layoutObjects need to be invalidated when their children are laid out.
@@ -756,18 +756,18 @@ void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, SubtreeLay
return;
if (willSkipRelativelyPositionedInlines)
container = object->container();
- object->setPosChildNeedsLayout(true);
+ object->m_bitfields.setPosChildNeedsLayout(true);
simplifiedNormalFlowLayout = true;
ASSERT(!object->isSetNeedsLayoutForbidden());
} else if (simplifiedNormalFlowLayout) {
if (object->needsSimplifiedNormalFlowLayout())
return;
- object->setNeedsSimplifiedNormalFlowLayout(true);
+ object->m_bitfields.setNeedsSimplifiedNormalFlowLayout(true);
ASSERT(!object->isSetNeedsLayoutForbidden());
} else {
if (object->normalChildNeedsLayout())
return;
- object->setNormalChildNeedsLayout(true);
+ object->m_bitfields.setNormalChildNeedsLayout(true);
ASSERT(!object->isSetNeedsLayoutForbidden());
}
@@ -1348,6 +1348,7 @@ void LayoutObject::setPreviousSelectionRectForPaintInvalidation(const LayoutRect
selectionPaintInvalidationMap->set(this, selectionRect);
}
+// TODO: Remove this for slimming paint v2 because we don't care about paint invalidation rects.
inline void LayoutObject::invalidateSelectionIfNeeded(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason invalidationReason)
{
// Update selection rect when we are doing full invalidation (in case that the object is moved, composite status changed, etc.)
@@ -1828,13 +1829,13 @@ void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const
void LayoutObject::markContainingBlocksForOverflowRecalc()
{
for (LayoutBlock* container = containingBlock(); container && !container->childNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock())
- container->setChildNeedsOverflowRecalcAfterStyleChange(true);
+ container->m_bitfields.setChildNeedsOverflowRecalcAfterStyleChange(true);
}
void LayoutObject::setNeedsOverflowRecalcAfterStyleChange()
{
bool neededRecalc = needsOverflowRecalcAfterStyleChange();
- setSelfNeedsOverflowRecalcAfterStyleChange(true);
+ m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(true);
if (!neededRecalc)
markContainingBlocksForOverflowRecalc();
}
@@ -2668,7 +2669,7 @@ PositionWithAffinity LayoutObject::positionForPoint(const LayoutPoint&)
void LayoutObject::updateDragState(bool dragOn)
{
bool valueChanged = (dragOn != isDragging());
- setIsDragging(dragOn);
+ m_bitfields.setIsDragging(dragOn);
if (valueChanged && node()) {
if (node()->isElementNode() && toElement(node())->childrenOrSiblingsAffectedByDrag())
node()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Drag));
@@ -2753,7 +2754,7 @@ void LayoutObject::scheduleRelayout()
void LayoutObject::forceLayout()
{
- setSelfNeedsLayout(true);
+ m_bitfields.setSelfNeedsLayout(true);
setShouldDoFullPaintInvalidation();
layout();
}
@@ -2762,7 +2763,7 @@ void LayoutObject::forceLayout()
// the containing block chain. If not, we should change all callers to use forceLayout.
void LayoutObject::forceChildLayout()
{
- setNormalChildNeedsLayout(true);
+ m_bitfields.setNormalChildNeedsLayout(true);
layout();
}
@@ -3200,16 +3201,7 @@ static PaintInvalidationReason documentLifecycleBasedPaintInvalidationReason(con
inline void LayoutObject::markContainerChainForPaintInvalidation()
{
for (LayoutObject* container = this->containerCrossingFrameBoundaries(); container && !container->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); container = container->containerCrossingFrameBoundaries())
- container->setSelfMayNeedPaintInvalidation();
-}
-
-void LayoutObject::setLayoutDidGetCalledSinceLastFrame()
-{
- m_bitfields.setLayoutDidGetCalledSinceLastFrame(true);
-
- // Make sure our parent is marked as needing invalidation.
- // This would be unneeded if we allowed sub-tree invalidation (akin to sub-tree layouts).
- markContainerChainForPaintInvalidation();
+ container->m_bitfields.setChildShouldCheckForPaintInvalidation(true);
}
void LayoutObject::setShouldInvalidateSelection()
@@ -3246,32 +3238,21 @@ void LayoutObject::setMayNeedPaintInvalidation()
if (mayNeedPaintInvalidation())
return;
m_bitfields.setMayNeedPaintInvalidation(true);
- // Make sure our parent is marked as needing invalidation.
markContainerChainForPaintInvalidation();
frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting().
}
-void LayoutObject::clearMayNeedPaintInvalidation()
-{
- m_bitfields.setMayNeedPaintInvalidation(false);
-}
-
-void LayoutObject::setSelfMayNeedPaintInvalidation()
-{
- m_bitfields.setMayNeedPaintInvalidation(true);
-}
-
void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& paintInvalidationState)
{
// paintInvalidationStateIsDirty should be kept in sync with the
// booleans that are cleared below.
ASSERT(paintInvalidationState.ancestorHadPaintInvalidationForLocationChange() || paintInvalidationStateIsDirty());
clearShouldDoFullPaintInvalidation();
- setNeededLayoutBecauseOfChildren(false);
- setShouldInvalidateOverflowForPaint(false);
- clearLayoutDidGetCalledSinceLastFrame();
- clearMayNeedPaintInvalidation();
- clearShouldInvalidateSelection();
+ m_bitfields.setChildShouldCheckForPaintInvalidation(false);
+ m_bitfields.setNeededLayoutBecauseOfChildren(false);
+ m_bitfields.setShouldInvalidateOverflowForPaint(false);
+ m_bitfields.setMayNeedPaintInvalidation(false);
+ m_bitfields.setShouldInvalidateSelection(false);
}
bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document)
« Source/core/layout/LayoutObject.h ('K') | « Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698