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

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

Issue 1737693006: Change type of SkGlyph::fAdvance[XY] to float. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Should be float, not SkScalar. Created 4 years, 9 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/SkTextToPathIter.h ('k') | src/fonts/SkTestScalerContext.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 2013 Google Inc. 2 * Copyright 2013 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 "SkGScalerContext.h" 8 #include "SkGScalerContext.h"
9 #include "SkGlyph.h" 9 #include "SkGlyph.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 uint16_t SkGScalerContext::generateCharToGlyph(SkUnichar uni) { 72 uint16_t SkGScalerContext::generateCharToGlyph(SkUnichar uni) {
73 return fProxy->charToGlyphID(uni); 73 return fProxy->charToGlyphID(uni);
74 } 74 }
75 75
76 void SkGScalerContext::generateAdvance(SkGlyph* glyph) { 76 void SkGScalerContext::generateAdvance(SkGlyph* glyph) {
77 fProxy->getAdvance(glyph); 77 fProxy->getAdvance(glyph);
78 78
79 SkVector advance; 79 SkVector advance;
80 fMatrix.mapXY(SkFixedToScalar(glyph->fAdvanceX), 80 fMatrix.mapXY(SkFloatToScalar(glyph->fAdvanceX),
81 SkFixedToScalar(glyph->fAdvanceY), &advance); 81 SkFloatToScalar(glyph->fAdvanceY), &advance);
82 glyph->fAdvanceX = SkScalarToFixed(advance.fX); 82 glyph->fAdvanceX = SkScalarToFloat(advance.fX);
83 glyph->fAdvanceY = SkScalarToFixed(advance.fY); 83 glyph->fAdvanceY = SkScalarToFloat(advance.fY);
84 } 84 }
85 85
86 void SkGScalerContext::generateMetrics(SkGlyph* glyph) { 86 void SkGScalerContext::generateMetrics(SkGlyph* glyph) {
87 fProxy->getMetrics(glyph); 87 fProxy->getMetrics(glyph);
88 88
89 SkVector advance; 89 SkVector advance;
90 fMatrix.mapXY(SkFixedToScalar(glyph->fAdvanceX), 90 fMatrix.mapXY(SkFloatToScalar(glyph->fAdvanceX),
91 SkFixedToScalar(glyph->fAdvanceY), &advance); 91 SkFloatToScalar(glyph->fAdvanceY), &advance);
92 glyph->fAdvanceX = SkScalarToFixed(advance.fX); 92 glyph->fAdvanceX = SkScalarToFloat(advance.fX);
93 glyph->fAdvanceY = SkScalarToFixed(advance.fY); 93 glyph->fAdvanceY = SkScalarToFloat(advance.fY);
94 94
95 SkPath path; 95 SkPath path;
96 fProxy->getPath(*glyph, &path); 96 fProxy->getPath(*glyph, &path);
97 path.transform(fMatrix); 97 path.transform(fMatrix);
98 98
99 SkRect storage; 99 SkRect storage;
100 const SkPaint& paint = fFace->paint(); 100 const SkPaint& paint = fFace->paint();
101 const SkRect& newBounds = paint.doComputeFastBounds(path.getBounds(), 101 const SkRect& newBounds = paint.doComputeFastBounds(path.getBounds(),
102 &storage, 102 &storage,
103 SkPaint::kFill_Style); 103 SkPaint::kFill_Style);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 friend class SkGFontBuilder; 256 friend class SkGFontBuilder;
257 SkGFont(int count, Glyph* array); 257 SkGFont(int count, Glyph* array);
258 }; 258 };
259 259
260 class SkGFontBuilder { 260 class SkGFontBuilder {
261 public: 261 public:
262 262
263 }; 263 };
264 #endif 264 #endif
OLDNEW
« no previous file with comments | « src/core/SkTextToPathIter.h ('k') | src/fonts/SkTestScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698