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

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

Issue 131103009: update pathops to circle sort (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable old test that still fails on linux 32 release Created 6 years, 8 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/SkPathOpsLine.h ('k') | src/pathops/SkPathOpsOp.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 "SkPathOpsLine.h" 7 #include "SkPathOpsLine.h"
8 8
9 SkDLine SkDLine::subDivide(double t1, double t2) const { 9 SkDLine SkDLine::subDivide(double t1, double t2) const {
10 SkDVector delta = tangent(); 10 SkDVector delta = tangent();
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 double distSq = distU.fX * distU.fX + distU.fY * distU.fY; 182 double distSq = distU.fX * distU.fX + distU.fY * distU.fY;
183 double dist = sqrt(distSq); // OPTIMIZATION: can we compare against distSq i nstead ? 183 double dist = sqrt(distSq); // OPTIMIZATION: can we compare against distSq i nstead ?
184 double tiniest = SkTMin(SkTMin(x, top), bottom); 184 double tiniest = SkTMin(SkTMin(x, top), bottom);
185 double largest = SkTMax(SkTMax(x, top), bottom); 185 double largest = SkTMax(SkTMax(x, top), bottom);
186 largest = SkTMax(largest, -tiniest); 186 largest = SkTMax(largest, -tiniest);
187 if (!AlmostEqualUlps(largest, largest + dist)) { // is the dist within ULPS tolerance? 187 if (!AlmostEqualUlps(largest, largest + dist)) { // is the dist within ULPS tolerance?
188 return -1; 188 return -1;
189 } 189 }
190 return t; 190 return t;
191 } 191 }
192
193 #ifdef SK_DEBUG
194 void SkDLine::dump() {
195 SkDebugf("{{");
196 fPts[0].dump();
197 SkDebugf(", ");
198 fPts[1].dump();
199 SkDebugf("}}\n");
200 }
201 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsLine.h ('k') | src/pathops/SkPathOpsOp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698