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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.h

Issue 2545683002: Move all descendant-dependent flags into the same tree walk. (Closed)
Patch Set: none Created 4 years 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 IntRect clippedAbsoluteBoundingBox; 677 IntRect clippedAbsoluteBoundingBox;
678 IntRect unclippedAbsoluteBoundingBox; 678 IntRect unclippedAbsoluteBoundingBox;
679 const LayoutObject* clippingContainer; 679 const LayoutObject* clippingContainer;
680 }; 680 };
681 681
682 void setNeedsCompositingInputsUpdate(); 682 void setNeedsCompositingInputsUpdate();
683 bool childNeedsCompositingInputsUpdate() const { 683 bool childNeedsCompositingInputsUpdate() const {
684 return m_childNeedsCompositingInputsUpdate; 684 return m_childNeedsCompositingInputsUpdate;
685 } 685 }
686 bool needsCompositingInputsUpdate() const { 686 bool needsCompositingInputsUpdate() const {
687 // While we're updating the compositing inputs, these values may differ. 687 return m_needsAncestorDependentCompositingInputsUpdate;
688 // We should never be asking for this value when that is the case.
689 DCHECK(m_needsDescendantDependentCompositingInputsUpdate ==
690 m_needsAncestorDependentCompositingInputsUpdate);
691 return m_needsDescendantDependentCompositingInputsUpdate;
692 } 688 }
693 689
694 void updateAncestorOverflowLayer(const PaintLayer* ancestorOverflowLayer) { 690 void updateAncestorOverflowLayer(const PaintLayer* ancestorOverflowLayer) {
695 m_ancestorOverflowLayer = ancestorOverflowLayer; 691 m_ancestorOverflowLayer = ancestorOverflowLayer;
696 } 692 }
697 void updateAncestorDependentCompositingInputs( 693 void updateAncestorDependentCompositingInputs(
698 const AncestorDependentCompositingInputs&, 694 const AncestorDependentCompositingInputs&,
699 bool hasAncestorWithClipPath); 695 bool hasAncestorWithClipPath);
700 void updateDescendantDependentCompositingInputs( 696 void updateDescendantDependentCompositingInputs(
701 bool hasDescendantWithClipPath, 697 bool hasDescendantWithClipPath,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 DCHECK(!m_needsAncestorDependentCompositingInputsUpdate); 754 DCHECK(!m_needsAncestorDependentCompositingInputsUpdate);
759 return m_ancestorDependentCompositingInputs 755 return m_ancestorDependentCompositingInputs
760 ? m_ancestorDependentCompositingInputs->clipParent 756 ? m_ancestorDependentCompositingInputs->clipParent
761 : nullptr; 757 : nullptr;
762 } 758 }
763 bool hasAncestorWithClipPath() const { 759 bool hasAncestorWithClipPath() const {
764 DCHECK(!m_needsAncestorDependentCompositingInputsUpdate); 760 DCHECK(!m_needsAncestorDependentCompositingInputsUpdate);
765 return m_hasAncestorWithClipPath; 761 return m_hasAncestorWithClipPath;
766 } 762 }
767 bool hasDescendantWithClipPath() const { 763 bool hasDescendantWithClipPath() const {
768 DCHECK(!m_needsDescendantDependentCompositingInputsUpdate); 764 DCHECK(!m_needsDescendantDependentFlagsUpdate);
769 return m_hasDescendantWithClipPath; 765 return m_hasDescendantWithClipPath;
770 } 766 }
767
768 // Returns true if there is a descendant with blend-mode that is
769 // not contained within another enclosing stacking context other
770 // than the stacking context blend-mode creates, or the stacking
771 // context this PaintLayer might create. This is needed because
772 // blend-mode content needs to blend with the containing stacking
773 // context's painted output, but not the content in any grandparent
774 // stacking contexts.
771 bool hasNonIsolatedDescendantWithBlendMode() const; 775 bool hasNonIsolatedDescendantWithBlendMode() const;
772 776
773 bool hasRootScrollerAsDescendant() const { 777 bool hasRootScrollerAsDescendant() const {
774 DCHECK(!m_needsDescendantDependentCompositingInputsUpdate); 778 DCHECK(!m_needsDescendantDependentFlagsUpdate);
775 return m_hasRootScrollerAsDescendant; 779 return m_hasRootScrollerAsDescendant;
776 } 780 }
777 781
778 bool lostGroupedMapping() const { 782 bool lostGroupedMapping() const {
779 DCHECK(isAllowedToQueryCompositingState()); 783 DCHECK(isAllowedToQueryCompositingState());
780 return m_lostGroupedMapping; 784 return m_lostGroupedMapping;
781 } 785 }
782 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; } 786 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; }
783 787
784 CompositingReasons getCompositingReasons() const { 788 CompositingReasons getCompositingReasons() const {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 bool has3DTransformedDescendant() const { 973 bool has3DTransformedDescendant() const {
970 DCHECK(!m_is3DTransformedDescendantDirty); 974 DCHECK(!m_is3DTransformedDescendantDirty);
971 return m_has3DTransformedDescendant; 975 return m_has3DTransformedDescendant;
972 } 976 }
973 977
974 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 978 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
975 void endShouldKeepAliveAllClientsRecursive(); 979 void endShouldKeepAliveAllClientsRecursive();
976 #endif 980 #endif
977 981
978 private: 982 private:
983 void setNeedsCompositingInputsUpdateInternal();
984
979 // Bounding box in the coordinates of this layer. 985 // Bounding box in the coordinates of this layer.
980 LayoutRect logicalBoundingBox() const; 986 LayoutRect logicalBoundingBox() const;
981 987
982 bool hasOverflowControls() const; 988 bool hasOverflowControls() const;
983 989
984 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 990 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
985 991
986 void updateLayerPositionRecursive(); 992 void updateLayerPositionRecursive();
987 void updateLayerPositionsAfterScrollRecursive( 993 void updateLayerPositionsAfterScrollRecursive(
988 const DoubleSize& scrollDelta, 994 const DoubleSize& scrollDelta,
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 #endif 1143 #endif
1138 1144
1139 unsigned m_is3DTransformedDescendantDirty : 1; 1145 unsigned m_is3DTransformedDescendantDirty : 1;
1140 // Set on a stacking context layer that has 3D descendants anywhere 1146 // Set on a stacking context layer that has 3D descendants anywhere
1141 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. 1147 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing.
1142 unsigned m_has3DTransformedDescendant : 1; 1148 unsigned m_has3DTransformedDescendant : 1;
1143 1149
1144 unsigned m_containsDirtyOverlayScrollbars : 1; 1150 unsigned m_containsDirtyOverlayScrollbars : 1;
1145 1151
1146 unsigned m_needsAncestorDependentCompositingInputsUpdate : 1; 1152 unsigned m_needsAncestorDependentCompositingInputsUpdate : 1;
1147 unsigned m_needsDescendantDependentCompositingInputsUpdate : 1;
1148 unsigned m_childNeedsCompositingInputsUpdate : 1; 1153 unsigned m_childNeedsCompositingInputsUpdate : 1;
1149 1154
1150 // Used only while determining what layers should be composited. Applies to 1155 // Used only while determining what layers should be composited. Applies to
1151 // the tree of z-order lists. 1156 // the tree of z-order lists.
1152 unsigned m_hasCompositingDescendant : 1; 1157 unsigned m_hasCompositingDescendant : 1;
1153 1158
1154 // True iff we have scrollable overflow and all children of m_layoutObject are 1159 // True iff we have scrollable overflow and all children of m_layoutObject are
1155 // known to paint exclusively into their own composited layers. Set by 1160 // known to paint exclusively into their own composited layers. Set by
1156 // updateScrollingStateAfterCompositingChange(). 1161 // updateScrollingStateAfterCompositingChange().
1157 unsigned m_isAllScrollingContentComposited : 1; 1162 unsigned m_isAllScrollingContentComposited : 1;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 1231
1227 } // namespace blink 1232 } // namespace blink
1228 1233
1229 #ifndef NDEBUG 1234 #ifndef NDEBUG
1230 // Outside the WebCore namespace for ease of invocation from gdb. 1235 // Outside the WebCore namespace for ease of invocation from gdb.
1231 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); 1236 CORE_EXPORT void showLayerTree(const blink::PaintLayer*);
1232 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); 1237 CORE_EXPORT void showLayerTree(const blink::LayoutObject*);
1233 #endif 1238 #endif
1234 1239
1235 #endif // Layer_h 1240 #endif // Layer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698