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

Side by Side Diff: src/pathops/SkPathOpsCommon.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/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsCubic.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 "SkOpEdgeBuilder.h" 7 #include "SkOpEdgeBuilder.h"
8 #include "SkPathOpsCommon.h" 8 #include "SkPathOpsCommon.h"
9 #include "SkPathWriter.h" 9 #include "SkPathWriter.h"
10 #include "SkTSort.h" 10 #include "SkTSort.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 *chase.insert(0) = span; 127 *chase.insert(0) = span;
128 #else 128 #else
129 *chase.append() = span; 129 *chase.append() = span;
130 #endif 130 #endif
131 return last->segment(); 131 return last->segment();
132 } 132 }
133 if (done == angles.count()) { 133 if (done == angles.count()) {
134 continue; 134 continue;
135 } 135 }
136 SkTDArray<SkOpAngle*> sorted; 136 SkTDArray<SkOpAngle*> sorted;
137 bool sortable = SkOpSegment::SortAngles(angles, &sorted); 137 bool sortable = SkOpSegment::SortAngles(angles, &sorted,
138 SkOpSegment::kMayBeUnordered_SortAngleKind);
138 int angleCount = sorted.count(); 139 int angleCount = sorted.count();
139 #if DEBUG_SORT 140 #if DEBUG_SORT
140 sorted[0]->segment()->debugShowSort(__FUNCTION__, sorted, 0, 0, 0); 141 sorted[0]->segment()->debugShowSort(__FUNCTION__, sorted, 0, 0, 0);
141 #endif 142 #endif
142 if (!sortable) { 143 if (!sortable) {
143 continue; 144 continue;
144 } 145 }
145 // find first angle, initialize winding to computed fWindSum 146 // find first angle, initialize winding to computed fWindSum
146 int firstIndex = -1; 147 int firstIndex = -1;
147 const SkOpAngle* angle; 148 const SkOpAngle* angle;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 575 }
575 } 576 }
576 } while (rIndex < count); 577 } while (rIndex < count);
577 #if DEBUG_ASSEMBLE 578 #if DEBUG_ASSEMBLE
578 for (rIndex = 0; rIndex < count; ++rIndex) { 579 for (rIndex = 0; rIndex < count; ++rIndex) {
579 SkASSERT(sLink[rIndex] == SK_MaxS32); 580 SkASSERT(sLink[rIndex] == SK_MaxS32);
580 SkASSERT(eLink[rIndex] == SK_MaxS32); 581 SkASSERT(eLink[rIndex] == SK_MaxS32);
581 } 582 }
582 #endif 583 #endif
583 } 584 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698