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

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

Issue 23542056: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: verbose + mutex around file number access Created 7 years, 2 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 | « src/pathops/SkDQuadIntersection.cpp ('k') | src/pathops/SkIntersectionHelper.h » ('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 "SkIntersections.h" 7 #include "SkIntersections.h"
8 #include "SkPathOpsLine.h" 8 #include "SkPathOpsLine.h"
9 #include "SkPathOpsQuad.h" 9 #include "SkPathOpsQuad.h"
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 enum PinTPoint { 92 enum PinTPoint {
93 kPointUninitialized, 93 kPointUninitialized,
94 kPointInitialized 94 kPointInitialized
95 }; 95 };
96 96
97 LineQuadraticIntersections(const SkDQuad& q, const SkDLine& l, SkIntersectio ns* i) 97 LineQuadraticIntersections(const SkDQuad& q, const SkDLine& l, SkIntersectio ns* i)
98 : fQuad(q) 98 : fQuad(q)
99 , fLine(l) 99 , fLine(l)
100 , fIntersections(i) 100 , fIntersections(i)
101 , fAllowNear(true) { 101 , fAllowNear(true) {
102 i->setMax(2);
102 } 103 }
103 104
104 void allowNear(bool allow) { 105 void allowNear(bool allow) {
105 fAllowNear = allow; 106 fAllowNear = allow;
106 } 107 }
107 108
108 int intersectRay(double roots[2]) { 109 int intersectRay(double roots[2]) {
109 /* 110 /*
110 solve by rotating line+quad so line is horizontal, then finding the root s 111 solve by rotating line+quad so line is horizontal, then finding the root s
111 set up matrix to rotate quad to x-axis 112 set up matrix to rotate quad to x-axis
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 } 405 }
405 406
406 int SkIntersections::intersectRay(const SkDQuad& quad, const SkDLine& line) { 407 int SkIntersections::intersectRay(const SkDQuad& quad, const SkDLine& line) {
407 LineQuadraticIntersections q(quad, line, this); 408 LineQuadraticIntersections q(quad, line, this);
408 fUsed = q.intersectRay(fT[0]); 409 fUsed = q.intersectRay(fT[0]);
409 for (int index = 0; index < fUsed; ++index) { 410 for (int index = 0; index < fUsed; ++index) {
410 fPt[index] = quad.ptAtT(fT[0][index]); 411 fPt[index] = quad.ptAtT(fT[0][index]);
411 } 412 }
412 return fUsed; 413 return fUsed;
413 } 414 }
OLDNEW
« no previous file with comments | « src/pathops/SkDQuadIntersection.cpp ('k') | src/pathops/SkIntersectionHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698