Changeset 150258 in webkit
- Timestamp:
- May 17, 2013 8:11:10 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150255 r150258 1 2013-05-17 Lamarque V. Souza <Lamarque.Souza@basyskom.com> 2 3 Improve -webkit-text-underline-position memory usage. 4 https://bugs.webkit.org/show_bug.cgi?id=116108 5 6 Reviewed by Benjamin Poulain. 7 8 Remove m_maxLogicalTop private variable from RootInlineBox to reduce 9 the overall memory used to render RootInlineBoxes (eight bytes per RootInlineBox 10 instance in a 64-bit machine). RootInline::maxLogicalTop() now computes 11 the maxLogicalTop value everytime it is called. In a typical page 12 computeMaxLogicalTop is called less than 10 times for each 13 InlineTextBox that uses -webkit-text-underline-position. That is a small 14 price users of -webkit-text-underline-position will pay so that 15 everybody can benefit from the memory reduction in RootInlineBox. 16 17 No new tests, no change in behavior. 18 19 * rendering/InlineFlowBox.cpp: 20 (WebCore::InlineFlowBox::computeMaxLogicalTop): Make it const. 21 * rendering/InlineFlowBox.h: 22 * rendering/RootInlineBox.cpp: 23 (WebCore::RootInlineBox::RootInlineBox): Remove m_maxLogicalTop. 24 (WebCore::RootInlineBox::alignBoxesInBlockDirection): Remove 25 computeMaxLogicalTop call and obsolete comment. 26 (WebCore): 27 (WebCore::RootInlineBox::maxLogicalTop): Compute maxLogicalTop before 28 returning its value. 29 * rendering/RootInlineBox.h: 30 (RootInlineBox): 31 1 32 2013-05-17 Alexis Menard <alexis@webkit.org> 2 33 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r149930 r150258 748 748 749 749 #if ENABLE(CSS3_TEXT) 750 void InlineFlowBox::computeMaxLogicalTop(float& maxLogicalTop) 750 void InlineFlowBox::computeMaxLogicalTop(float& maxLogicalTop) const 751 751 { 752 752 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r149967 r150258 311 311 // Maximum logicalTop among all children of an InlineFlowBox. Used to 312 312 // calculate the offset for TextUnderlinePositionUnder. 313 void computeMaxLogicalTop(float& maxLogicalTop) ;313 void computeMaxLogicalTop(float& maxLogicalTop) const; 314 314 #endif // CSS3_TEXT 315 315 private: -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r150214 r150258 55 55 , m_lineTopWithLeading(0) 56 56 , m_lineBottomWithLeading(0) 57 #if ENABLE(CSS3_TEXT)58 , m_maxLogicalTop(0)59 #endif // CSS3_TEXT60 57 { 61 58 setIsHorizontal(block->isHorizontalWritingMode()); … … 284 281 if (isSVGRootInlineBox()) 285 282 return 0; 286 287 // FIXME: figure out how to call computeMaxLogicalTop() when SVG is enabled.288 283 #endif 289 284 … … 338 333 } 339 334 335 return heightOfBlock + maxHeight; 336 } 337 340 338 #if ENABLE(CSS3_TEXT) 341 m_maxLogicalTop = 0; 342 computeMaxLogicalTop(m_maxLogicalTop); 339 float RootInlineBox::maxLogicalTop() const 340 { 341 float maxLogicalTop = 0; 342 computeMaxLogicalTop(maxLogicalTop); 343 return maxLogicalTop; 344 } 343 345 #endif // CSS3_TEXT 344 345 return heightOfBlock + maxHeight;346 }347 346 348 347 LayoutUnit RootInlineBox::beforeAnnotationsAdjustment() const -
trunk/Source/WebCore/rendering/RootInlineBox.h
r149967 r150258 191 191 #if ENABLE(CSS3_TEXT) 192 192 // Used to calculate the underline offset for TextUnderlinePositionUnder. 193 float maxLogicalTop() const { return m_maxLogicalTop; }193 float maxLogicalTop() const; 194 194 #endif // CSS3_TEXT 195 195 … … 227 227 LayoutUnit m_lineTopWithLeading; 228 228 LayoutUnit m_lineBottomWithLeading; 229 230 #if ENABLE(CSS3_TEXT)231 // Maximum logicalTop among all children of an InlineFlowBox. Used to232 // calculate the offset for TextUnderlinePositionUnder.233 float m_maxLogicalTop;234 #endif // CSS3_TEXT235 229 236 230 struct LineFragmentationData {
Note: See TracChangeset
for help on using the changeset viewer.