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

Side by Side Diff: src/fonts/SkTestScalerContext.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/fonts/SkRandomScalerContext.cpp ('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 "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return; 108 return;
109 } 109 }
110 } 110 }
111 // This should make SkPath::getBounds() queries threadsafe. 111 // This should make SkPath::getBounds() queries threadsafe.
112 path->updateBoundsCache(); 112 path->updateBoundsCache();
113 fPaths[index] = path; 113 fPaths[index] = path;
114 } 114 }
115 } 115 }
116 116
117 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, const SkFontStyle& style) 117 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, const SkFontStyle& style)
118 : SkTypeface(style, SkTypefaceCache::NewFontID(), false) 118 : SkTypeface(style, false)
119 , fTestFont(testFont) { 119 , fTestFont(testFont) {
120 } 120 }
121 121
122 void SkTestTypeface::getAdvance(SkGlyph* glyph) { 122 void SkTestTypeface::getAdvance(SkGlyph* glyph) {
123 // TODO(benjaminwagner): Update users to use floats. 123 // TODO(benjaminwagner): Update users to use floats.
124 glyph->fAdvanceX = SkFixedToFloat(fTestFont->fWidths[glyph->getGlyphID()]); 124 glyph->fAdvanceX = SkFixedToFloat(fTestFont->fWidths[glyph->getGlyphID()]);
125 glyph->fAdvanceY = 0; 125 glyph->fAdvanceY = 0;
126 } 126 }
127 127
128 void SkTestTypeface::getFontMetrics(SkPaint::FontMetrics* metrics) { 128 void SkTestTypeface::getFontMetrics(SkPaint::FontMetrics* metrics) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 private: 282 private:
283 SkTestTypeface* fFace; 283 SkTestTypeface* fFace;
284 SkMatrix fMatrix; 284 SkMatrix fMatrix;
285 }; 285 };
286 286
287 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe cts& effects, 287 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe cts& effects,
288 const SkDescriptor* desc) const { 288 const SkDescriptor* desc) const {
289 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d esc); 289 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d esc);
290 } 290 }
OLDNEW
« no previous file with comments | « src/fonts/SkRandomScalerContext.cpp ('k') | src/ports/SkFontConfigTypeface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698