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

Side by Side Diff: src/fonts/SkTestScalerContext.cpp

Issue 1057413005: Remove filename from SkFontDescriptor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add file name to assert. Created 5 years, 8 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/SkPaint.cpp ('k') | src/ports/SkFontHost_linux.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 2014 Google Inc. 2 * Copyright 2014 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDescriptor.h" 10 #include "SkDescriptor.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 info->fAscent = 0; 154 info->fAscent = 0;
155 info->fDescent = 0; 155 info->fDescent = 0;
156 info->fStemV = 0; 156 info->fStemV = 0;
157 info->fCapHeight = 0; 157 info->fCapHeight = 0;
158 info->fBBox = SkIRect::MakeEmpty(); 158 info->fBBox = SkIRect::MakeEmpty();
159 return info; 159 return info;
160 } 160 }
161 161
162 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const { 162 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const {
163 desc->setFamilyName(fTestFont->fName); 163 desc->setFamilyName(fTestFont->fName);
164 desc->setFontFileName(fTestFont->fName);
165 *isLocal = false; 164 *isLocal = false;
166 } 165 }
167 166
168 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, 167 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding,
169 uint16_t glyphs[], int glyphCount) const { 168 uint16_t glyphs[], int glyphCount) const {
170 SkASSERT(encoding == kUTF16_Encoding); 169 SkASSERT(encoding == kUTF16_Encoding);
171 for (int index = 0; index < glyphCount; ++index) { 170 for (int index = 0; index < glyphCount; ++index) {
172 SkUnichar ch = ((SkUnichar*) chars)[index]; 171 SkUnichar ch = ((SkUnichar*) chars)[index];
173 glyphs[index] = fTestFont->codeToIndex(ch); 172 glyphs[index] = fTestFont->codeToIndex(ch);
174 } 173 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 285 }
287 286
288 private: 287 private:
289 SkTestTypeface* fFace; 288 SkTestTypeface* fFace;
290 SkMatrix fMatrix; 289 SkMatrix fMatrix;
291 }; 290 };
292 291
293 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { 292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
294 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc)); 293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc));
295 } 294 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/ports/SkFontHost_linux.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698