| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkIntersections.h" | 8 #include "SkIntersections.h" |
| 9 #include "SkOpContour.h" | 9 #include "SkOpContour.h" |
| 10 #include "SkOpSegment.h" | 10 #include "SkOpSegment.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 shortQuad[0] = quad[0].asSkPoint(); | 411 shortQuad[0] = quad[0].asSkPoint(); |
| 412 shortQuad[1] = quad[1].asSkPoint(); | 412 shortQuad[1] = quad[1].asSkPoint(); |
| 413 shortQuad[2] = quad[2].asSkPoint(); | 413 shortQuad[2] = quad[2].asSkPoint(); |
| 414 contour->addQuad(shortQuad, allocator); | 414 contour->addQuad(shortQuad, allocator); |
| 415 } | 415 } |
| 416 | 416 |
| 417 static void testQuadAngles(skiatest::Reporter* reporter, const SkDQuad& quad1, c
onst SkDQuad& quad2, | 417 static void testQuadAngles(skiatest::Reporter* reporter, const SkDQuad& quad1, c
onst SkDQuad& quad2, |
| 418 int testNo, SkChunkAlloc* allocator) { | 418 int testNo, SkChunkAlloc* allocator) { |
| 419 SkPoint shortQuads[2][3]; | 419 SkPoint shortQuads[2][3]; |
| 420 | 420 |
| 421 SkOpContour contour; | 421 SkOpContourHead contour; |
| 422 SkOpGlobalState state(NULL SkDEBUGPARAMS(&contour)); | 422 SkOpGlobalState state(NULL, &contour); |
| 423 contour.init(&state, false, false); | 423 contour.init(&state, false, false); |
| 424 makeSegment(&contour, quad1, shortQuads[0], allocator); | 424 makeSegment(&contour, quad1, shortQuads[0], allocator); |
| 425 makeSegment(&contour, quad1, shortQuads[1], allocator); | 425 makeSegment(&contour, quad1, shortQuads[1], allocator); |
| 426 SkOpSegment* seg1 = contour.first(); | 426 SkOpSegment* seg1 = contour.first(); |
| 427 seg1->debugAddAngle(0, 1, allocator); | 427 seg1->debugAddAngle(0, 1, allocator); |
| 428 SkOpSegment* seg2 = seg1->next(); | 428 SkOpSegment* seg2 = seg1->next(); |
| 429 seg2->debugAddAngle(0, 1, allocator); | 429 seg2->debugAddAngle(0, 1, allocator); |
| 430 int realOverlap = PathOpsAngleTester::ConvexHullOverlaps(*seg1->debugLastAng
le(), | 430 int realOverlap = PathOpsAngleTester::ConvexHullOverlaps(*seg1->debugLastAng
le(), |
| 431 *seg2->debugLastAngle()); | 431 *seg2->debugLastAngle()); |
| 432 const SkDPoint& origin = quad1[0]; | 432 const SkDPoint& origin = quad1[0]; |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 step /= 2; | 854 step /= 2; |
| 855 } | 855 } |
| 856 #ifdef SK_DEBUG | 856 #ifdef SK_DEBUG |
| 857 // DumpQ(q1, q2, 999); | 857 // DumpQ(q1, q2, 999); |
| 858 #endif | 858 #endif |
| 859 } | 859 } |
| 860 if (gPathOpsAngleIdeasVerbose) { | 860 if (gPathOpsAngleIdeasVerbose) { |
| 861 SkDebugf("maxR=%1.9g\n", maxR); | 861 SkDebugf("maxR=%1.9g\n", maxR); |
| 862 } | 862 } |
| 863 } | 863 } |
| OLD | NEW |