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

Side by Side Diff: tests/PathOpsCubicIntersectionTest.cpp

Issue 19374003: harden and speed up path op unit tests (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rename threaded to single 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 | « tests/PathOpsBoundsTest.cpp ('k') | tests/PathOpsCubicLineIntersectionTest.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 "PathOpsCubicIntersectionTestData.h" 7 #include "PathOpsCubicIntersectionTestData.h"
8 #include "PathOpsTestCommon.h" 8 #include "PathOpsTestCommon.h"
9 #include "SkIntersections.h" 9 #include "SkIntersections.h"
10 #include "SkPathOpsRect.h" 10 #include "SkPathOpsRect.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 {{{0, 6}, {1, 2}, {1, 0}, {1, 0}}}, 261 {{{0, 6}, {1, 2}, {1, 0}, {1, 0}}},
262 {{{0, 1}, {0, 1}, {6, 0}, {2, 1}}}, 262 {{{0, 1}, {0, 1}, {6, 0}, {2, 1}}},
263 263
264 {{{0, 2}, {0, 1}, {3, 0}, {1, 0}}}, 264 {{{0, 2}, {0, 1}, {3, 0}, {1, 0}}},
265 {{{0, 3}, {0, 1}, {2, 0}, {1, 0}}}, 265 {{{0, 3}, {0, 1}, {2, 0}, {1, 0}}},
266 }; 266 };
267 267
268 const size_t newTestSetCount = SK_ARRAY_COUNT(newTestSet); 268 const size_t newTestSetCount = SK_ARRAY_COUNT(newTestSet);
269 269
270 static void oneOff(skiatest::Reporter* reporter, const SkDCubic& cubic1, const S kDCubic& cubic2) { 270 static void oneOff(skiatest::Reporter* reporter, const SkDCubic& cubic1, const S kDCubic& cubic2) {
271 SkASSERT(ValidCubic(cubic1));
272 SkASSERT(ValidCubic(cubic2));
271 #if ONE_OFF_DEBUG 273 #if ONE_OFF_DEBUG
272 SkDebugf("computed quadratics given\n"); 274 SkDebugf("computed quadratics given\n");
273 SkDebugf(" {{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n" , 275 SkDebugf(" {{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n" ,
274 cubic1[0].fX, cubic1[0].fY, cubic1[1].fX, cubic1[1].fY, 276 cubic1[0].fX, cubic1[0].fY, cubic1[1].fX, cubic1[1].fY,
275 cubic1[2].fX, cubic1[2].fY, cubic1[3].fX, cubic1[3].fY); 277 cubic1[2].fX, cubic1[2].fY, cubic1[3].fX, cubic1[3].fY);
276 SkDebugf(" {{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n" , 278 SkDebugf(" {{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}},\n" ,
277 cubic2[0].fX, cubic2[0].fY, cubic2[1].fX, cubic2[1].fY, 279 cubic2[0].fX, cubic2[0].fY, cubic2[1].fX, cubic2[1].fY,
278 cubic2[2].fX, cubic2[2].fY, cubic2[3].fX, cubic2[3].fY); 280 cubic2[2].fX, cubic2[2].fY, cubic2[3].fX, cubic2[3].fY);
279 #endif 281 #endif
280 SkTArray<SkDQuad, true> quads1; 282 SkTArray<SkDQuad, true> quads1;
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 cubicIntersectionSelfTest(reporter); 554 cubicIntersectionSelfTest(reporter);
553 standardTestCases(reporter); 555 standardTestCases(reporter);
554 if (false) CubicIntersection_IntersectionFinder(); 556 if (false) CubicIntersection_IntersectionFinder();
555 if (false) CubicIntersection_RandTest(reporter); 557 if (false) CubicIntersection_RandTest(reporter);
556 } 558 }
557 559
558 #include "TestClassDef.h" 560 #include "TestClassDef.h"
559 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest) 561 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest)
560 562
561 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionOneOffTest) 563 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionOneOffTest)
OLDNEW
« no previous file with comments | « tests/PathOpsBoundsTest.cpp ('k') | tests/PathOpsCubicLineIntersectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698