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/RenderElement.h

    r156622 r156639  
    7070    virtual RenderElement* hoverAncestor() const;
    7171
     72    virtual void dirtyLinesFromChangedChild(RenderObject*) { }
     73
     74    bool ancestorLineBoxDirty() const { return m_ancestorLineBoxDirty; }
     75    void setAncestorLineBoxDirty(bool f = true);
     76
    7277    // 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.
    7378    RenderElement* rendererForRootBackground();
     
    125130    RenderStyle* cachedFirstLineStyle() const;
    126131
     132    bool m_ancestorLineBoxDirty : 1;
     133
    127134    RenderObject* m_firstChild;
    128135    RenderObject* m_lastChild;
     
    141148}
    142149
     150inline void RenderElement::setAncestorLineBoxDirty(bool f)
     151{
     152    m_ancestorLineBoxDirty = f;
     153    if (m_ancestorLineBoxDirty)
     154        setNeedsLayout(true);
     155}
     156
    143157inline LayoutUnit RenderElement::valueForLength(const Length& length, LayoutUnit maximumValue, bool roundPercentages) const
    144158{
     
    193207}
    194208
     209inline 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
    195235inline RenderElement* ContainerNode::renderer() const
    196236{
Note: See TracChangeset for help on using the changeset viewer.