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

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

Issue 1182493015: pathops coincident fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: all tests (including extended) work Created 5 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
« no previous file with comments | « src/pathops/SkPathOpsTypes.h ('k') | src/ports/SkDebug_win.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 #include "SkFloatBits.h" 7 #include "SkFloatBits.h"
8 #include "SkOpCoincidence.h"
8 #include "SkPathOpsTypes.h" 9 #include "SkPathOpsTypes.h"
9 10
10 static bool arguments_denormalized(float a, float b, int epsilon) { 11 static bool arguments_denormalized(float a, float b, int epsilon) {
11 float denormalizedCheck = FLT_EPSILON * epsilon / 2; 12 float denormalizedCheck = FLT_EPSILON * epsilon / 2;
12 return fabsf(a) <= denormalizedCheck && fabsf(b) <= denormalizedCheck; 13 return fabsf(a) <= denormalizedCheck && fabsf(b) <= denormalizedCheck;
13 } 14 }
14 15
15 // from http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-num bers-2012-edition/ 16 // from http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-num bers-2012-edition/
16 // FIXME: move to SkFloatBits.h 17 // FIXME: move to SkFloatBits.h
17 static bool equal_ulps(float a, float b, int epsilon, int depsilon) { 18 static bool equal_ulps(float a, float b, int epsilon, int depsilon) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 double SkDCubeRoot(double x) { 192 double SkDCubeRoot(double x) {
192 if (approximately_zero_cubed(x)) { 193 if (approximately_zero_cubed(x)) {
193 return 0; 194 return 0;
194 } 195 }
195 double result = halley_cbrt3d(fabs(x)); 196 double result = halley_cbrt3d(fabs(x));
196 if (x < 0) { 197 if (x < 0) {
197 result = -result; 198 result = -result;
198 } 199 }
199 return result; 200 return result;
200 } 201 }
202
203 SkOpGlobalState::SkOpGlobalState(SkOpCoincidence* coincidence, SkOpContourHead* head)
204 : fCoincidence(coincidence)
205 , fContourHead(head)
206 , fNested(0)
207 , fWindingFailed(false)
208 , fAngleCoincidence(false)
209 , fPhase(kIntersecting)
210 SkDEBUGPARAMS(fAngleID(0))
211 SkDEBUGPARAMS(fContourID(0))
212 SkDEBUGPARAMS(fPtTID(0))
213 SkDEBUGPARAMS(fSegmentID(0))
214 SkDEBUGPARAMS(fSpanID(0)) {
215 if (coincidence) {
216 coincidence->debugSetGlobalState(this);
217 }
218 }
219
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsTypes.h ('k') | src/ports/SkDebug_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698