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

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

Issue 2203933002: Replace LayoutObject::skipInvalidationWhenLaidOutChildren() with paintedOutputOfObjectHasNoEffect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 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
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 7a88a69240315972c9088971c8606a36422c663f..b941e1f148d8b376b2a31af394edbd32149f4612 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -354,12 +354,6 @@ public:
#endif
- // Correct version of !layoutObjectHasNoBoxEffectObsolete().
- bool hasBoxEffect() const
- {
- return hasBoxDecorationBackground() || style()->hasVisualOverflowingEffect();
- }
-
// LayoutObject tree manipulation
//////////////////////////////////////////
virtual bool canHaveChildren() const { return virtualChildren(); }
@@ -444,8 +438,6 @@ private:
// or from Parent element.
PassRefPtr<ComputedStyle> getUncachedPseudoStyleFromParentOrShadowHost() const;
- bool skipInvalidationWhenLaidOutChildren() const;
-
public:
#ifndef NDEBUG
void showTreeForThis() const;
@@ -694,8 +686,6 @@ public:
bool boxDecorationBackgroundIsKnownToBeObscured() const;
bool hasBackground() const { return style()->hasBackground(); }
- bool needsLayoutBecauseOfChildren() const { return needsLayout() && !selfNeedsLayout() && !needsPositionedMovementLayout() && !needsSimplifiedNormalFlowLayout(); }
-
bool needsLayout() const
{
return m_bitfields.selfNeedsLayout() || m_bitfields.normalChildNeedsLayout() || m_bitfields.posChildNeedsLayout()
@@ -1131,6 +1121,13 @@ public:
void invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer);
void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
+ // Unforced paint invalidation is when shouldDoFullPaintInvalidation is false, but
+ // mayNeedPaintInvalidation or childShouldCheckForPaintInvalidation is true.
+ // This returns true if the object has unforced paint invalidation bits set, but they
+ // can be skipped because its painting will not be affected by geometry change
+ // (e.g. if it paints nothing for itself).
+ virtual bool canSkipUnforcedPaintInvalidation() const { return false; }
+
// 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;
@@ -1555,7 +1552,7 @@ protected:
#if ENABLE(ASSERT)
virtual bool paintInvalidationStateIsDirty() const
{
- return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
+ return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
}
#endif
@@ -1748,7 +1745,6 @@ private:
, m_mayNeedPaintInvalidation(false)
, m_mayNeedPaintInvalidationSubtree(false)
, m_shouldInvalidateSelection(false)
- , m_neededLayoutBecauseOfChildren(false)
, m_floating(false)
, m_isAnonymous(!node)
, m_isText(false)
@@ -1782,7 +1778,7 @@ private:
{
}
- // 32 bits have been used in the first word, and 17 in the second.
+ // 32 bits have been used in the first word, and 16 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.
@@ -1833,8 +1829,7 @@ private:
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);
// This boolean is the cached value of 'float'
// (see ComputedStyle::isFloating).
@@ -2051,7 +2046,6 @@ inline void LayoutObject::clearNeedsLayout()
// Set flags for later stages/cycles.
setEverHadLayout();
setMayNeedPaintInvalidation();
- m_bitfields.setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren());
// Clear needsLayout flags.
setSelfNeedsLayout(false);

Powered by Google App Engine
This is Rietveld 408576698