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

Unified Diff: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp

Issue 2692803005: Avoid checking family name in getLastResortFallbackFont() on Windows (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index 7b666bafa259f43848259f47e66b911427bbffdd..be0a9b728573cad2b388ccfe86dc650e7dd101a1 100644
--- a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -333,7 +333,8 @@ static bool typefacesHasStretchSuffix(const AtomicString& family,
std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(
const FontDescription& fontDescription,
const FontFaceCreationParams& creationParams,
- float fontSize) {
+ float fontSize,
+ AlternateFontName alternateFontName) {
ASSERT(creationParams.creationType() == CreateFontByFamily);
CString name;
@@ -346,8 +347,11 @@ std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(
FontWeight variantWeight;
FontStretch variantStretch;
- if (typefacesHasWeightSuffix(creationParams.family(), adjustedName,
- variantWeight)) {
+ if (alternateFontName == AlternateFontName::LastResort) {
+ if (!tf)
+ return nullptr;
+ } else if (typefacesHasWeightSuffix(creationParams.family(), adjustedName,
+ variantWeight)) {
FontFaceCreationParams adjustedParams(adjustedName);
FontDescription adjustedFontDescription = fontDescription;
adjustedFontDescription.setWeight(variantWeight);
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698