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

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..215797d439a08306aa53b3e0e77e16d66519e118 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();
- }
Xianzhu 2016/08/03 19:56:36 This is now directly inlined in the new LayoutBox:
-
// 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,11 @@ public:
void invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer);
void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
+ // An object needs to check unforced paint invalidation if it's not set shouldDoFullPaintInvalidation,
chrishtr 2016/08/03 20:33:51 Maybe rewrite as: "unforced paint invalidation is
Xianzhu 2016/08/03 21:30:35 Done.
+ // but is set mayNeedPaintInvalidation or childShouldCheckForPaintInvalidation. The object can
+ // skip unforced paint invalidation if its painting will not be affected by geometry change.
+ 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 +1550,7 @@ protected:
#if ENABLE(ASSERT)
virtual bool paintInvalidationStateIsDirty() const
{
- return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
+ return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
}
#endif
@@ -1748,7 +1743,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 +1776,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 +1827,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 +2044,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