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

Side by Side Diff: include/core/SkScalar.h

Issue 1767163003: Use float rather than SkFixed for gradient TileProcs. (Closed) Base URL: https://skia.googlesource.com/skia@scalar-pin-to-fixed
Patch Set: 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 | « no previous file | src/effects/gradients/SkClampRange.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #ifndef SkScalar_DEFINED 8 #ifndef SkScalar_DEFINED
9 #define SkScalar_DEFINED 9 #define SkScalar_DEFINED
10 10
(...skipping 16 matching lines...) Expand all
27 #define SK_ScalarPI 3.14159265f 27 #define SK_ScalarPI 3.14159265f
28 #define SK_ScalarTanPIOver8 0.414213562f 28 #define SK_ScalarTanPIOver8 0.414213562f
29 #define SK_ScalarRoot2Over2 0.707106781f 29 #define SK_ScalarRoot2Over2 0.707106781f
30 #define SK_ScalarMax 3.402823466e+38f 30 #define SK_ScalarMax 3.402823466e+38f
31 #define SK_ScalarInfinity SK_FloatInfinity 31 #define SK_ScalarInfinity SK_FloatInfinity
32 #define SK_ScalarNegativeInfinity SK_FloatNegativeInfinity 32 #define SK_ScalarNegativeInfinity SK_FloatNegativeInfinity
33 #define SK_ScalarNaN SK_FloatNaN 33 #define SK_ScalarNaN SK_FloatNaN
34 34
35 #define SkFixedToScalar(x) SkFixedToFloat(x) 35 #define SkFixedToScalar(x) SkFixedToFloat(x)
36 #define SkScalarToFixed(x) SkFloatToFixed(x) 36 #define SkScalarToFixed(x) SkFloatToFixed(x)
37 #define SkScalarPinToFixed(x) SkFloatPinToFixed(x)
37 38
38 #define SkScalarFloorToScalar(x) sk_float_floor(x) 39 #define SkScalarFloorToScalar(x) sk_float_floor(x)
39 #define SkScalarCeilToScalar(x) sk_float_ceil(x) 40 #define SkScalarCeilToScalar(x) sk_float_ceil(x)
40 #define SkScalarRoundToScalar(x) sk_float_floor((x) + 0.5f) 41 #define SkScalarRoundToScalar(x) sk_float_floor((x) + 0.5f)
41 42
42 #define SkScalarFloorToInt(x) sk_float_floor2int(x) 43 #define SkScalarFloorToInt(x) sk_float_floor2int(x)
43 #define SkScalarCeilToInt(x) sk_float_ceil2int(x) 44 #define SkScalarCeilToInt(x) sk_float_ceil2int(x)
44 #define SkScalarRoundToInt(x) sk_float_round2int(x) 45 #define SkScalarRoundToInt(x) sk_float_round2int(x)
45 46
46 #define SkScalarAbs(x) sk_float_abs(x) 47 #define SkScalarAbs(x) sk_float_abs(x)
(...skipping 23 matching lines...) Expand all
70 #define SK_ScalarPI 3.141592653589793 71 #define SK_ScalarPI 3.141592653589793
71 #define SK_ScalarTanPIOver8 0.4142135623731 72 #define SK_ScalarTanPIOver8 0.4142135623731
72 #define SK_ScalarRoot2Over2 0.70710678118655 73 #define SK_ScalarRoot2Over2 0.70710678118655
73 #define SK_ScalarMax 1.7976931348623157+308 74 #define SK_ScalarMax 1.7976931348623157+308
74 #define SK_ScalarInfinity SK_DoubleInfinity 75 #define SK_ScalarInfinity SK_DoubleInfinity
75 #define SK_ScalarNegativeInfinity SK_DoubleNegativeInfinity 76 #define SK_ScalarNegativeInfinity SK_DoubleNegativeInfinity
76 #define SK_ScalarNaN SK_DoubleNaN 77 #define SK_ScalarNaN SK_DoubleNaN
77 78
78 #define SkFixedToScalar(x) SkFixedToDouble(x) 79 #define SkFixedToScalar(x) SkFixedToDouble(x)
79 #define SkScalarToFixed(x) SkDoubleToFixed(x) 80 #define SkScalarToFixed(x) SkDoubleToFixed(x)
81 #define SkScalarPinToFixed(x) SkDoublePinToFixed(x)
80 82
81 #define SkScalarFloorToScalar(x) floor(x) 83 #define SkScalarFloorToScalar(x) floor(x)
82 #define SkScalarCeilToScalar(x) ceil(x) 84 #define SkScalarCeilToScalar(x) ceil(x)
83 #define SkScalarRoundToScalar(x) floor((x) + 0.5) 85 #define SkScalarRoundToScalar(x) floor((x) + 0.5)
84 86
85 #define SkScalarFloorToInt(x) (int)floor(x) 87 #define SkScalarFloorToInt(x) (int)floor(x)
86 #define SkScalarCeilToInt(x) (int)ceil(x) 88 #define SkScalarCeilToInt(x) (int)ceil(x)
87 #define SkScalarRoundToInt(x) (int)floor((x) + 0.5) 89 #define SkScalarRoundToInt(x) (int)floor((x) + 0.5)
88 90
89 #define SkScalarAbs(x) abs(x) 91 #define SkScalarAbs(x) abs(x)
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 SkASSERT(n >= 0); 262 SkASSERT(n >= 0);
261 for (int i = 0; i < n; ++i) { 263 for (int i = 0; i < n; ++i) {
262 if (a[i] != b[i]) { 264 if (a[i] != b[i]) {
263 return false; 265 return false;
264 } 266 }
265 } 267 }
266 return true; 268 return true;
267 } 269 }
268 270
269 #endif 271 #endif
OLDNEW
« no previous file with comments | « no previous file | src/effects/gradients/SkClampRange.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698