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

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

Issue 686843002: Revert of harden pathops for pathological test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « src/pathops/SkPathOpsPoint.h ('k') | src/pathops/SkReduceOrder.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
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 inline bool approximately_zero_sqrt(double x) { 136 inline bool approximately_zero_sqrt(double x) {
137 return fabs(x) < FLT_EPSILON_SQRT; 137 return fabs(x) < FLT_EPSILON_SQRT;
138 } 138 }
139 139
140 inline bool roughly_zero(double x) { 140 inline bool roughly_zero(double x) {
141 return fabs(x) < ROUGH_EPSILON; 141 return fabs(x) < ROUGH_EPSILON;
142 } 142 }
143 143
144 #if 0 // unused for now
145 inline bool way_roughly_zero(double x) {
146 return fabs(x) < WAY_ROUGH_EPSILON;
147 }
148 #endif
149
150 inline bool approximately_zero_inverse(double x) { 144 inline bool approximately_zero_inverse(double x) {
151 return fabs(x) > FLT_EPSILON_INVERSE; 145 return fabs(x) > FLT_EPSILON_INVERSE;
152 } 146 }
153 147
154 // OPTIMIZATION: if called multiple times with the same denom, we want to pass 1 /y instead 148 // OPTIMIZATION: if called multiple times with the same denom, we want to pass 1 /y instead
155 inline bool approximately_zero_when_compared_to(double x, double y) { 149 inline bool approximately_zero_when_compared_to(double x, double y) {
156 return x == 0 || fabs(x) < fabs(y * FLT_EPSILON); 150 return x == 0 || fabs(x) < fabs(y * FLT_EPSILON);
157 } 151 }
158 152
159 // Use this for comparing Ts in the range of 0 to 1. For general numbers (larger and smaller) use 153 // Use this for comparing Ts in the range of 0 to 1. For general numbers (larger and smaller) use
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 */ 371 */
378 inline int SkDSideBit(double x) { 372 inline int SkDSideBit(double x) {
379 return 1 << SKDSide(x); 373 return 1 << SKDSide(x);
380 } 374 }
381 375
382 inline double SkPinT(double t) { 376 inline double SkPinT(double t) {
383 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 : t; 377 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 : t;
384 } 378 }
385 379
386 #endif 380 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsPoint.h ('k') | src/pathops/SkReduceOrder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698