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

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

Issue 2211283003: Revert of Replace LayoutObject::skipInvalidationWhenLaidOutChildren() with painted... (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 96447e76aa17aa76d9b23c6f4664b021917551d1..7a88a69240315972c9088971c8606a36422c663f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -354,6 +354,12 @@
#endif
+ // Correct version of !layoutObjectHasNoBoxEffectObsolete().
+ bool hasBoxEffect() const
+ {
+ return hasBoxDecorationBackground() || style()->hasVisualOverflowingEffect();
+ }
+
// LayoutObject tree manipulation
//////////////////////////////////////////
virtual bool canHaveChildren() const { return virtualChildren(); }
@@ -437,6 +443,8 @@
// Gets pseudoStyle from Shadow host(in case of input elements)
// or from Parent element.
PassRefPtr<ComputedStyle> getUncachedPseudoStyleFromParentOrShadowHost() const;
+
+ bool skipInvalidationWhenLaidOutChildren() const;
public:
#ifndef NDEBUG
@@ -686,6 +694,8 @@
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()
@@ -1120,12 +1130,6 @@
void invalidatePaintIncludingNonCompositingDescendants();
void invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer);
void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
-
- // Returns true if the object will not generate any effective painted output.
- // It's used to skip unforced paint invalidation (which is when shouldDoFullPaintInvalidation
- // is false, but mayNeedPaintInvalidation or childShouldCheckForPaintInvalidation is true) to
- // avoid unnecessary paint invalidations of empty areas covered by such objects.
- virtual bool paintedOutputOfObjectHasNoEffect() 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.
@@ -1551,7 +1555,7 @@
#if ENABLE(ASSERT)
virtual bool paintInvalidationStateIsDirty() const
{
- return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
+ return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
}
#endif
@@ -1744,6 +1748,7 @@
, m_mayNeedPaintInvalidation(false)
, m_mayNeedPaintInvalidationSubtree(false)
, m_shouldInvalidateSelection(false)
+ , m_neededLayoutBecauseOfChildren(false)
, m_floating(false)
, m_isAnonymous(!node)
, m_isText(false)
@@ -1777,7 +1782,7 @@
{
}
- // 32 bits have been used in the first word, and 16 in the second.
+ // 32 bits have been used in the first word, and 17 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.
@@ -1828,7 +1833,8 @@
ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCheckForPaintInvalidation);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, MayNeedPaintInvalidationSubtree);
- ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection);
+ ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection); // TODO(wangxianzhu): Remove for slimming paint v2.
+ ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren); // TODO(wangxianzhu): Remove for slimming paint v2.
// This boolean is the cached value of 'float'
// (see ComputedStyle::isFloating).
@@ -2045,6 +2051,7 @@
// Set flags for later stages/cycles.
setEverHadLayout();
setMayNeedPaintInvalidation();
+ m_bitfields.setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren());
// Clear needsLayout flags.
setSelfNeedsLayout(false);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.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