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

Unified Diff: src/core/SkTypeface.cpp

Issue 2147733002: Remove user specified typeface id. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove one last straggler. Created 4 years, 5 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 | « include/core/SkTypeface.h ('k') | src/fonts/SkGScalerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypeface.cpp
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 90a1eaabeca08d956974e96812bb5273ec5a0ffb..4b0dd0831b64381d9f8974584c6e13e12d6aec54 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -14,9 +14,10 @@
#include "SkOnce.h"
#include "SkStream.h"
#include "SkTypeface.h"
+#include "SkTypefaceCache.h"
-SkTypeface::SkTypeface(const SkFontStyle& style, SkFontID fontID, bool isFixedPitch)
- : fUniqueID(fontID), fStyle(style), fIsFixedPitch(isFixedPitch) { }
+SkTypeface::SkTypeface(const SkFontStyle& style, bool isFixedPitch)
+ : fUniqueID(SkTypefaceCache::NewFontID()), fStyle(style), fIsFixedPitch(isFixedPitch) { }
SkTypeface::~SkTypeface() { }
@@ -40,7 +41,7 @@ class SkEmptyTypeface : public SkTypeface {
public:
static SkEmptyTypeface* Create() { return new SkEmptyTypeface; }
protected:
- SkEmptyTypeface() : SkTypeface(SkFontStyle(), 0, true) { }
+ SkEmptyTypeface() : SkTypeface(SkFontStyle(), true) { }
SkStreamAsset* onOpenStream(int* ttcIndex) const override { return nullptr; }
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
« no previous file with comments | « include/core/SkTypeface.h ('k') | src/fonts/SkGScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698