Changeset 156639 in webkit
- Timestamp:
- Sep 30, 2013, 1:21:34 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r156638 r156639 1 2013-09-30 Antti Koivisto <antti@apple.com> 2 3 Get rid of static map for marking ancestor line boxes dirty 4 https://bugs.webkit.org/show_bug.cgi?id=122080 5 6 Reviewed by Andreas Kling. 7 8 This is ugly and shows up in profiles too. Use a bit in RenderElement instead. 9 10 * rendering/RenderBlock.h: 11 * rendering/RenderBlockFlow.h: 12 13 Move dirtyLinesFromChangedChild down to RenderBlockFlow. It wouldn't do anything on other RenderBlocks. 14 15 * rendering/RenderElement.cpp: 16 (WebCore::RenderElement::RenderElement): 17 * rendering/RenderElement.h: 18 19 Add m_ancestorLineBoxDirty bit. We have 32 unused bits here on 64bit systems. 20 21 (WebCore::RenderElement::dirtyLinesFromChangedChild): 22 (WebCore::RenderElement::ancestorLineBoxDirty): 23 (WebCore::RenderElement::setAncestorLineBoxDirty): 24 (WebCore::RenderObject::setNeedsLayout): 25 * rendering/RenderInline.h: 26 * rendering/RenderLineBoxList.cpp: 27 (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): 28 29 Tighten the interface. 30 31 * rendering/RenderLineBoxList.h: 32 * rendering/RenderObject.cpp: 33 (WebCore::RenderObject::willBeDestroyed): 34 * rendering/RenderObject.h: 35 36 Remove the static map. 37 1 38 2013-09-18 Sergio Villar Senin <svillar@igalia.com> 2 39 -
trunk/Source/WebCore/rendering/RenderBlock.h
r156613 r156639 562 562 void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveInsert); 563 563 564 virtual void dirtyLinesFromChangedChild(RenderObject* child) OVERRIDE FINAL { m_lineBoxes.dirtyLinesFromChangedChild(this, child); }565 566 564 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild); 567 565 void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild); -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r156557 r156639 55 55 virtual LayoutUnit collapsedMarginAfter() const OVERRIDE FINAL { return maxPositiveMarginAfter() - maxNegativeMarginAfter(); } 56 56 57 virtual void dirtyLinesFromChangedChild(RenderObject* child) OVERRIDE FINAL { lineBoxes().dirtyLinesFromChangedChild(this, child); } 58 57 59 public: 58 60 class MarginValues { -
trunk/Source/WebCore/rendering/RenderElement.cpp
r156622 r156639 67 67 RenderElement::RenderElement(Element* element) 68 68 : RenderObject(element) 69 , m_ancestorLineBoxDirty(false) 69 70 , m_firstChild(nullptr) 70 71 , m_lastChild(nullptr) -
trunk/Source/WebCore/rendering/RenderElement.h
r156622 r156639 70 70 virtual RenderElement* hoverAncestor() const; 71 71 72 virtual void dirtyLinesFromChangedChild(RenderObject*) { } 73 74 bool ancestorLineBoxDirty() const { return m_ancestorLineBoxDirty; } 75 void setAncestorLineBoxDirty(bool f = true); 76 72 77 // Return the renderer whose background style is used to paint the root background. Should only be called on the renderer for which isRoot() is true. 73 78 RenderElement* rendererForRootBackground(); … … 125 130 RenderStyle* cachedFirstLineStyle() const; 126 131 132 bool m_ancestorLineBoxDirty : 1; 133 127 134 RenderObject* m_firstChild; 128 135 RenderObject* m_lastChild; … … 141 148 } 142 149 150 inline void RenderElement::setAncestorLineBoxDirty(bool f) 151 { 152 m_ancestorLineBoxDirty = f; 153 if (m_ancestorLineBoxDirty) 154 setNeedsLayout(true); 155 } 156 143 157 inline LayoutUnit RenderElement::valueForLength(const Length& length, LayoutUnit maximumValue, bool roundPercentages) const 144 158 { … … 193 207 } 194 208 209 inline void RenderObject::setNeedsLayout(bool needsLayout, MarkingBehavior markParents) 210 { 211 bool alreadyNeededLayout = m_bitfields.needsLayout(); 212 m_bitfields.setNeedsLayout(needsLayout); 213 if (needsLayout) { 214 ASSERT(!isSetNeedsLayoutForbidden()); 215 if (!alreadyNeededLayout) { 216 if (markParents == MarkContainingBlockChain) 217 markContainingBlocksForLayout(); 218 if (hasLayer()) 219 setLayerNeedsFullRepaint(); 220 } 221 } else { 222 setEverHadLayout(true); 223 setPosChildNeedsLayout(false); 224 setNeedsSimplifiedNormalFlowLayout(false); 225 setNormalChildNeedsLayout(false); 226 setNeedsPositionedMovementLayout(false); 227 if (isRenderElement()) 228 toRenderElement(this)->setAncestorLineBoxDirty(false); 229 #ifndef NDEBUG 230 checkBlockPositionedObjectsNeedLayout(); 231 #endif 232 } 233 } 234 195 235 inline RenderElement* ContainerNode::renderer() const 196 236 { -
trunk/Source/WebCore/rendering/RenderLineBoxList.cpp
r156054 r156639 34 34 #include "PaintInfo.h" 35 35 #include "RenderArena.h" 36 #include "RenderBlockFlow.h" 36 37 #include "RenderInline.h" 37 38 #include "RenderLineBreak.h" … … 311 312 } 312 313 313 void RenderLineBoxList::dirtyLinesFromChangedChild(RenderObject* container, RenderObject* child) 314 { 315 if (!container->parent() || (container->isRenderBlock() && (container->selfNeedsLayout() || !container->isRenderBlockFlow()))) 314 void RenderLineBoxList::dirtyLinesFromChangedChild(RenderBoxModelObject* container, RenderObject* child) 315 { 316 ASSERT(container->isRenderInline() || container->isRenderBlockFlow()); 317 if (!container->parent() || (container->isRenderBlockFlow() && container->selfNeedsLayout())) 316 318 return; 317 319 -
trunk/Source/WebCore/rendering/RenderLineBoxList.h
r155944 r156639 36 36 37 37 class InlineFlowBox; 38 class RenderBlockFlow; 38 39 39 40 class RenderLineBoxList { … … 64 65 65 66 void dirtyLineBoxes(); 66 void dirtyLinesFromChangedChild(Render Object* parent, RenderObject* child);67 void dirtyLinesFromChangedChild(RenderBoxModelObject* parent, RenderObject* child); 67 68 68 69 void paint(RenderBoxModelObject*, PaintInfo&, const LayoutPoint&) const; -
trunk/Source/WebCore/rendering/RenderObject.cpp
r156622 r156639 102 102 103 103 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObject_should_stay_small); 104 105 RenderObjectAncestorLineboxDirtySet* RenderObject::s_ancestorLineboxDirtySet = 0;106 104 107 105 void* RenderObject::operator new(size_t sz, RenderArena& renderArena) … … 1499 1497 } 1500 1498 1501 void RenderObject::dirtyLinesFromChangedChild(RenderObject*)1502 {1503 }1504 1505 1499 #ifndef NDEBUG 1506 1500 … … 2026 2020 toRenderLayerModelObject(this)->destroyLayer(); 2027 2021 } 2028 2029 setAncestorLineBoxDirty(false);2030 2022 2031 2023 clearLayoutRootIfNeeded(); -
trunk/Source/WebCore/rendering/RenderObject.h
r156622 r156639 137 137 #endif 138 138 139 typedef WTF::HashSet<const RenderObject*> RenderObjectAncestorLineboxDirtySet;140 141 139 #ifndef NDEBUG 142 140 const int showTreeCharacterOffset = 39; … … 404 402 bool hasColumns() const { return m_bitfields.hasColumns(); } 405 403 void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } 406 407 bool ancestorLineBoxDirty() const { return s_ancestorLineboxDirtySet && s_ancestorLineboxDirtySet->contains(this); }408 void setAncestorLineBoxDirty(bool b = true)409 {410 if (b) {411 if (!s_ancestorLineboxDirtySet)412 s_ancestorLineboxDirtySet = new RenderObjectAncestorLineboxDirtySet;413 s_ancestorLineboxDirtySet->add(this);414 setNeedsLayout(true);415 } else if (s_ancestorLineboxDirtySet) {416 s_ancestorLineboxDirtySet->remove(this);417 if (s_ancestorLineboxDirtySet->isEmpty()) {418 delete s_ancestorLineboxDirtySet;419 s_ancestorLineboxDirtySet = 0;420 }421 }422 }423 404 424 405 enum FlowThreadState { … … 703 684 VisiblePosition createVisiblePosition(const Position&); 704 685 705 virtual void dirtyLinesFromChangedChild(RenderObject*);706 707 686 // returns the containing block level element for this element. 708 687 RenderBlock* containingBlock() const; … … 982 961 RenderObject* m_previous; 983 962 RenderObject* m_next; 984 985 static RenderObjectAncestorLineboxDirtySet* s_ancestorLineboxDirtySet;986 963 987 964 #ifndef NDEBUG … … 1138 1115 } 1139 1116 1140 inline void RenderObject::setNeedsLayout(bool needsLayout, MarkingBehavior markParents)1141 {1142 bool alreadyNeededLayout = m_bitfields.needsLayout();1143 m_bitfields.setNeedsLayout(needsLayout);1144 if (needsLayout) {1145 ASSERT(!isSetNeedsLayoutForbidden());1146 if (!alreadyNeededLayout) {1147 if (markParents == MarkContainingBlockChain)1148 markContainingBlocksForLayout();1149 if (hasLayer())1150 setLayerNeedsFullRepaint();1151 }1152 } else {1153 setEverHadLayout(true);1154 setPosChildNeedsLayout(false);1155 setNeedsSimplifiedNormalFlowLayout(false);1156 setNormalChildNeedsLayout(false);1157 setNeedsPositionedMovementLayout(false);1158 setAncestorLineBoxDirty(false);1159 #ifndef NDEBUG1160 checkBlockPositionedObjectsNeedLayout();1161 #endif1162 }1163 }1164 1165 1117 inline void RenderObject::setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior markParents) 1166 1118 {
Note:
See TracChangeset
for help on using the changeset viewer.