Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4950)

Unified Diff: Source/platform/fonts/FontCache.h

Issue 790733005: Blink side of the change to pass the system font metrics from the browser to the renderer on Windo… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address review comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/fonts/FontCache.h
diff --git a/Source/platform/fonts/FontCache.h b/Source/platform/fonts/FontCache.h
index 9b6ac54a3e6f6936b2638fbf4fa6e623bba1125e..ef9873cf7fcb7a27fc16cc747aabc59d14f920a1 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 AtomicString& menuFontFamily() { return *s_smallCaptionFontFamilyName; }
+ static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; }
+ static const AtomicString& smallCaptionFontFamily() { return *s_smallCaptionFontFamilyName; }
+ static int32_t statusFontHeight() { return s_statusFontHeight; }
+ static const AtomicString& 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 AtomicString* s_menuFontFamilyName;
+ static int32_t s_menuFontHeight;
+ static AtomicString* s_smallCaptionFontFamilyName;
+ static int32_t s_smallCaptionFontHeight;
+ static AtomicString* s_statusFontFamilyName;
+ static int32_t s_statusFontHeight;
#endif
#if OS(MACOSX) || OS(ANDROID)
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp ('k') | Source/platform/fonts/win/FontCacheSkiaWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698