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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2751383003: Add 'WithoutGeometryChange' variants of paint invalidation flag setters (Closed)
Patch Set: - Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 const LayoutPoint& paintOffset() const { return m_paintOffset; } 1638 const LayoutPoint& paintOffset() const { return m_paintOffset; }
1639 1639
1640 PaintInvalidationReason fullPaintInvalidationReason() const { 1640 PaintInvalidationReason fullPaintInvalidationReason() const {
1641 return m_bitfields.fullPaintInvalidationReason(); 1641 return m_bitfields.fullPaintInvalidationReason();
1642 } 1642 }
1643 bool shouldDoFullPaintInvalidation() const { 1643 bool shouldDoFullPaintInvalidation() const {
1644 return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; 1644 return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone;
1645 } 1645 }
1646 void setShouldDoFullPaintInvalidation( 1646 void setShouldDoFullPaintInvalidation(
1647 PaintInvalidationReason = PaintInvalidationFull); 1647 PaintInvalidationReason = PaintInvalidationFull);
1648 void setShouldDoFullPaintInvalidationWithoutGeometryChange(
1649 PaintInvalidationReason = PaintInvalidationFull);
1648 void clearShouldDoFullPaintInvalidation() { 1650 void clearShouldDoFullPaintInvalidation() {
1649 m_bitfields.setFullPaintInvalidationReason(PaintInvalidationNone); 1651 m_bitfields.setFullPaintInvalidationReason(PaintInvalidationNone);
1650 } 1652 }
1651 1653
1652 void clearPaintInvalidationFlags(); 1654 void clearPaintInvalidationFlags();
1653 1655
1654 bool mayNeedPaintInvalidation() const { 1656 bool mayNeedPaintInvalidation() const {
1655 return m_bitfields.mayNeedPaintInvalidation(); 1657 return m_bitfields.mayNeedPaintInvalidation();
1656 } 1658 }
1657 void setMayNeedPaintInvalidation(); 1659 void setMayNeedPaintInvalidation();
1660 void setMayNeedPaintInvalidationWithoutGeometryChange();
1658 1661
1659 bool mayNeedPaintInvalidationSubtree() const { 1662 bool mayNeedPaintInvalidationSubtree() const {
1660 return m_bitfields.mayNeedPaintInvalidationSubtree(); 1663 return m_bitfields.mayNeedPaintInvalidationSubtree();
1661 } 1664 }
1662 void setMayNeedPaintInvalidationSubtree(); 1665 void setMayNeedPaintInvalidationSubtree();
1663 1666
1667 bool needsPaintOffsetAndVisualRectUpdate() const {
1668 return m_bitfields.needsPaintOffsetAndVisualRectUpdate();
1669 }
1670
1664 bool mayNeedPaintInvalidationAnimatedBackgroundImage() const { 1671 bool mayNeedPaintInvalidationAnimatedBackgroundImage() const {
1665 return m_bitfields.mayNeedPaintInvalidationAnimatedBackgroundImage(); 1672 return m_bitfields.mayNeedPaintInvalidationAnimatedBackgroundImage();
1666 } 1673 }
1667 void setMayNeedPaintInvalidationAnimatedBackgroundImage(); 1674 void setMayNeedPaintInvalidationAnimatedBackgroundImage();
1668 1675
1669 bool shouldInvalidateSelection() const { 1676 bool shouldInvalidateSelection() const {
1670 return m_bitfields.shouldInvalidateSelection(); 1677 return m_bitfields.shouldInvalidateSelection();
1671 } 1678 }
1672 void setShouldInvalidateSelection(); 1679 void setShouldInvalidateSelection();
1673 1680
1674 bool shouldCheckForPaintInvalidationWithPaintInvalidationState( 1681 bool shouldCheckForPaintInvalidationWithPaintInvalidationState(
1675 const PaintInvalidationState&) const; 1682 const PaintInvalidationState&) const;
1676 1683
1677 bool shouldCheckForPaintInvalidation() const { 1684 bool shouldCheckForPaintInvalidation() const {
1678 return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || 1685 return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation();
1679 shouldInvalidateSelection() ||
1680 m_bitfields.childShouldCheckForPaintInvalidation();
1681 } 1686 }
1682 1687
1683 virtual LayoutRect viewRect() const; 1688 virtual LayoutRect viewRect() const;
1684 1689
1685 // New version to replace the above old version. 1690 // New version to replace the above old version.
1686 virtual PaintInvalidationReason invalidatePaintIfNeeded( 1691 virtual PaintInvalidationReason invalidatePaintIfNeeded(
1687 const PaintInvalidatorContext&) const; 1692 const PaintInvalidatorContext&) const;
1688 1693
1689 // When this object is invalidated for paint, this method is called to 1694 // When this object is invalidated for paint, this method is called to
1690 // invalidate any DisplayItemClients owned by this object, including the 1695 // invalidate any DisplayItemClients owned by this object, including the
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 // layerOffset is the offset of this layoutObject within the current layer 2012 // layerOffset is the offset of this layoutObject within the current layer
2008 // that should be used for each result. 2013 // that should be used for each result.
2009 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, 2014 virtual void computeSelfHitTestRects(Vector<LayoutRect>&,
2010 const LayoutPoint& layerOffset) const {} 2015 const LayoutPoint& layerOffset) const {}
2011 2016
2012 void setVisualRect(const LayoutRect& rect) { m_visualRect = rect; } 2017 void setVisualRect(const LayoutRect& rect) { m_visualRect = rect; }
2013 2018
2014 #if DCHECK_IS_ON() 2019 #if DCHECK_IS_ON()
2015 virtual bool paintInvalidationStateIsDirty() const { 2020 virtual bool paintInvalidationStateIsDirty() const {
2016 return backgroundChangedSinceLastPaintInvalidation() || 2021 return backgroundChangedSinceLastPaintInvalidation() ||
2017 shouldCheckForPaintInvalidation(); 2022 shouldCheckForPaintInvalidation() || shouldInvalidateSelection() ||
2023 needsPaintOffsetAndVisualRectUpdate();
2018 } 2024 }
2019 #endif 2025 #endif
2020 2026
2021 // Called before paint invalidation. 2027 // Called before paint invalidation.
2022 virtual void ensureIsReadyForPaintInvalidation() { DCHECK(!needsLayout()); } 2028 virtual void ensureIsReadyForPaintInvalidation() { DCHECK(!needsLayout()); }
2023 2029
2024 // This function walks the descendants of |this|, following a 2030 // This function walks the descendants of |this|, following a
2025 // layout ordering. 2031 // layout ordering.
2026 // 2032 //
2027 // The ordering is important for PaintInvalidationState, as it requires to be 2033 // The ordering is important for PaintInvalidationState, as it requires to be
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 2098
2093 // Walk up the parent chain and find the first scrolling block to disable 2099 // Walk up the parent chain and find the first scrolling block to disable
2094 // scroll anchoring on. 2100 // scroll anchoring on.
2095 void setScrollAnchorDisablingStyleChangedOnAncestor(); 2101 void setScrollAnchorDisablingStyleChangedOnAncestor();
2096 2102
2097 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make 2103 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make
2098 // LayoutBox recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700. 2104 // LayoutBox recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700.
2099 inline void markAncestorsForOverflowRecalcIfNeeded(); 2105 inline void markAncestorsForOverflowRecalcIfNeeded();
2100 2106
2101 inline void markAncestorsForPaintInvalidation(); 2107 inline void markAncestorsForPaintInvalidation();
2108 inline void setNeedsPaintOffsetAndVisualRectUpdate();
2102 2109
2103 inline void invalidateContainerPreferredLogicalWidths(); 2110 inline void invalidateContainerPreferredLogicalWidths();
2104 2111
2105 void invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal( 2112 void invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(
2106 const LayoutBoxModelObject& paintInvalidationContainer); 2113 const LayoutBoxModelObject& paintInvalidationContainer);
2107 2114
2108 LayoutObject* containerForAbsolutePosition(AncestorSkipInfo* = nullptr) const; 2115 LayoutObject* containerForAbsolutePosition(AncestorSkipInfo* = nullptr) const;
2109 2116
2110 const LayoutBoxModelObject* enclosingCompositedContainer() const; 2117 const LayoutBoxModelObject* enclosingCompositedContainer() const;
2111 2118
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 // of the memory constraints on layout objects. 2195 // of the memory constraints on layout objects.
2189 LayoutObjectBitfields(Node* node) 2196 LayoutObjectBitfields(Node* node)
2190 : m_selfNeedsLayout(false), 2197 : m_selfNeedsLayout(false),
2191 m_needsPositionedMovementLayout(false), 2198 m_needsPositionedMovementLayout(false),
2192 m_normalChildNeedsLayout(false), 2199 m_normalChildNeedsLayout(false),
2193 m_posChildNeedsLayout(false), 2200 m_posChildNeedsLayout(false),
2194 m_needsSimplifiedNormalFlowLayout(false), 2201 m_needsSimplifiedNormalFlowLayout(false),
2195 m_selfNeedsOverflowRecalcAfterStyleChange(false), 2202 m_selfNeedsOverflowRecalcAfterStyleChange(false),
2196 m_childNeedsOverflowRecalcAfterStyleChange(false), 2203 m_childNeedsOverflowRecalcAfterStyleChange(false),
2197 m_preferredLogicalWidthsDirty(false), 2204 m_preferredLogicalWidthsDirty(false),
2198 m_childShouldCheckForPaintInvalidation(false),
2199 m_mayNeedPaintInvalidation(false), 2205 m_mayNeedPaintInvalidation(false),
2200 m_mayNeedPaintInvalidationSubtree(false), 2206 m_mayNeedPaintInvalidationSubtree(false),
2201 m_mayNeedPaintInvalidationAnimatedBackgroundImage(false), 2207 m_mayNeedPaintInvalidationAnimatedBackgroundImage(false),
2208 m_needsPaintOffsetAndVisualRectUpdate(false),
2202 m_shouldInvalidateSelection(false), 2209 m_shouldInvalidateSelection(false),
2203 m_floating(false), 2210 m_floating(false),
2204 m_isAnonymous(!node), 2211 m_isAnonymous(!node),
2205 m_isText(false), 2212 m_isText(false),
2206 m_isBox(false), 2213 m_isBox(false),
2207 m_isInline(true), 2214 m_isInline(true),
2208 m_isAtomicInlineLevel(false), 2215 m_isAtomicInlineLevel(false),
2209 m_horizontalWritingMode(true), 2216 m_horizontalWritingMode(true),
2210 m_hasLayer(false), 2217 m_hasLayer(false),
2211 m_hasOverflowClip(false), 2218 m_hasOverflowClip(false),
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, 2297 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange,
2291 ChildNeedsOverflowRecalcAfterStyleChange); 2298 ChildNeedsOverflowRecalcAfterStyleChange);
2292 2299
2293 // This boolean marks preferred logical widths for lazy recomputation. 2300 // This boolean marks preferred logical widths for lazy recomputation.
2294 // 2301 //
2295 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above about those 2302 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above about those
2296 // widths. 2303 // widths.
2297 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, 2304 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty,
2298 PreferredLogicalWidthsDirty); 2305 PreferredLogicalWidthsDirty);
2299 2306
2300 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation,
2301 ChildShouldCheckForPaintInvalidation);
2302 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation); 2307 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
2303 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, 2308 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree,
2304 MayNeedPaintInvalidationSubtree); 2309 MayNeedPaintInvalidationSubtree);
2305 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationAnimatedBackgroundImage, 2310 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationAnimatedBackgroundImage,
2306 MayNeedPaintInvalidationAnimatedBackgroundImage); 2311 MayNeedPaintInvalidationAnimatedBackgroundImage);
2312 ADD_BOOLEAN_BITFIELD(needsPaintOffsetAndVisualRectUpdate,
2313 NeedsPaintOffsetAndVisualRectUpdate);
2307 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection); 2314 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection);
2308 2315
2309 // This boolean is the cached value of 'float' 2316 // This boolean is the cached value of 'float'
2310 // (see ComputedStyle::isFloating). 2317 // (see ComputedStyle::isFloating).
2311 ADD_BOOLEAN_BITFIELD(floating, Floating); 2318 ADD_BOOLEAN_BITFIELD(floating, Floating);
2312 2319
2313 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); 2320 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous);
2314 ADD_BOOLEAN_BITFIELD(isText, IsText); 2321 ADD_BOOLEAN_BITFIELD(isText, IsText);
2315 ADD_BOOLEAN_BITFIELD(isBox, IsBox); 2322 ADD_BOOLEAN_BITFIELD(isBox, IsBox);
2316 2323
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2775 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2782 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2776 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2783 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2777 // We don't make object2 an optional parameter so that showLayoutTree 2784 // We don't make object2 an optional parameter so that showLayoutTree
2778 // can be called from gdb easily. 2785 // can be called from gdb easily.
2779 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2786 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2780 const blink::LayoutObject* object2); 2787 const blink::LayoutObject* object2);
2781 2788
2782 #endif 2789 #endif
2783 2790
2784 #endif // LayoutObject_h 2791 #endif // LayoutObject_h
OLDNEW
« 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