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

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

Issue 1311583005: Add special case circle blur for Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no-GPU build Created 5 years, 3 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/SkRRect.h ('k') | src/core/SkColor.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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
232 /** Linearly interpolate between A and B, based on t. 232 /** Linearly interpolate between A and B, based on t.
233 If t is 0, return A 233 If t is 0, return A
234 If t is 1, return B 234 If t is 1, return B
235 else interpolate. 235 else interpolate.
236 t must be [0..SK_Scalar1] 236 t must be [0..SK_Scalar1]
237 */ 237 */
(...skipping 22 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 | « include/core/SkRRect.h ('k') | src/core/SkColor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698