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

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

Issue 1611633002: Remove SkLerpXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove recent usages Created 4 years, 11 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 | « gyp/effects.gypi ('k') | include/effects/SkLerpXfermode.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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 // Scalar result version of above 213 // Scalar result version of above
214 static inline SkScalar SkScalarSignAsScalar(SkScalar x) { 214 static inline SkScalar SkScalarSignAsScalar(SkScalar x) {
215 return x < 0 ? -SK_Scalar1 : ((x > 0) ? SK_Scalar1 : 0); 215 return x < 0 ? -SK_Scalar1 : ((x > 0) ? SK_Scalar1 : 0);
216 } 216 }
217 217
218 #define SK_ScalarNearlyZero (SK_Scalar1 / (1 << 12)) 218 #define SK_ScalarNearlyZero (SK_Scalar1 / (1 << 12))
219 219
220 static inline bool SkScalarNearlyZero(SkScalar x, 220 static inline bool SkScalarNearlyZero(SkScalar x,
221 SkScalar tolerance = SK_ScalarNearlyZero) { 221 SkScalar tolerance = SK_ScalarNearlyZero) {
222 SkASSERT(tolerance >= 0); 222 SkASSERT(tolerance >= 0);
223 return SkScalarAbs(x) <= tolerance; 223 return SkScalarAbs(x) <= tolerance;
224 } 224 }
225 225
226 static inline bool SkScalarNearlyEqual(SkScalar x, SkScalar y, 226 static inline bool SkScalarNearlyEqual(SkScalar x, SkScalar y,
227 SkScalar tolerance = SK_ScalarNearlyZero) { 227 SkScalar tolerance = SK_ScalarNearlyZero) {
228 SkASSERT(tolerance >= 0); 228 SkASSERT(tolerance >= 0);
229 return SkScalarAbs(x-y) <= tolerance; 229 return SkScalarAbs(x-y) <= tolerance;
230 } 230 }
231 231
(...skipping 28 matching lines...) Expand all
260 SkASSERT(n >= 0); 260 SkASSERT(n >= 0);
261 for (int i = 0; i < n; ++i) { 261 for (int i = 0; i < n; ++i) {
262 if (a[i] != b[i]) { 262 if (a[i] != b[i]) {
263 return false; 263 return false;
264 } 264 }
265 } 265 }
266 return true; 266 return true;
267 } 267 }
268 268
269 #endif 269 #endif
OLDNEW
« no previous file with comments | « gyp/effects.gypi ('k') | include/effects/SkLerpXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698