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

Side by Side Diff: src/core/SkFDot6.h

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/SkDrawProcs.h ('k') | src/core/SkFindAndPlaceGlyph.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkFDot6_DEFINED 10 #ifndef SkFDot6_DEFINED
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #define SkFixedToFDot6(x) ((x) >> 10) 56 #define SkFixedToFDot6(x) ((x) >> 10)
57 57
58 inline SkFixed SkFDot6ToFixed(SkFDot6 x) { 58 inline SkFixed SkFDot6ToFixed(SkFDot6 x) {
59 SkASSERT((SkLeftShift(x, 10) >> 10) == x); 59 SkASSERT((SkLeftShift(x, 10) >> 10) == x);
60 60
61 return SkLeftShift(x, 10); 61 return SkLeftShift(x, 10);
62 } 62 }
63 63
64 #define SkScalarToFDot6(x) (SkFDot6)((x) * 64) 64 #define SkScalarToFDot6(x) (SkFDot6)((x) * 64)
65 #define SkFDot6ToScalar(x) ((SkScalar)(x) * 0.015625f) 65 #define SkFDot6ToScalar(x) ((SkScalar)(x) * 0.015625f)
66 #define SkFDot6ToFloat SkFDot6ToScalar
66 67
67 inline SkFixed SkFDot6Div(SkFDot6 a, SkFDot6 b) { 68 inline SkFixed SkFDot6Div(SkFDot6 a, SkFDot6 b) {
68 SkASSERT(b != 0); 69 SkASSERT(b != 0);
69 70
70 if (a == (int16_t)a) { 71 if (a == (int16_t)a) {
71 return SkLeftShift(a, 16) / b; 72 return SkLeftShift(a, 16) / b;
72 } else { 73 } else {
73 return SkFixedDiv(a, b); 74 return SkFixedDiv(a, b);
74 } 75 }
75 } 76 }
76 77
77 #endif 78 #endif
OLDNEW
« no previous file with comments | « src/core/SkDrawProcs.h ('k') | src/core/SkFindAndPlaceGlyph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698