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

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

Issue 2543913002: Generalize visible descendant dirty bits to prepare for more properties. (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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 PaintLayerStackingNode* stackingNode() { return m_stackingNode.get(); } 309 PaintLayerStackingNode* stackingNode() { return m_stackingNode.get(); }
310 const PaintLayerStackingNode* stackingNode() const { 310 const PaintLayerStackingNode* stackingNode() const {
311 return m_stackingNode.get(); 311 return m_stackingNode.get();
312 } 312 }
313 313
314 bool subtreeIsInvisible() const { 314 bool subtreeIsInvisible() const {
315 return !hasVisibleContent() && !hasVisibleDescendant(); 315 return !hasVisibleContent() && !hasVisibleDescendant();
316 } 316 }
317 317
318 // FIXME: hasVisibleContent() should call updateDescendantDependentFlags() if
319 // m_isVisibleContentDirty.
320 bool hasVisibleContent() const { 318 bool hasVisibleContent() const {
321 DCHECK(!m_isVisibleContentDirty); 319 DCHECK(!m_isVisibleContentDirty);
322 return m_hasVisibleContent; 320 return m_hasVisibleContent;
323 } 321 }
324 322
325 // FIXME: hasVisibleDescendant() should call updateDescendantDependentFlags()
326 // if m_isVisibleDescendantDirty.
327 bool hasVisibleDescendant() const { 323 bool hasVisibleDescendant() const {
328 DCHECK(!m_isVisibleDescendantDirty); 324 DCHECK(!m_needsDescendantDependentFlagsUpdate);
329 return m_hasVisibleDescendant; 325 return m_hasVisibleDescendant;
330 } 326 }
331 327
332 void dirtyVisibleContentStatus(); 328 void dirtyVisibleContentStatus();
333 void potentiallyDirtyVisibleContentStatus(EVisibility);
334 329
335 bool hasBoxDecorationsOrBackground() const; 330 bool hasBoxDecorationsOrBackground() const;
336 bool hasVisibleBoxDecorations() const; 331 bool hasVisibleBoxDecorations() const;
337 // True if this layer container layoutObjects that paint. 332 // True if this layer container layoutObjects that paint.
338 bool hasNonEmptyChildLayoutObjects() const; 333 bool hasNonEmptyChildLayoutObjects() const;
339 334
340 // Will ensure that isAllScrollingContentComposited() is up to date. 335 // Will ensure that isAllScrollingContentComposited() is up to date.
341 void updateScrollingStateAfterCompositingChange(); 336 void updateScrollingStateAfterCompositingChange();
342 bool isAllScrollingContentComposited() const { 337 bool isAllScrollingContentComposited() const {
343 return m_isAllScrollingContentComposited; 338 return m_isAllScrollingContentComposited;
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 void updateStackingNode(); 1061 void updateStackingNode();
1067 1062
1068 FilterOperations addReflectionToFilterOperations(const ComputedStyle&) const; 1063 FilterOperations addReflectionToFilterOperations(const ComputedStyle&) const;
1069 1064
1070 // FIXME: We could lazily allocate our ScrollableArea based on style 1065 // FIXME: We could lazily allocate our ScrollableArea based on style
1071 // properties ('overflow', ...) but for now, we are always allocating it for 1066 // properties ('overflow', ...) but for now, we are always allocating it for
1072 // LayoutBox as it's safer. crbug.com/467721. 1067 // LayoutBox as it's safer. crbug.com/467721.
1073 bool requiresScrollableArea() const { return layoutBox(); } 1068 bool requiresScrollableArea() const { return layoutBox(); }
1074 void updateScrollableArea(); 1069 void updateScrollableArea();
1075 1070
1076 void dirtyAncestorChainVisibleDescendantStatus(); 1071 void markAncestorChainForDescendantDependentFlagsUpdate();
1077 1072
1078 bool attemptDirectCompositingUpdate(StyleDifference, 1073 bool attemptDirectCompositingUpdate(StyleDifference,
1079 const ComputedStyle* oldStyle); 1074 const ComputedStyle* oldStyle);
1080 void updateTransform(const ComputedStyle* oldStyle, 1075 void updateTransform(const ComputedStyle* oldStyle,
1081 const ComputedStyle& newStyle); 1076 const ComputedStyle& newStyle);
1082 1077
1083 void removeAncestorOverflowLayer(const PaintLayer* removedLayer); 1078 void removeAncestorOverflowLayer(const PaintLayer* removedLayer);
1084 1079
1085 void updatePaginationRecursive(bool needsPaginationUpdate = false); 1080 void updatePaginationRecursive(bool needsPaginationUpdate = false);
1086 void clearPaginationRecursive(); 1081 void clearPaginationRecursive();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 // during painting. This can lead to significant savings, especially if the 1123 // during painting. This can lead to significant savings, especially if the
1129 // tree has lots of non-self-painting layers grouped together (e.g. table 1124 // tree has lots of non-self-painting layers grouped together (e.g. table
1130 // cells). 1125 // cells).
1131 mutable unsigned m_hasSelfPaintingLayerDescendant : 1; 1126 mutable unsigned m_hasSelfPaintingLayerDescendant : 1;
1132 mutable unsigned m_hasSelfPaintingLayerDescendantDirty : 1; 1127 mutable unsigned m_hasSelfPaintingLayerDescendantDirty : 1;
1133 1128
1134 const unsigned m_isRootLayer : 1; 1129 const unsigned m_isRootLayer : 1;
1135 1130
1136 unsigned m_isVisibleContentDirty : 1; 1131 unsigned m_isVisibleContentDirty : 1;
1137 unsigned m_hasVisibleContent : 1; 1132 unsigned m_hasVisibleContent : 1;
1138 unsigned m_isVisibleDescendantDirty : 1; 1133 unsigned m_needsDescendantDependentFlagsUpdate : 1;
Xianzhu 2016/12/01 17:59:32 I'm not sure if the renaming is a good idea. upda
chrishtr 2016/12/01 18:05:22 I could update the patch to try removing m_isVisib
Xianzhu 2016/12/01 18:05:25 Can this be m_childNeedsDecendantDependengFlagsUpd
chrishtr 2016/12/01 18:06:01 Seem my comment in response to your one in PaintLa
Xianzhu 2016/12/01 18:07:03 Removing m_isVisibleContentDirty SGTM.
chrishtr 2016/12/01 23:54:20 Done.
1139 unsigned m_hasVisibleDescendant : 1; 1134 unsigned m_hasVisibleDescendant : 1;
1140 1135
1141 #if DCHECK_IS_ON() 1136 #if DCHECK_IS_ON()
1142 unsigned m_needsPositionUpdate : 1; 1137 unsigned m_needsPositionUpdate : 1;
1143 #endif 1138 #endif
1144 1139
1145 unsigned m_is3DTransformedDescendantDirty : 1; 1140 unsigned m_is3DTransformedDescendantDirty : 1;
1146 // Set on a stacking context layer that has 3D descendants anywhere 1141 // Set on a stacking context layer that has 3D descendants anywhere
1147 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. 1142 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing.
1148 unsigned m_has3DTransformedDescendant : 1; 1143 unsigned m_has3DTransformedDescendant : 1;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 1227
1233 } // namespace blink 1228 } // namespace blink
1234 1229
1235 #ifndef NDEBUG 1230 #ifndef NDEBUG
1236 // Outside the WebCore namespace for ease of invocation from gdb. 1231 // Outside the WebCore namespace for ease of invocation from gdb.
1237 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); 1232 CORE_EXPORT void showLayerTree(const blink::PaintLayer*);
1238 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); 1233 CORE_EXPORT void showLayerTree(const blink::LayoutObject*);
1239 #endif 1234 #endif
1240 1235
1241 #endif // Layer_h 1236 #endif // Layer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698