Shrink FontDescription object size
authorrwlbuis@webkit.org <rwlbuis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 01:53:10 +0000 (01:53 +0000)
committerrwlbuis@webkit.org <rwlbuis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 01:53:10 +0000 (01:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86950

Reviewed by Alexey Proskuryakov.

Reduce object size of FontDescription by 8 bytes on 64-bit, 4 bytes on 32-bit systems.
Note that this means Font, StyleInheritedData and RenderSVGInlineText shrink too.

* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::script):
(FontDescription):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117868 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontDescription.cpp
Source/WebCore/platform/graphics/FontDescription.h

index c140ce5..767369c 100644 (file)
@@ -1,3 +1,18 @@
+2012-05-21  Rob Buis  <rbuis@rim.com>
+
+        Shrink FontDescription object size
+        https://bugs.webkit.org/show_bug.cgi?id=86950
+
+        Reviewed by Alexey Proskuryakov.
+
+        Reduce object size of FontDescription by 8 bytes on 64-bit, 4 bytes on 32-bit systems.
+        Note that this means Font, StyleInheritedData and RenderSVGInlineText shrink too.
+
+        * platform/graphics/FontDescription.cpp:
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontDescription::script):
+        (FontDescription):
+
 2012-05-21  Abhishek Arya  <inferno@chromium.org>
 
         Regression(r117482): Run-in crashes relating to generated content and inline line box clearing.
index 7c3bc65..e822c01 100644 (file)
@@ -34,7 +34,6 @@ namespace WebCore {
 
 struct SameSizeAsFontDescription {
     FontFamily familyList;
-    void* settings;
     RefPtr<FontFeatureSettings> m_featureSettings;
     float sizes[2];
     // FXIME: Make them fit into one word.
index 534f460..4436875 100644 (file)
@@ -127,7 +127,7 @@ public:
     unsigned keywordSize() const { return m_keywordSize; }
     FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMode>(m_fontSmoothing); }
     TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); }
-    UScriptCode script() const { return m_script; }
+    UScriptCode script() const { return static_cast<UScriptCode>(m_script); }
 
     FontTraitsMask traitsMask() const;
     bool isSpecifiedFont() const { return m_isSpecifiedFont; }
@@ -202,7 +202,7 @@ private:
     unsigned m_fontSmoothing : 2; // FontSmoothingMode
     unsigned m_textRendering : 2; // TextRenderingMode
     unsigned m_isSpecifiedFont : 1; // True if a web page specifies a non-generic font family as the first font family.
-    UScriptCode m_script; // Used to help choose an appropriate font for generic font families.
+    unsigned m_script : 7; // Used to help choose an appropriate font for generic font families.
 };
 
 inline bool FontDescription::operator==(const FontDescription& other) const