Restore old behavior of SkTypeface::CreateFromTypeface.

This reverts
https://skia.googlesource.com/skia/+/9db509272a6fa2badbbdd2f5afce827370960a5f
and completes
https://skia.googlesource.com/skia/+/f91c47d91d72a1d85e2d6701864b8d7accc81647 .

R=caryclark@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/586473002
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index d7da131..f948787 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -132,10 +132,15 @@
 }
 
 SkTypeface* SkTypeface::CreateFromTypeface(const SkTypeface* family, Style s) {
-    if (family && family->style() == s) {
+    if (!family) {
+        return SkTypeface::RefDefault(s);
+    }
+
+    if (family->style() == s) {
         family->ref();
         return const_cast<SkTypeface*>(family);
     }
+
     SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
     bool bold = s & SkTypeface::kBold;
     bool italic = s & SkTypeface::kItalic;
@@ -143,7 +148,7 @@
                                             : SkFontStyle::kNormal_Weight,
                                        SkFontStyle::kNormal_Width,
                                        italic ? SkFontStyle::kItalic_Slant
-                                                : SkFontStyle::kUpright_Slant);
+                                              : SkFontStyle::kUpright_Slant);
     return fm->matchFaceStyle(family, newStyle);
 }
 
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 00b962a..6fc1f28 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -806,13 +806,9 @@
                                          const SkFontStyle& style) const SK_OVERRIDE
     {
         //TODO: should the SkTypeface_fontconfig know its family?
-        const char* name = NULL;
-        if (typeface) {
-            const SkTypeface_fontconfig* fcTypeface =
+        const SkTypeface_fontconfig* fcTypeface =
                 static_cast<const SkTypeface_fontconfig*>(typeface);
-            name = get_string(fcTypeface->fPattern, FC_FAMILY);
-        }
-        return this->matchFamilyStyle(name, style);
+        return this->matchFamilyStyle(get_string(fcTypeface->fPattern, FC_FAMILY), style);
     }
 
     /** @param stream does not take ownership of the reference. */