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

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

Issue 489853002: copy points in array that may stretch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | 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 "SkOpContour.h" 8 #include "SkOpContour.h"
9 #include "SkOpSegment.h" 9 #include "SkOpSegment.h"
10 #include "SkPathWriter.h" 10 #include "SkPathWriter.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // if the following span exists (not past the end, non-zero winding) 244 // if the following span exists (not past the end, non-zero winding)
245 // connect the two edges 245 // connect the two edges
246 if (!fTs[tIndexStart].fWindValue) { 246 if (!fTs[tIndexStart].fWindValue) {
247 if (tIndexStart > 0 && fTs[tIndexStart - 1].fWindValue) { 247 if (tIndexStart > 0 && fTs[tIndexStart - 1].fWindValue) {
248 #if DEBUG_CONCIDENT 248 #if DEBUG_CONCIDENT
249 SkDebugf("%s 1 this=%d other=%d t [%d] %1.9g (%1.9g,%1.9g)\n", 249 SkDebugf("%s 1 this=%d other=%d t [%d] %1.9g (%1.9g,%1.9g)\n",
250 __FUNCTION__, fID, other->fID, tIndexStart - 1, 250 __FUNCTION__, fID, other->fID, tIndexStart - 1,
251 fTs[tIndexStart].fT, xyAtT(tIndexStart).fX, 251 fTs[tIndexStart].fT, xyAtT(tIndexStart).fX,
252 xyAtT(tIndexStart).fY); 252 xyAtT(tIndexStart).fY);
253 #endif 253 #endif
254 addTPair(fTs[tIndexStart].fT, other, other->fTs[oIndex].fT, false, 254 SkPoint copy = fTs[tIndexStart].fPt; // add t pair may move the poi nt array
255 fTs[tIndexStart].fPt); 255 addTPair(fTs[tIndexStart].fT, other, other->fTs[oIndex].fT, false, c opy);
256 } 256 }
257 if (nextT < 1 && fTs[tIndex].fWindValue) { 257 if (nextT < 1 && fTs[tIndex].fWindValue) {
258 #if DEBUG_CONCIDENT 258 #if DEBUG_CONCIDENT
259 SkDebugf("%s 2 this=%d other=%d t [%d] %1.9g (%1.9g,%1.9g)\n", 259 SkDebugf("%s 2 this=%d other=%d t [%d] %1.9g (%1.9g,%1.9g)\n",
260 __FUNCTION__, fID, other->fID, tIndex, 260 __FUNCTION__, fID, other->fID, tIndex,
261 fTs[tIndex].fT, xyAtT(tIndex).fX, 261 fTs[tIndex].fT, xyAtT(tIndex).fX,
262 xyAtT(tIndex).fY); 262 xyAtT(tIndex).fY);
263 #endif 263 #endif
264 addTPair(fTs[tIndex].fT, other, other->fTs[oIndexStart].fT, false, f Ts[tIndex].fPt); 264 SkPoint copy = fTs[tIndex].fPt; // add t pair may move the point ar ray
265 addTPair(fTs[tIndex].fT, other, other->fTs[oIndexStart].fT, false, c opy);
265 } 266 }
266 } else { 267 } else {
267 SkASSERT(!other->fTs[oIndexStart].fWindValue); 268 SkASSERT(!other->fTs[oIndexStart].fWindValue);
268 if (oIndexStart > 0 && other->fTs[oIndexStart - 1].fWindValue) { 269 if (oIndexStart > 0 && other->fTs[oIndexStart - 1].fWindValue) {
269 #if DEBUG_CONCIDENT 270 #if DEBUG_CONCIDENT
270 SkDebugf("%s 3 this=%d other=%d t [%d] %1.9g (%1.9g,%1.9g)\n", 271 SkDebugf("%s 3 this=%d other=%d t [%d] %1.9g (%1.9g,%1.9g)\n",
271 __FUNCTION__, fID, other->fID, oIndexStart - 1, 272 __FUNCTION__, fID, other->fID, oIndexStart - 1,
272 other->fTs[oIndexStart].fT, other->xyAtT(oIndexStart).fX, 273 other->fTs[oIndexStart].fT, other->xyAtT(oIndexStart).fX,
273 other->xyAtT(oIndexStart).fY); 274 other->xyAtT(oIndexStart).fY);
274 other->debugAddTPair(other->fTs[oIndexStart].fT, *this, fTs[tIndex]. fT); 275 other->debugAddTPair(other->fTs[oIndexStart].fT, *this, fTs[tIndex]. fT);
(...skipping 4117 matching lines...) Expand 10 before | Expand all | Expand 10 after
4392 SkASSERT(span->fWindValue > 0 || span->fOppValue != 0); 4393 SkASSERT(span->fWindValue > 0 || span->fOppValue != 0);
4393 span->fWindValue = 0; 4394 span->fWindValue = 0;
4394 span->fOppValue = 0; 4395 span->fOppValue = 0;
4395 if (span->fTiny || span->fSmall) { 4396 if (span->fTiny || span->fSmall) {
4396 return; 4397 return;
4397 } 4398 }
4398 SkASSERT(!span->fDone); 4399 SkASSERT(!span->fDone);
4399 span->fDone = true; 4400 span->fDone = true;
4400 ++fDoneSpans; 4401 ++fDoneSpans;
4401 } 4402 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698