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

Side by Side Diff: src/ports/SkFontMgr_custom.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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkFontDescriptor.h" 8 #include "SkFontDescriptor.h"
9 #include "SkFontHost_FreeType_common.h" 9 #include "SkFontHost_FreeType_common.h"
10 #include "SkFontMgr.h" 10 #include "SkFontMgr.h"
(...skipping 12 matching lines...) Expand all
23 #include <limits> 23 #include <limits>
24 #include <memory> 24 #include <memory>
25 25
26 class SkData; 26 class SkData;
27 27
28 /** The base SkTypeface implementation for the custom font manager. */ 28 /** The base SkTypeface implementation for the custom font manager. */
29 class SkTypeface_Custom : public SkTypeface_FreeType { 29 class SkTypeface_Custom : public SkTypeface_FreeType {
30 public: 30 public:
31 SkTypeface_Custom(const SkFontStyle& style, bool isFixedPitch, 31 SkTypeface_Custom(const SkFontStyle& style, bool isFixedPitch,
32 bool sysFont, const SkString familyName, int index) 32 bool sysFont, const SkString familyName, int index)
33 : INHERITED(style, SkTypefaceCache::NewFontID(), isFixedPitch) 33 : INHERITED(style, isFixedPitch)
34 , fIsSysFont(sysFont), fFamilyName(familyName), fIndex(index) 34 , fIsSysFont(sysFont), fFamilyName(familyName), fIndex(index)
35 { } 35 { }
36 36
37 bool isSysFont() const { return fIsSysFont; } 37 bool isSysFont() const { return fIsSysFont; }
38 38
39 protected: 39 protected:
40 void onGetFamilyName(SkString* familyName) const override { 40 void onGetFamilyName(SkString* familyName) const override {
41 *familyName = fFamilyName; 41 *familyName = fFamilyName;
42 } 42 }
43 43
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString()); 510 SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString());
511 families->push_back().reset(family); 511 families->push_back().reset(family);
512 family->appendTypeface(sk_make_sp<SkTypeface_Empty>()); 512 family->appendTypeface(sk_make_sp<SkTypeface_Empty>());
513 } 513 }
514 514
515 }; 515 };
516 516
517 SK_API SkFontMgr* SkFontMgr_New_Custom_Empty() { 517 SK_API SkFontMgr* SkFontMgr_New_Custom_Empty() {
518 return new SkFontMgr_Custom(EmptyFontLoader()); 518 return new SkFontMgr_Custom(EmptyFontLoader());
519 } 519 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698