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

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

Issue 1590223003: Expose API for gx font variation axes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix FontConfig and Android. Created 4 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 | « include/ports/SkFontMgr.h ('k') | src/ports/SkFontHost_FreeType.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 "SkFontDescriptor.h" 8 #include "SkFontDescriptor.h"
9 #include "SkFontMgr.h" 9 #include "SkFontMgr.h"
10 #include "SkOncePtr.h" 10 #include "SkOncePtr.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return this->onCreateFromData(data, ttcIndex); 125 return this->onCreateFromData(data, ttcIndex);
126 } 126 }
127 127
128 SkTypeface* SkFontMgr::createFromStream(SkStreamAsset* stream, int ttcIndex) con st { 128 SkTypeface* SkFontMgr::createFromStream(SkStreamAsset* stream, int ttcIndex) con st {
129 if (nullptr == stream) { 129 if (nullptr == stream) {
130 return nullptr; 130 return nullptr;
131 } 131 }
132 return this->onCreateFromStream(stream, ttcIndex); 132 return this->onCreateFromStream(stream, ttcIndex);
133 } 133 }
134 134
135 SkTypeface* SkFontMgr::createFromStream(SkStreamAsset* stream, const FontParamet ers& params) const {
136 if (nullptr == stream) {
137 return nullptr;
138 }
139 return this->onCreateFromStream(stream, params);
140 }
141
135 SkTypeface* SkFontMgr::createFromFontData(SkFontData* data) const { 142 SkTypeface* SkFontMgr::createFromFontData(SkFontData* data) const {
136 if (nullptr == data) { 143 if (nullptr == data) {
137 return nullptr; 144 return nullptr;
138 } 145 }
139 return this->onCreateFromFontData(data); 146 return this->onCreateFromFontData(data);
140 } 147 }
141 148
142 // This implementation is temporary until it can be made pure virtual. 149 // This implementation is temporary until it can be made pure virtual.
150 SkTypeface* SkFontMgr::onCreateFromStream(SkStreamAsset* stream, const FontParam eters& p) const {
151 return this->createFromStream(stream, p.getCollectionIndex());
152 }
153
154 // This implementation is temporary until it can be made pure virtual.
143 SkTypeface* SkFontMgr::onCreateFromFontData(SkFontData* data) const { 155 SkTypeface* SkFontMgr::onCreateFromFontData(SkFontData* data) const {
144 SkTypeface* ret = this->createFromStream(data->detachStream(), data->getInde x()); 156 SkTypeface* ret = this->createFromStream(data->detachStream(), data->getInde x());
145 delete data; 157 delete data;
146 return ret; 158 return ret;
147 } 159 }
148 160
149 SkTypeface* SkFontMgr::createFromFile(const char path[], int ttcIndex) const { 161 SkTypeface* SkFontMgr::createFromFile(const char path[], int ttcIndex) const {
150 if (nullptr == path) { 162 if (nullptr == path) {
151 return nullptr; 163 return nullptr;
152 } 164 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 271 }
260 } 272 }
261 273
262 if (currentScore.score > maxScore.score) { 274 if (currentScore.score > maxScore.score) {
263 maxScore = currentScore; 275 maxScore = currentScore;
264 } 276 }
265 } 277 }
266 278
267 return this->createTypeface(maxScore.index); 279 return this->createTypeface(maxScore.index);
268 } 280 }
OLDNEW
« no previous file with comments | « include/ports/SkFontMgr.h ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698