Show
Ignore:
Timestamp:
03/30/07 02:59:57 (22 months ago)
Author:
antti
Message:

Reviewed by Hyatt.

Render tree memory savings, part 1


  • Eliminate caching of monospace char width from RenderText. This optimization is not needed anymore since Font already caches space width (RenderText -4 bytes)
  • Eliminate caching of tab width from RenderBlock. Similary this optimization has become obsolete (RenderBlock -4 bytes)
  • platform/Font.cpp: (WebCore::WidthIterator::advance): (WebCore::Font::spaceWidth):
  • platform/Font.h: (WebCore::Font::tabWidth):
  • platform/TextStyle.h: (WebCore::TextStyle::TextStyle): (WebCore::TextStyle::allowTabs):
  • rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::selectionRect): (WebCore::InlineTextBox::paint): (WebCore::InlineTextBox::paintSelection): (WebCore::InlineTextBox::paintMarkedTextBackground): (WebCore::InlineTextBox::paintSpellingOrGrammarMarker): (WebCore::InlineTextBox::paintTextMatchMarker): (WebCore::InlineTextBox::offsetForPosition): (WebCore::InlineTextBox::positionForOffset):
  • rendering/RenderBlock.cpp: (WebCore:::RenderFlow): (WebCore::RenderBlock::setStyle):
  • rendering/RenderBlock.h:
  • rendering/RenderObject.cpp:
  • rendering/RenderObject.h:
  • rendering/RenderText.cpp: (WebCore::RenderText::RenderText): (WebCore::RenderText::setStyle): (WebCore::RenderText::widthFromCache): (WebCore::RenderText::trimmedMinMaxWidth): (WebCore::RenderText::calcMinMaxWidthInternal): (WebCore::RenderText::setTextInternal): (WebCore::RenderText::width):
  • rendering/RenderText.h: (WebCore::RenderText::allowTabs):
  • rendering/bidi.cpp:
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/rendering/RenderText.h

    r19997 r20610  
    126126    InlineTextBox* findNextInlineTextBox(int offset, int& pos) const; 
    127127 
     128    int allowTabs() const { return !style()->collapseWhiteSpace(); } 
     129 
    128130protected: 
    129131    void setTextInternal(PassRefPtr<StringImpl>); 
     
    139141    void calcMinMaxWidthInternal(int leadWidth); 
    140142 
    141     void updateMonospaceCharacterWidth(); 
    142     int widthFromCache(const Font&, int start, int len, int tabWidth, int xPos) const; 
     143    int widthFromCache(const Font&, int start, int len, int xPos) const; 
    143144    bool isAllASCII() const { return m_isAllASCII; } 
    144145 
     
    165166    bool m_containsReversedText : 1; 
    166167    bool m_isAllASCII : 1; 
    167  
    168     int m_monospaceCharacterWidth; 
    169168}; 
    170169