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

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

Issue 131103009: update pathops to circle sort (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable old test that still fails on linux 32 release Created 6 years, 8 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
« 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 void SkIntersections::append(const SkIntersections& i) { 10 void SkIntersections::append(const SkIntersections& i) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 fMax = 2; 145 fMax = 2;
146 return intersectRay(quad, line); 146 return intersectRay(quad, line);
147 } 147 }
148 148
149 void SkIntersections::quickRemoveOne(int index, int replace) { 149 void SkIntersections::quickRemoveOne(int index, int replace) {
150 if (index < replace) { 150 if (index < replace) {
151 fT[0][index] = fT[0][replace]; 151 fT[0][index] = fT[0][replace];
152 } 152 }
153 } 153 }
154 154
155 #if 0
156 void SkIntersections::remove(double one, double two, const SkDPoint& startPt,
157 const SkDPoint& endPt) {
158 for (int index = fUsed - 1; index >= 0; --index) {
159 if (!(fIsCoincident[0] & (1 << index)) && (between(one, fT[fSwap][index] , two)
160 || startPt.approximatelyEqual(fPt[index])
161 || endPt.approximatelyEqual(fPt[index]))) {
162 SkASSERT(fUsed > 0);
163 removeOne(index);
164 }
165 }
166 }
167 #endif
168
169 void SkIntersections::removeOne(int index) { 155 void SkIntersections::removeOne(int index) {
170 int remaining = --fUsed - index; 156 int remaining = --fUsed - index;
171 if (remaining <= 0) { 157 if (remaining <= 0) {
172 return; 158 return;
173 } 159 }
174 memmove(&fPt[index], &fPt[index + 1], sizeof(fPt[0]) * remaining); 160 memmove(&fPt[index], &fPt[index + 1], sizeof(fPt[0]) * remaining);
175 memmove(&fT[0][index], &fT[0][index + 1], sizeof(fT[0][0]) * remaining); 161 memmove(&fT[0][index], &fT[0][index + 1], sizeof(fT[0][0]) * remaining);
176 memmove(&fT[1][index], &fT[1][index + 1], sizeof(fT[1][0]) * remaining); 162 memmove(&fT[1][index], &fT[1][index + 1], sizeof(fT[1][0]) * remaining);
177 SkASSERT(fIsCoincident[0] == 0); 163 SkASSERT(fIsCoincident[0] == 0);
178 int coBit = fIsCoincident[0] & (1 << index); 164 int coBit = fIsCoincident[0] & (1 << index);
(...skipping 22 matching lines...) Expand all
201 quad.set(a); 187 quad.set(a);
202 return vertical(quad, top, bottom, x, flipped); 188 return vertical(quad, top, bottom, x, flipped);
203 } 189 }
204 190
205 int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bo ttom, 191 int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bo ttom,
206 SkScalar x, bool flipped) { 192 SkScalar x, bool flipped) {
207 SkDCubic cubic; 193 SkDCubic cubic;
208 cubic.set(a); 194 cubic.set(a);
209 return vertical(cubic, top, bottom, x, flipped); 195 return vertical(cubic, top, bottom, x, flipped);
210 } 196 }
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