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

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

Issue 15338003: path ops -- rewrite angle sort (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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/SkIntersections.h ('k') | src/pathops/SkLineParameters.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 7
8 #include "SkIntersections.h" 8 #include "SkIntersections.h"
9 9
10 int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkS calar, bool) = { 10 int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkS calar, bool) = {
11 NULL, 11 NULL,
12 &SkIntersections::verticalLine, 12 &SkIntersections::verticalLine,
13 &SkIntersections::verticalQuad, 13 &SkIntersections::verticalQuad,
14 &SkIntersections::verticalCubic 14 &SkIntersections::verticalCubic
15 }; 15 };
16 16
17 int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine&) = { 17 int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine&) = {
18 NULL, 18 NULL,
19 NULL, 19 NULL,
20 &SkIntersections::quadRay, 20 &SkIntersections::quadRay,
21 &SkIntersections::cubicRay 21 &SkIntersections::cubicRay
22 }; 22 };
23 23
24 int SkIntersections::coincidentUsed() const { 24 int SkIntersections::coincidentUsed() const {
25 if (!fIsCoincident[0]) { 25 if (!fIsCoincident[0]) {
26 SkASSERT(!fIsCoincident[0]); 26 SkASSERT(!fIsCoincident[1]);
27 return 0; 27 return 0;
28 } 28 }
29 int count = 0; 29 int count = 0;
30 SkDEBUGCODE(int count2 = 0;) 30 SkDEBUGCODE(int count2 = 0;)
31 for (int index = 0; index < fUsed; ++index) { 31 for (int index = 0; index < fUsed; ++index) {
32 if (fIsCoincident[0] & (1 << index)) { 32 if (fIsCoincident[0] & (1 << index)) {
33 ++count; 33 ++count;
34 } 34 }
35 #ifdef SK_DEBUG 35 #ifdef SK_DEBUG
36 if (fIsCoincident[1] & (1 << index)) { 36 if (fIsCoincident[1] & (1 << index)) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 quad.set(a); 256 quad.set(a);
257 return vertical(quad, top, bottom, x, flipped); 257 return vertical(quad, top, bottom, x, flipped);
258 } 258 }
259 259
260 int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bo ttom, 260 int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bo ttom,
261 SkScalar x, bool flipped) { 261 SkScalar x, bool flipped) {
262 SkDCubic cubic; 262 SkDCubic cubic;
263 cubic.set(a); 263 cubic.set(a);
264 return vertical(cubic, top, bottom, x, flipped); 264 return vertical(cubic, top, bottom, x, flipped);
265 } 265 }
OLDNEW
« no previous file with comments | « src/pathops/SkIntersections.h ('k') | src/pathops/SkLineParameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698