Changeset 116260 in webkit
- Timestamp:
- May 6, 2012 7:19:15 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116258 r116260 1 2012-05-06 Rob Buis <rbuis@rim.com> 2 3 Shrink TextRun object size 4 https://bugs.webkit.org/show_bug.cgi?id=85751 5 6 Reviewed by Darin Adler. 7 8 Reorder the member variables in TextRun so it shrinks from 56 to 40 bytes on my 64-bit build. This is important 9 for SVG, since RenderSVGText shrinks because of this. 10 11 Also add a compile assert for the expected object size. 12 13 * platform/graphics/TextRun.cpp: 14 (ExpectedTextRunSize): 15 (WebCore): 16 * platform/graphics/TextRun.h: 17 (WebCore::TextRun::TextRun): 18 (WebCore::TextRun::direction): 19 (TextRun): 20 1 21 2012-05-06 Jonathan Dong <jonathan.dong@torchmobile.com.cn> 2 22 -
trunk/Source/WebCore/platform/graphics/TextRun.cpp
r95901 r116260 29 29 namespace WebCore { 30 30 31 class ExpectedTextRunSize { 32 const void* pointer;; 33 int integers[2]; 34 float float1; 35 #if ENABLE(SVG) 36 float float2; 37 #endif 38 float float3; 39 uint32_t bitfields : 9; 40 RefPtr<TextRun::RenderingContext> renderingContext; 41 }; 42 43 COMPILE_ASSERT(sizeof(TextRun) == sizeof(ExpectedTextRunSize), "TextRun is not of expected size"); 44 31 45 bool TextRun::s_allowsRoundingHacks = false; 32 46 -
trunk/Source/WebCore/platform/graphics/TextRun.h
r114032 r116260 64 64 , m_len(len) 65 65 , m_xpos(xpos) 66 , m_expansion(expansion)67 , m_expansionBehavior(expansionBehavior)68 66 #if ENABLE(SVG) 69 67 , m_horizontalGlyphStretch(1) 70 68 #endif 69 , m_expansion(expansion) 70 , m_expansionBehavior(expansionBehavior) 71 71 , m_allowTabs(allowTabs) 72 72 , m_direction(direction) … … 84 84 , m_len(s.length()) 85 85 , m_xpos(xpos) 86 , m_expansion(expansion)87 , m_expansionBehavior(expansionBehavior)88 86 #if ENABLE(SVG) 89 87 , m_horizontalGlyphStretch(1) 90 88 #endif 89 , m_expansion(expansion) 90 , m_expansionBehavior(expansionBehavior) 91 91 , m_allowTabs(allowTabs) 92 92 , m_direction(direction) … … 121 121 bool allowsLeadingExpansion() const { return m_expansionBehavior & AllowLeadingExpansion; } 122 122 bool allowsTrailingExpansion() const { return m_expansionBehavior & AllowTrailingExpansion; } 123 TextDirection direction() const { return m_direction; }123 TextDirection direction() const { return static_cast<TextDirection>(m_direction); } 124 124 bool rtl() const { return m_direction == RTL; } 125 125 bool ltr() const { return m_direction == LTR; } … … 164 164 // the text line is not the same as left start of the containing block. 165 165 float m_xpos; 166 float m_expansion;167 ExpansionBehavior m_expansionBehavior;168 166 #if ENABLE(SVG) 169 167 float m_horizontalGlyphStretch; 170 168 #endif 171 bool m_allowTabs; 172 TextDirection m_direction; 173 bool m_directionalOverride; // Was this direction set by an override character. 174 bool m_characterScanForCodePath; 175 bool m_applyRunRounding; 176 bool m_applyWordRounding; 177 bool m_disableSpacing; 169 float m_expansion; 170 ExpansionBehavior m_expansionBehavior : 2; 171 unsigned m_allowTabs : 1; 172 unsigned m_direction : 1; 173 unsigned m_directionalOverride : 1; // Was this direction set by an override character. 174 unsigned m_characterScanForCodePath : 1; 175 unsigned m_applyRunRounding : 1; 176 unsigned m_applyWordRounding : 1; 177 unsigned m_disableSpacing : 1; 178 178 RefPtr<RenderingContext> m_renderingContext; 179 179 };
Note: See TracChangeset
for help on using the changeset viewer.