Title: [112736] trunk/Source/WebCore
- Revision
- 112736
- Author
- rn...@webkit.org
- Date
- 2012-03-30 15:36:08 -0700 (Fri, 30 Mar 2012)
Log Message
Add a compile assert for the size of FontDescription
https://bugs.webkit.org/show_bug.cgi?id=82786
Reviewed by Eric Seidel.
Added the assertion. Also converted a couple of boolean bitfields to unsinged.
I've verified that the conversions are safe (they're only used in FontDescription.h/cpp).
* platform/graphics/FontDescription.cpp:
(SameSizeAsFontDescription):
(WebCore):
* platform/graphics/FontDescription.h:
(FontDescription):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (112735 => 112736)
--- trunk/Source/WebCore/ChangeLog 2012-03-30 22:32:48 UTC (rev 112735)
+++ trunk/Source/WebCore/ChangeLog 2012-03-30 22:36:08 UTC (rev 112736)
@@ -1,3 +1,19 @@
+2012-03-30 Ryosuke Niwa <rn...@webkit.org>
+
+ Add a compile assert for the size of FontDescription
+ https://bugs.webkit.org/show_bug.cgi?id=82786
+
+ Reviewed by Eric Seidel.
+
+ Added the assertion. Also converted a couple of boolean bitfields to unsinged.
+ I've verified that the conversions are safe (they're only used in FontDescription.h/cpp).
+
+ * platform/graphics/FontDescription.cpp:
+ (SameSizeAsFontDescription):
+ (WebCore):
+ * platform/graphics/FontDescription.h:
+ (FontDescription):
+
2012-03-30 Adam Barth <aba...@webkit.org>
Move CPP files related to ResourceHandle to WebCore/platform
Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (112735 => 112736)
--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp 2012-03-30 22:32:48 UTC (rev 112735)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp 2012-03-30 22:36:08 UTC (rev 112736)
@@ -32,6 +32,18 @@
namespace WebCore {
+struct SameSizeAsFontDescription {
+ FontFamily familyList;
+ void* settings;
+ RefPtr<FontFeatureSettings> m_featureSettings;
+ float sizes[2];
+ // FXIME: Make them fit into one word.
+ uint32_t bitfields;
+ uint32_t bitfields2 : 8;
+};
+
+COMPILE_ASSERT(sizeof(FontDescription) == sizeof(SameSizeAsFontDescription), FontDescription_should_stay_small);
+
FontWeight FontDescription::lighterWeight(void) const
{
// FIXME: Should actually return the CSS weight corresponding to next lightest
Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (112735 => 112736)
--- trunk/Source/WebCore/platform/graphics/FontDescription.h 2012-03-30 22:32:48 UTC (rev 112735)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h 2012-03-30 22:36:08 UTC (rev 112736)
@@ -182,11 +182,11 @@
unsigned m_italic : 1; // FontItalic
unsigned m_smallCaps : 1; // FontSmallCaps
- bool m_isAbsoluteSize : 1; // Whether or not CSS specified an explicit size
- // (logical sizes like "medium" don't count).
+ unsigned m_isAbsoluteSize : 1; // Whether or not CSS specified an explicit size
+ // (logical sizes like "medium" don't count).
unsigned m_weight : 8; // FontWeight
unsigned m_genericFamily : 3; // GenericFamilyType
- bool m_usePrinterFont : 1;
+ unsigned m_usePrinterFont : 1;
unsigned m_renderingMode : 1; // Used to switch between CG and GDI text on Windows.
unsigned m_kerning : 2; // Kerning
@@ -201,7 +201,7 @@
unsigned m_fontSmoothing : 2; // FontSmoothingMode
unsigned m_textRendering : 2; // TextRenderingMode
- bool m_isSpecifiedFont : 1; // True if a web page specifies a non-generic font family as the first font family.
+ 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.
};
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes