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

Side by Side Diff: Source/core/rendering/RenderObject.h

Issue 393673003: Revert "Enforce clearing renderers' paint invalidation state" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 showRenderTreeForThis(); 239 showRenderTreeForThis();
240 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); 240 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout());
241 } 241 }
242 242
243 void assertSubtreeIsLaidOut() const 243 void assertSubtreeIsLaidOut() const
244 { 244 {
245 for (const RenderObject* renderer = this; renderer; renderer = renderer- >nextInPreOrder()) 245 for (const RenderObject* renderer = this; renderer; renderer = renderer- >nextInPreOrder())
246 renderer->assertRendererLaidOut(); 246 renderer->assertRendererLaidOut();
247 } 247 }
248 248
249 void assertRendererClearedPaintInvalidationState() const
250 {
251 if (paintInvalidationStateIsDirty()) {
252 showRenderTreeForThis();
253 ASSERT_NOT_REACHED();
254 }
255 }
256
257 void assertSubtreeClearedPaintInvalidationState() const
258 {
259 for (const RenderObject* renderer = this; renderer; renderer = renderer- >nextInPreOrder()) {
260 renderer->assertRendererClearedPaintInvalidationState();
261
262 // Currently we skip some SVG containers for performance (see Render SVGModelObject::invalidateTreeAfterLayout)
263 // so we just skip the underlying subtree. This is not strictly the condition in the previous function but
264 // it makes little sense to cover SVG subtrees if we know they are s kipped anyway.
265 if (renderer->isSVGContainer())
266 return;
267 }
268 }
269
270 #endif 249 #endif
271 250
272 bool skipInvalidationWhenLaidOutChildren() const; 251 bool skipInvalidationWhenLaidOutChildren() const;
273 252
274 // FIXME: This could be used when changing the size of a renderer without ch ildren to skip some invalidations. 253 // FIXME: This could be used when changing the size of a renderer without ch ildren to skip some invalidations.
275 bool rendererHasNoBoxEffect() const 254 bool rendererHasNoBoxEffect() const
276 { 255 {
277 return !style()->hasVisualOverflowingEffect() && !style()->hasBorder() & & !style()->hasBackground(); 256 return !style()->hasVisualOverflowingEffect() && !style()->hasBorder() & & !style()->hasBackground();
278 } 257 }
279 258
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 988
1010 bool isRelayoutBoundaryForInspector() const; 989 bool isRelayoutBoundaryForInspector() const;
1011 990
1012 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } 991 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1013 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; } 992 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; }
1014 993
1015 const LayoutPoint& previousPositionFromPaintInvalidationContainer() const { return m_previousPositionFromPaintInvalidationContainer; } 994 const LayoutPoint& previousPositionFromPaintInvalidationContainer() const { return m_previousPositionFromPaintInvalidationContainer; }
1016 void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& lo cation) { m_previousPositionFromPaintInvalidationContainer = location; } 995 void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& lo cation) { m_previousPositionFromPaintInvalidationContainer = location; }
1017 996
1018 bool shouldDoFullPaintInvalidationAfterLayout() const { return m_bitfields.s houldDoFullPaintInvalidationAfterLayout(); } 997 bool shouldDoFullPaintInvalidationAfterLayout() const { return m_bitfields.s houldDoFullPaintInvalidationAfterLayout(); }
1019 void setShouldDoFullPaintInvalidationAfterLayout(bool b, MarkingBehavior mar kBehavior = MarkContainingBlockChain) 998 void setShouldDoFullPaintInvalidationAfterLayout(bool b) { m_bitfields.setSh ouldDoFullPaintInvalidationAfterLayout(b); }
1020 {
1021 m_bitfields.setShouldDoFullPaintInvalidationAfterLayout(b);
1022
1023 if (markBehavior == MarkContainingBlockChain && b)
1024 markContainingBlockChainForPaintInvalidation();
1025 }
1026
1027 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } 999 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); }
1028 1000
1029 bool shouldDoFullPaintInvalidationIfSelfPaintingLayer() const { return m_bit fields.shouldDoFullPaintInvalidationIfSelfPaintingLayer(); } 1001 bool shouldDoFullPaintInvalidationIfSelfPaintingLayer() const { return m_bit fields.shouldDoFullPaintInvalidationIfSelfPaintingLayer(); }
1030 void setShouldDoFullPaintInvalidationIfSelfPaintingLayer(bool b) { m_bitfiel ds.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b); } 1002 void setShouldDoFullPaintInvalidationIfSelfPaintingLayer(bool b) { m_bitfiel ds.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b); }
1031 1003
1032 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee dedPositionedMovementLayout(); } 1004 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee dedPositionedMovementLayout(); }
1033 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed edPositionedMovementLayout(b); } 1005 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed edPositionedMovementLayout(b); }
1034 1006
1035 void clearPaintInvalidationState(); 1007 void clearPaintInvalidationState();
1036 1008
1037 // layoutDidGetCalled indicates whether this render object was re-laid-out 1009 // layoutDidGetCalled indicates whether this render object was re-laid-out
1038 // since the last call to setLayoutDidGetCalled(false) on this object. 1010 // since the last call to setLayoutDidGetCalled(false) on this object.
1039 bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } 1011 bool layoutDidGetCalled() { return m_bitfields.layoutDidGetCalled(); }
1040 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); } 1012 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); }
1041 1013
1042 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } 1014 bool mayNeedPaintInvalidation() { return m_bitfields.mayNeedPaintInvalidatio n(); }
1043 void setMayNeedPaintInvalidation(bool b) 1015 void setMayNeedPaintInvalidation(bool b)
1044 { 1016 {
1045 m_bitfields.setMayNeedPaintInvalidation(b); 1017 m_bitfields.setMayNeedPaintInvalidation(b);
1046 1018
1047 // Make sure our parent is marked as needing invalidation. 1019 // Make sure our parent is marked as needing invalidation.
1048 if (b) 1020 if (b && parent() && !parent()->mayNeedPaintInvalidation())
1049 markContainingBlockChainForPaintInvalidation(); 1021 parent()->setMayNeedPaintInvalidation(b);
1050 } 1022 }
1051 1023
1052 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); } 1024 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); }
1053 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); } 1025 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); }
1054 1026
1055 bool shouldCheckForPaintInvalidationAfterLayout() 1027 bool shouldCheckForPaintInvalidationAfterLayout()
1056 { 1028 {
1057 return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFul lPaintInvalidationAfterLayout(); 1029 return layoutDidGetCalled() || mayNeedPaintInvalidation();
1058 } 1030 }
1059 1031
1060 bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !has Transform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); } 1032 bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !has Transform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); }
1061 1033
1062 void setNeedsOverflowRecalcAfterStyleChange(); 1034 void setNeedsOverflowRecalcAfterStyleChange();
1063 void markContainingBlocksForOverflowRecalc(); 1035 void markContainingBlocksForOverflowRecalc();
1064 1036
1065 protected: 1037 protected:
1066 inline bool layerCreationAllowedForSubtree() const; 1038 inline bool layerCreationAllowedForSubtree() const;
1067 1039
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 1105
1134 RenderStyle* cachedFirstLineStyle() const; 1106 RenderStyle* cachedFirstLineStyle() const;
1135 StyleDifference adjustStyleDifference(StyleDifference) const; 1107 StyleDifference adjustStyleDifference(StyleDifference) const;
1136 1108
1137 Color selectionColor(int colorProperty) const; 1109 Color selectionColor(int colorProperty) const;
1138 1110
1139 void removeShapeImageClient(ShapeValue*); 1111 void removeShapeImageClient(ShapeValue*);
1140 1112
1141 #ifndef NDEBUG 1113 #ifndef NDEBUG
1142 void checkBlockPositionedObjectsNeedLayout(); 1114 void checkBlockPositionedObjectsNeedLayout();
1143
1144 bool paintInvalidationStateIsDirty() const
1145 {
1146 return layoutDidGetCalled() || shouldDoFullPaintInvalidationAfterLayout( ) || shouldDoFullPaintInvalidationIfSelfPaintingLayer()
1147 || onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChil dren() || mayNeedPaintInvalidation();
1148 }
1149 #endif 1115 #endif
1150 const char* invalidationReasonToString(InvalidationReason) const; 1116 const char* invalidationReasonToString(InvalidationReason) const;
1151 1117
1152 void markContainingBlockChainForPaintInvalidation()
1153 {
1154 for (RenderObject* container = this->container(); container && !containe r->shouldCheckForPaintInvalidationAfterLayout(); container = container->containe r())
1155 container->setMayNeedPaintInvalidation(true);
1156 }
1157
1158 static bool isAllowedToModifyRenderTreeStructure(Document&); 1118 static bool isAllowedToModifyRenderTreeStructure(Document&);
1159 1119
1160 RefPtr<RenderStyle> m_style; 1120 RefPtr<RenderStyle> m_style;
1161 1121
1162 Node* m_node; 1122 Node* m_node;
1163 1123
1164 RenderObject* m_parent; 1124 RenderObject* m_parent;
1165 RenderObject* m_previous; 1125 RenderObject* m_previous;
1166 RenderObject* m_next; 1126 RenderObject* m_next;
1167 1127
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 void showTree(const WebCore::RenderObject*); 1492 void showTree(const WebCore::RenderObject*);
1533 void showLineTree(const WebCore::RenderObject*); 1493 void showLineTree(const WebCore::RenderObject*);
1534 void showRenderTree(const WebCore::RenderObject* object1); 1494 void showRenderTree(const WebCore::RenderObject* object1);
1535 // We don't make object2 an optional parameter so that showRenderTree 1495 // We don't make object2 an optional parameter so that showRenderTree
1536 // can be called from gdb easily. 1496 // can be called from gdb easily.
1537 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1497 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1538 1498
1539 #endif 1499 #endif
1540 1500
1541 #endif // RenderObject_h 1501 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698