Ignore:
Timestamp:
Sep 30, 2013, 1:21:34 AM (12 years ago)
Author:
Antti Koivisto
Message:

Get rid of static map for marking ancestor line boxes dirty
https://bugs.webkit.org/show_bug.cgi?id=122080

Reviewed by Andreas Kling.

This is ugly and shows up in profiles too. Use a bit in RenderElement instead.

  • rendering/RenderBlock.h:
  • rendering/RenderBlockFlow.h:


Move dirtyLinesFromChangedChild down to RenderBlockFlow. It wouldn't do anything on other RenderBlocks.

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::RenderElement):

  • rendering/RenderElement.h:


Add m_ancestorLineBoxDirty bit. We have 32 unused bits here on 64bit systems.

(WebCore::RenderElement::dirtyLinesFromChangedChild):
(WebCore::RenderElement::ancestorLineBoxDirty):
(WebCore::RenderElement::setAncestorLineBoxDirty):
(WebCore::RenderObject::setNeedsLayout):

  • rendering/RenderInline.h:
  • rendering/RenderLineBoxList.cpp:

(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):

Tighten the interface.

  • rendering/RenderLineBoxList.h:
  • rendering/RenderObject.cpp:

(WebCore::RenderObject::willBeDestroyed):

  • rendering/RenderObject.h:


Remove the static map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderObject.h

    r156622 r156639  
    137137#endif
    138138
    139 typedef WTF::HashSet<const RenderObject*> RenderObjectAncestorLineboxDirtySet;
    140 
    141139#ifndef NDEBUG
    142140const int showTreeCharacterOffset = 39;
     
    404402    bool hasColumns() const { return m_bitfields.hasColumns(); }
    405403    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     }
    423404
    424405    enum FlowThreadState {
     
    703684    VisiblePosition createVisiblePosition(const Position&);
    704685
    705     virtual void dirtyLinesFromChangedChild(RenderObject*);
    706 
    707686    // returns the containing block level element for this element.
    708687    RenderBlock* containingBlock() const;
     
    982961    RenderObject* m_previous;
    983962    RenderObject* m_next;
    984 
    985     static RenderObjectAncestorLineboxDirtySet* s_ancestorLineboxDirtySet;
    986963
    987964#ifndef NDEBUG
     
    11381115}
    11391116
    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 NDEBUG
    1160         checkBlockPositionedObjectsNeedLayout();
    1161 #endif
    1162     }
    1163 }
    1164 
    11651117inline void RenderObject::setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior markParents)
    11661118{
Note: See TracChangeset for help on using the changeset viewer.