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

Side by Side Diff: tests/PathOpsTestCommon.cpp

Issue 1037953004: add conics to path ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: turn off pathops specific debuggging Created 5 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 | « tests/PathOpsTestCommon.h ('k') | tools/pathops_sorter.htm » ('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 "PathOpsTestCommon.h" 7 #include "PathOpsTestCommon.h"
8 #include "SkPathOpsBounds.h" 8 #include "SkPathOpsBounds.h"
9 #include "SkPathOpsConic.h"
9 #include "SkPathOpsCubic.h" 10 #include "SkPathOpsCubic.h"
10 #include "SkPathOpsLine.h" 11 #include "SkPathOpsLine.h"
11 #include "SkPathOpsQuad.h" 12 #include "SkPathOpsQuad.h"
12 #include "SkReduceOrder.h" 13 #include "SkReduceOrder.h"
13 #include "SkTSort.h" 14 #include "SkTSort.h"
14 15
15 static double calc_t_div(const SkDCubic& cubic, double precision, double start) { 16 static double calc_t_div(const SkDCubic& cubic, double precision, double start) {
16 const double adjust = sqrt(3.) / 36; 17 const double adjust = sqrt(3.) / 36;
17 SkDCubic sub; 18 SkDCubic sub;
18 const SkDCubic* cPtr; 19 const SkDCubic* cPtr;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 246 }
246 if (SkScalarIsNaN(bounds.fTop)) { 247 if (SkScalarIsNaN(bounds.fTop)) {
247 return false; 248 return false;
248 } 249 }
249 if (SkScalarIsNaN(bounds.fRight)) { 250 if (SkScalarIsNaN(bounds.fRight)) {
250 return false; 251 return false;
251 } 252 }
252 return !SkScalarIsNaN(bounds.fBottom); 253 return !SkScalarIsNaN(bounds.fBottom);
253 } 254 }
254 255
256 bool ValidConic(const SkDConic& conic) {
257 for (int index = 0; index < SkDConic::kPointCount; ++index) {
258 if (!ValidPoint(conic[index])) {
259 return false;
260 }
261 }
262 if (SkDoubleIsNaN(conic.fWeight)) {
263 return false;
264 }
265 return true;
266 }
267
255 bool ValidCubic(const SkDCubic& cubic) { 268 bool ValidCubic(const SkDCubic& cubic) {
256 for (int index = 0; index < 4; ++index) { 269 for (int index = 0; index < 4; ++index) {
257 if (!ValidPoint(cubic[index])) { 270 if (!ValidPoint(cubic[index])) {
258 return false; 271 return false;
259 } 272 }
260 } 273 }
261 return true; 274 return true;
262 } 275 }
263 276
264 bool ValidLine(const SkDLine& line) { 277 bool ValidLine(const SkDLine& line) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 310 }
298 return true; 311 return true;
299 } 312 }
300 313
301 bool ValidVector(const SkDVector& v) { 314 bool ValidVector(const SkDVector& v) {
302 if (SkDoubleIsNaN(v.fX)) { 315 if (SkDoubleIsNaN(v.fX)) {
303 return false; 316 return false;
304 } 317 }
305 return !SkDoubleIsNaN(v.fY); 318 return !SkDoubleIsNaN(v.fY);
306 } 319 }
OLDNEW
« no previous file with comments | « tests/PathOpsTestCommon.h ('k') | tools/pathops_sorter.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698