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

Side by Side Diff: src/pathops/SkPathOpsTypes.h

Issue 19543005: turn off debugging printfs (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove unused code Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkPathOpsRect.cpp ('k') | src/pathops/SkPathOpsTypes.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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
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 #ifndef SkPathOpsTypes_DEFINED 7 #ifndef SkPathOpsTypes_DEFINED
8 #define SkPathOpsTypes_DEFINED 8 #define SkPathOpsTypes_DEFINED
9 9
10 #include <float.h> // for FLT_EPSILON 10 #include <float.h> // for FLT_EPSILON
11 #include <math.h> // for fabs, sqrt 11 #include <math.h> // for fabs, sqrt
12 12
13 #include "SkFloatingPoint.h" 13 #include "SkFloatingPoint.h"
14 #include "SkPath.h" 14 #include "SkPath.h"
15 #include "SkPathOps.h" 15 #include "SkPathOps.h"
16 #include "SkPathOpsDebug.h" 16 #include "SkPathOpsDebug.h"
17 #include "SkScalar.h" 17 #include "SkScalar.h"
18 18
19 enum SkPathOpsMask { 19 enum SkPathOpsMask {
20 kWinding_PathOpsMask = -1, 20 kWinding_PathOpsMask = -1,
21 kNo_PathOpsMask = 0, 21 kNo_PathOpsMask = 0,
22 kEvenOdd_PathOpsMask = 1 22 kEvenOdd_PathOpsMask = 1
23 }; 23 };
24 24
25 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values. 25 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values.
26 bool AlmostEqualUlps(float A, float B); 26 bool AlmostEqualUlps(float a, float b);
27 inline bool AlmostEqualUlps(double A, double B) { 27 inline bool AlmostEqualUlps(double a, double b) {
28 return AlmostEqualUlps(SkDoubleToScalar(A), SkDoubleToScalar(B)); 28 return AlmostEqualUlps(SkDoubleToScalar(a), SkDoubleToScalar(b));
29 } 29 }
30 30
31 bool RoughlyEqualUlps(float A, float B); 31 bool RoughlyEqualUlps(float a, float b);
32 inline bool RoughlyEqualUlps(double A, double B) { 32 inline bool RoughlyEqualUlps(double a, double b) {
33 return RoughlyEqualUlps(SkDoubleToScalar(A), SkDoubleToScalar(B)); 33 return RoughlyEqualUlps(SkDoubleToScalar(a), SkDoubleToScalar(b));
34 } 34 }
35 35
36 bool AlmostBetweenUlps(float a, float b, float c); 36 bool AlmostBetweenUlps(float a, float b, float c);
37 inline bool AlmostBetweenUlps(double A, double B, double C) { 37 inline bool AlmostBetweenUlps(double a, double b, double c) {
38 return AlmostBetweenUlps(SkDoubleToScalar(A), SkDoubleToScalar(B), SkDoubleT oScalar(C)); 38 return AlmostBetweenUlps(SkDoubleToScalar(a), SkDoubleToScalar(b), SkDoubleT oScalar(c));
39 }
40
41 int UlpsDistance(float a, float b);
42 inline int UlpsDistance(double a, double b) {
43 return UlpsDistance(SkDoubleToScalar(a), SkDoubleToScalar(b));
39 } 44 }
40 45
41 // FLT_EPSILON == 1.19209290E-07 == 1 / (2 ^ 23) 46 // FLT_EPSILON == 1.19209290E-07 == 1 / (2 ^ 23)
42 // DBL_EPSILON == 2.22045e-16 47 // DBL_EPSILON == 2.22045e-16
43 const double FLT_EPSILON_CUBED = FLT_EPSILON * FLT_EPSILON * FLT_EPSILON; 48 const double FLT_EPSILON_CUBED = FLT_EPSILON * FLT_EPSILON * FLT_EPSILON;
44 const double FLT_EPSILON_HALF = FLT_EPSILON / 2; 49 const double FLT_EPSILON_HALF = FLT_EPSILON / 2;
45 const double FLT_EPSILON_DOUBLE = FLT_EPSILON * 2; 50 const double FLT_EPSILON_DOUBLE = FLT_EPSILON * 2;
46 const double FLT_EPSILON_SQUARED = FLT_EPSILON * FLT_EPSILON; 51 const double FLT_EPSILON_SQUARED = FLT_EPSILON * FLT_EPSILON;
47 const double FLT_EPSILON_SQRT = sqrt(FLT_EPSILON); 52 const double FLT_EPSILON_SQRT = sqrt(FLT_EPSILON);
48 const double FLT_EPSILON_INVERSE = 1 / FLT_EPSILON; 53 const double FLT_EPSILON_INVERSE = 1 / FLT_EPSILON;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 */ 268 */
264 inline int SkDSideBit(double x) { 269 inline int SkDSideBit(double x) {
265 return 1 << SKDSide(x); 270 return 1 << SKDSide(x);
266 } 271 }
267 272
268 inline double SkPinT(double t) { 273 inline double SkPinT(double t) {
269 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 : t; 274 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 : t;
270 } 275 }
271 276
272 #endif 277 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsRect.cpp ('k') | src/pathops/SkPathOpsTypes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698