Chromium Code Reviews| Index: Source/platform/fonts/FontCache.h |
| diff --git a/Source/platform/fonts/FontCache.h b/Source/platform/fonts/FontCache.h |
| index 9b6ac54a3e6f6936b2638fbf4fa6e623bba1125e..2880689ac36af0e13970c5e8ac6282198989ee91 100644 |
| --- a/Source/platform/fonts/FontCache.h |
| +++ b/Source/platform/fonts/FontCache.h |
| @@ -110,6 +110,16 @@ public: |
| static void setDeviceScaleFactor(float deviceScaleFactor) { s_deviceScaleFactor = deviceScaleFactor; } |
| static void setUseSubpixelPositioning(bool useSubpixelPositioning) { s_useSubpixelPositioning = useSubpixelPositioning; } |
| static void addSideloadedFontForTesting(SkTypeface*); |
| + // Functions to cache and retrieve the system font metrics. |
| + static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight); |
| + static void setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fontHeight); |
| + static void setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeight); |
| + static int32_t menuFontHeight() { return s_menuFontHeight; } |
| + static const String& menuFontFamily() { return s_smallCaptionFontFamilyName; } |
| + static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } |
| + static const String& smallCaptionFontFamily() { return s_smallCaptionFontFamilyName; } |
| + static int32_t statusFontHeight() { return s_statusFontHeight; } |
| + static const String& statusFontFamily() { return s_statusFontFamilyName; } |
| #endif |
| typedef uint32_t FontFileKey; |
| @@ -165,6 +175,13 @@ private: |
| static float s_deviceScaleFactor; |
| static bool s_useSubpixelPositioning; |
| static HashMap<String, RefPtr<SkTypeface> >* s_sideloadedFonts; |
| + // The system font metrics cache. |
| + static String s_menuFontFamilyName; |
|
scottmg
2015/01/06 23:13:57
you might need to make these String* and allocate
ananta
2015/01/06 23:30:16
Makes sense. Done. Changed these to AtomicString*
|
| + static int32_t s_menuFontHeight; |
| + static String s_smallCaptionFontFamilyName; |
| + static int32_t s_smallCaptionFontHeight; |
| + static String s_statusFontFamilyName; |
| + static int32_t s_statusFontHeight; |
| #endif |
| #if OS(MACOSX) || OS(ANDROID) |