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

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

Issue 1138263002: Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « include/core/SkPoint.h ('k') | samplecode/SampleApp.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 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 static inline SkScalar SkScalarPin(SkScalar x, SkScalar min, SkScalar max) { 177 static inline SkScalar SkScalarPin(SkScalar x, SkScalar min, SkScalar max) {
178 return SkTPin(x, min, max); 178 return SkTPin(x, min, max);
179 } 179 }
180 180
181 SkScalar SkScalarSinCos(SkScalar radians, SkScalar* cosValue); 181 SkScalar SkScalarSinCos(SkScalar radians, SkScalar* cosValue);
182 182
183 static inline SkScalar SkScalarSquare(SkScalar x) { return x * x; } 183 static inline SkScalar SkScalarSquare(SkScalar x) { return x * x; }
184 184
185 #define SkScalarMul(a, b) ((SkScalar)(a) * (b)) 185 #define SkScalarMul(a, b) ((SkScalar)(a) * (b))
186 #define SkScalarMulAdd(a, b, c) ((SkScalar)(a) * (b) + (c)) 186 #define SkScalarMulAdd(a, b, c) ((SkScalar)(a) * (b) + (c))
187 #ifdef SK_SUPPORT_LEGACY_SCALAR_DIV 187 #define SkScalarDiv(a, b) ((SkScalar)(a) / (b))
188 #define SkScalarDiv(a, b) ((SkScalar)(a) / (b))
189 #endif
190 #define SkScalarMulDiv(a, b, c) ((SkScalar)(a) * (b) / (c)) 188 #define SkScalarMulDiv(a, b, c) ((SkScalar)(a) * (b) / (c))
191 #define SkScalarInvert(x) (SK_Scalar1 / (x)) 189 #define SkScalarInvert(x) (SK_Scalar1 / (x))
192 #define SkScalarFastInvert(x) (SK_Scalar1 / (x)) 190 #define SkScalarFastInvert(x) (SK_Scalar1 / (x))
193 #define SkScalarAve(a, b) (((a) + (b)) * SK_ScalarHalf) 191 #define SkScalarAve(a, b) (((a) + (b)) * SK_ScalarHalf)
194 #define SkScalarHalf(a) ((a) * SK_ScalarHalf) 192 #define SkScalarHalf(a) ((a) * SK_ScalarHalf)
195 193
196 #define SkDegreesToRadians(degrees) ((degrees) * (SK_ScalarPI / 180)) 194 #define SkDegreesToRadians(degrees) ((degrees) * (SK_ScalarPI / 180))
197 #define SkRadiansToDegrees(radians) ((radians) * (180 / SK_ScalarPI)) 195 #define SkRadiansToDegrees(radians) ((radians) * (180 / SK_ScalarPI))
198 196
199 static inline SkScalar SkMaxScalar(SkScalar a, SkScalar b) { return a > b ? a : b; } 197 static inline SkScalar SkMaxScalar(SkScalar a, SkScalar b) { return a > b ? a : b; }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 SkASSERT(n >= 0); 261 SkASSERT(n >= 0);
264 for (int i = 0; i < n; ++i) { 262 for (int i = 0; i < n; ++i) {
265 if (a[i] != b[i]) { 263 if (a[i] != b[i]) {
266 return false; 264 return false;
267 } 265 }
268 } 266 }
269 return true; 267 return true;
270 } 268 }
271 269
272 #endif 270 #endif
OLDNEW
« no previous file with comments | « include/core/SkPoint.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698