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

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

Issue 488143002: Replace SkTypeface::Style with SkFontStyle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add expectations, remove whitespace. Created 6 years, 2 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/fonts/SkTestScalerContext.h ('k') | src/ports/SkFontConfigTypeface.h » ('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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 path->close(); 103 path->close();
104 break; 104 break;
105 default: 105 default:
106 SkDEBUGFAIL("bad verb"); 106 SkDEBUGFAIL("bad verb");
107 return; 107 return;
108 } 108 }
109 } 109 }
110 fPaths[index] = path; 110 fPaths[index] = path;
111 } 111 }
112 } 112 }
113 113
114 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, SkTypeface::Style style) 114 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, const SkFontStyle& style)
115 : SkTypeface(style, SkTypefaceCache::NewFontID(), false) 115 : SkTypeface(style, SkTypefaceCache::NewFontID(), false)
116 , fTestFont(testFont) { 116 , fTestFont(testFont) {
117 } 117 }
118 118
119 void SkTestTypeface::getAdvance(SkGlyph* glyph) { 119 void SkTestTypeface::getAdvance(SkGlyph* glyph) {
120 glyph->fAdvanceX = fTestFont->fWidths[SkGlyph::ID2Code(glyph->fID)]; 120 glyph->fAdvanceX = fTestFont->fWidths[SkGlyph::ID2Code(glyph->fID)];
121 glyph->fAdvanceY = 0; 121 glyph->fAdvanceY = 0;
122 } 122 }
123 123
124 void SkTestTypeface::getFontMetrics(SkPaint::FontMetrics* metrics) { 124 void SkTestTypeface::getFontMetrics(SkPaint::FontMetrics* metrics) {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 private: 290 private:
291 SkTestTypeface* fFace; 291 SkTestTypeface* fFace;
292 SkMatrix fMatrix; 292 SkMatrix fMatrix;
293 }; 293 };
294 294
295 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { 295 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
296 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc)); 296 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc));
297 } 297 }
OLDNEW
« no previous file with comments | « src/fonts/SkTestScalerContext.h ('k') | src/ports/SkFontConfigTypeface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698