diff options
author | Herb Derby <herb@google.com> | 2018-03-05 14:36:45 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-06 15:50:26 +0000 |
commit | eb3f674d6ddd88e4a31570b26f61238b4b82f490 (patch) | |
tree | e092900bb1f4f025f03e2b5a36097dea334d027d /include | |
parent | 7487ec86b9d8dcd632378d9d6a4178877e144a16 (diff) |
Add GetTypefaceOrDefault to SkPaintPriv
Remove most uses of GetDefaultTypeface. SkTypeface has
fewer friends.
BUG=skia:7515
Change-Id: Iedec5b39b9ef8c638772be4971075491b59b740b
Reviewed-on: https://skia-review.googlesource.com/112300
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkTypeface.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h index fb2c64a200..b55ac4ecb3 100644 --- a/include/core/SkTypeface.h +++ b/include/core/SkTypeface.h @@ -309,6 +309,7 @@ protected: virtual SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&, const SkDescriptor*) const = 0; virtual void onFilterRec(SkScalerContextRec*) const = 0; + friend class SkScalerContext; // onFilterRec // Subclasses *must* override this method to work with the PDF backend. virtual std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const; @@ -364,12 +365,7 @@ private: }; static SkFontStyle FromOldStyle(Style oldStyle); static SkTypeface* GetDefaultTypeface(Style style = SkTypeface::kNormal); - static SkTypeface* NormalizeTypeface(SkTypeface* typeface) { - return typeface != nullptr ? typeface : SkTypeface::GetDefaultTypeface(); - } - friend class SkGlyphCache; // GetDefaultTypeface - friend class SkPaint; // GetDefaultTypeface - friend class SkScalerContext; // GetDefaultTypeface + friend class SkPaintPriv; // GetDefaultTypeface private: SkFontID fUniqueID; |