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

Unified Diff: src/ports/SkFontMgr_fontconfig.cpp

Issue 563263003: Handle NULL typeface in SkFontMgr_fontconfig::onMatchFaceStyle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_fontconfig.cpp
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 782fb268ccc7e18b2c320b45f3365c3895bb305a..b8a3fe5b0d232de1c0c21c74c6613c1965445e25 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -798,9 +798,13 @@ protected:
const SkFontStyle& style) const SK_OVERRIDE
{
//TODO: should the SkTypeface_fontconfig know its family?
- const SkTypeface_fontconfig* fcTypeface =
- static_cast<const SkTypeface_fontconfig*>(typeface);
- return this->matchFamilyStyle(get_string(fcTypeface->fPattern, FC_FAMILY), style);
+ const char* name = NULL;
mtklein 2014/09/12 18:55:27 not ""?
bungeman-skia 2014/09/12 19:02:32 Yeah, I want no-name not empty-name here. In theor
+ if (typeface) {
+ const SkTypeface_fontconfig* fcTypeface =
+ static_cast<const SkTypeface_fontconfig*>(typeface);
+ name = get_string(fcTypeface->fPattern, FC_FAMILY);
+ }
+ return this->matchFamilyStyle(name, style);
}
/** @param stream does not take ownership of the reference. */
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698