Make SkTypeface::Style and FromOldStyle private.

These are no longer used outside of Skia, so make them private.

Change-Id: I735bb39c10553885cc6051aebddeff150ba4caa9
Reviewed-on: https://skia-review.googlesource.com/59180
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/src/core/SkFontDescriptor.cpp b/src/core/SkFontDescriptor.cpp
index 519e8f2..14b0318 100644
--- a/src/core/SkFontDescriptor.cpp
+++ b/src/core/SkFontDescriptor.cpp
@@ -20,7 +20,6 @@
     // defines for names in its 'name' table.
     kFontAxes       = 0xFC,
     kFontIndex      = 0xFD,
-    kFontFileName   = 0xFE,  // Remove when MIN_PICTURE_VERSION > 41
     kSentinel       = 0xFF,
 };
 
@@ -34,14 +33,6 @@
     }
 }
 
-// Remove when MIN_PICTURE_VERSION > 41
-static void skip_string(SkStream* stream) {
-    const uint32_t length = SkToU32(stream->readPackedUInt());
-    if (length > 0) {
-        stream->skip(length);
-    }
-}
-
 static void write_string(SkWStream* stream, const SkString& string, uint32_t id) {
     if (!string.isEmpty()) {
         stream->writePackedUInt(id);
@@ -61,14 +52,9 @@
 
 bool SkFontDescriptor::Deserialize(SkStream* stream, SkFontDescriptor* result) {
     size_t styleBits = stream->readPackedUInt();
-    if (styleBits <= 2) {
-        // Remove this branch when MIN_PICTURE_VERSION > 45
-        result->fStyle = SkFontStyle::FromOldStyle(styleBits);
-    } else {
-        result->fStyle = SkFontStyle((styleBits >> 16) & 0xFFFF,
-                                     (styleBits >> 8 ) & 0xFF,
-                                     static_cast<SkFontStyle::Slant>(styleBits & 0xFF));
-    }
+    result->fStyle = SkFontStyle((styleBits >> 16) & 0xFFFF,
+                                 (styleBits >> 8 ) & 0xFF,
+                                 static_cast<SkFontStyle::Slant>(styleBits & 0xFF));
 
     SkAutoSTMalloc<4, SkFixed> axis;
     size_t axisCount = 0;
@@ -94,9 +80,6 @@
             case kFontIndex:
                 index = read_uint(stream);
                 break;
-            case kFontFileName:  // Remove when MIN_PICTURE_VERSION > 41
-                skip_string(stream);
-                break;
             default:
                 SkDEBUGFAIL("Unknown id used by a font descriptor");
                 return false;
diff --git a/src/core/SkFontStyle.cpp b/src/core/SkFontStyle.cpp
deleted file mode 100644
index 996d383..0000000
--- a/src/core/SkFontStyle.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkFontStyle.h"
-#include "SkTypeface.h"
-#include "SkTypes.h"
-
-/*static*/SkFontStyle SkFontStyle::FromOldStyle(unsigned oldStyle) {
-    return SkFontStyle((oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight
-                                                      : SkFontStyle::kNormal_Weight,
-                       SkFontStyle::kNormal_Width,
-                       (oldStyle & SkTypeface::kItalic) ? SkFontStyle::kItalic_Slant
-                                                        : SkFontStyle::kUpright_Slant);
-}
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index a41e6b5..fe26c0f 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1869,7 +1869,7 @@
     // since the other process may have a different notion of default.
     SkTypeface* tf = this->getTypeface();
     if (!tf && buffer.isCrossProcess()) {
-        tf = SkTypeface::GetDefaultTypeface(SkTypeface::kNormal);
+        tf = SkTypeface::GetDefaultTypeface();
     }
 
     uint8_t flatFlags = 0;
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 0c8c4b9..d5ed70a 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -86,6 +86,14 @@
 
 }
 
+SkFontStyle SkTypeface::FromOldStyle(Style oldStyle) {
+    return SkFontStyle((oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight
+                                                      : SkFontStyle::kNormal_Weight,
+                       SkFontStyle::kNormal_Width,
+                       (oldStyle & SkTypeface::kItalic) ? SkFontStyle::kItalic_Slant
+                                                        : SkFontStyle::kUpright_Slant);
+}
+
 SkTypeface* SkTypeface::GetDefaultTypeface(Style style) {
     static SkOnce once[4];
     static sk_sp<SkTypeface> defaults[4];
@@ -93,14 +101,14 @@
     SkASSERT((int)style < 4);
     once[style]([style] {
         sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
-        auto t = fm->legacyMakeTypeface(nullptr, SkFontStyle::FromOldStyle(style));
+        auto t = fm->legacyMakeTypeface(nullptr, FromOldStyle(style));
         defaults[style] = t ? t : SkEmptyTypeface::Make();
     });
     return defaults[style].get();
 }
 
 sk_sp<SkTypeface> SkTypeface::MakeDefault() {
-    return sk_ref_sp(GetDefaultTypeface(SkTypeface::kNormal));
+    return sk_ref_sp(GetDefaultTypeface());
 }
 
 uint32_t SkTypeface::UniqueID(const SkTypeface* face) {