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

Side by Side Diff: src/core/SkFontMgr.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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/core/SkFontDescriptor.h ('k') | src/core/SkPaint.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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
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 "SkFontMgr.h" 8 #include "SkFontMgr.h"
9 #include "SkLazyPtr.h" 9 #include "SkLazyPtr.h"
10 #include "SkStream.h"
10 #include "SkTypes.h" 11 #include "SkTypes.h"
11 12
12 class SkFontStyle; 13 class SkFontStyle;
13 class SkStream;
14 class SkTypeface; 14 class SkTypeface;
15 15
16 class SkEmptyFontStyleSet : public SkFontStyleSet { 16 class SkEmptyFontStyleSet : public SkFontStyleSet {
17 public: 17 public:
18 int count() SK_OVERRIDE { return 0; } 18 int count() SK_OVERRIDE { return 0; }
19 void getStyle(int, SkFontStyle*, SkString*) SK_OVERRIDE { 19 void getStyle(int, SkFontStyle*, SkString*) SK_OVERRIDE {
20 SkDEBUGFAIL("SkFontStyleSet::getStyle called on empty set"); 20 SkDEBUGFAIL("SkFontStyleSet::getStyle called on empty set");
21 } 21 }
22 SkTypeface* createTypeface(int index) SK_OVERRIDE { 22 SkTypeface* createTypeface(int index) SK_OVERRIDE {
23 SkDEBUGFAIL("SkFontStyleSet::createTypeface called on empty set"); 23 SkDEBUGFAIL("SkFontStyleSet::createTypeface called on empty set");
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 SkUnichar character) const S K_OVERRIDE { 61 SkUnichar character) const S K_OVERRIDE {
62 return NULL; 62 return NULL;
63 } 63 }
64 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*, 64 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*,
65 const SkFontStyle&) const SK_OVERRIDE { 65 const SkFontStyle&) const SK_OVERRIDE {
66 return NULL; 66 return NULL;
67 } 67 }
68 SkTypeface* onCreateFromData(SkData*, int) const SK_OVERRIDE { 68 SkTypeface* onCreateFromData(SkData*, int) const SK_OVERRIDE {
69 return NULL; 69 return NULL;
70 } 70 }
71 SkTypeface* onCreateFromStream(SkStream*, int) const SK_OVERRIDE { 71 SkTypeface* onCreateFromStream(SkStream* stream, int) const SK_OVERRIDE {
72 SkDELETE(stream);
72 return NULL; 73 return NULL;
73 } 74 }
74 SkTypeface* onCreateFromFile(const char[], int) const SK_OVERRIDE { 75 SkTypeface* onCreateFromFile(const char[], int) const SK_OVERRIDE {
75 return NULL; 76 return NULL;
76 } 77 }
77 SkTypeface* onLegacyCreateTypeface(const char [], unsigned) const SK_OVERRID E { 78 SkTypeface* onLegacyCreateTypeface(const char [], unsigned) const SK_OVERRID E {
78 return NULL; 79 return NULL;
79 } 80 }
80 }; 81 };
81 82
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 SkFontMgr* sk_fontmgr_create_default() { 149 SkFontMgr* sk_fontmgr_create_default() {
149 SkFontMgr* fm = SkFontMgr::Factory(); 150 SkFontMgr* fm = SkFontMgr::Factory();
150 return fm ? fm : SkNEW(SkEmptyFontMgr); 151 return fm ? fm : SkNEW(SkEmptyFontMgr);
151 } 152 }
152 153
153 SK_DECLARE_STATIC_LAZY_PTR(SkFontMgr, singleton, sk_fontmgr_create_default); 154 SK_DECLARE_STATIC_LAZY_PTR(SkFontMgr, singleton, sk_fontmgr_create_default);
154 155
155 SkFontMgr* SkFontMgr::RefDefault() { 156 SkFontMgr* SkFontMgr::RefDefault() {
156 return SkRef(singleton.get()); 157 return SkRef(singleton.get());
157 } 158 }
OLDNEW
« no previous file with comments | « src/core/SkFontDescriptor.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698