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

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

Issue 2111473004: fix asan bug triggered by pathops fuzz tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 #ifndef SkOpSegment_DEFINE 7 #ifndef SkOpSegment_DEFINE
8 #define SkOpSegment_DEFINE 8 #define SkOpSegment_DEFINE
9 9
10 #include "SkOpAngle.h" 10 #include "SkOpAngle.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 fPrev = prev; 330 fPrev = prev;
331 } 331 }
332 332
333 void setVisited() { 333 void setVisited() {
334 fVisited = true; 334 fVisited = true;
335 } 335 }
336 336
337 void setUpWinding(SkOpSpanBase* start, SkOpSpanBase* end, int* maxWinding, i nt* sumWinding) { 337 void setUpWinding(SkOpSpanBase* start, SkOpSpanBase* end, int* maxWinding, i nt* sumWinding) {
338 int deltaSum = SpanSign(start, end); 338 int deltaSum = SpanSign(start, end);
339 *maxWinding = *sumWinding; 339 *maxWinding = *sumWinding;
340 if (*sumWinding == SK_MinS32) {
dogben 2016/06/29 20:46:17 It appears that SpanSign can return a value > 1 if
341 return;
342 }
340 *sumWinding -= deltaSum; 343 *sumWinding -= deltaSum;
341 } 344 }
342 345
343 void setUpWindings(SkOpSpanBase* start, SkOpSpanBase* end, int* sumMiWinding , 346 void setUpWindings(SkOpSpanBase* start, SkOpSpanBase* end, int* sumMiWinding ,
344 int* maxWinding, int* sumWinding); 347 int* maxWinding, int* sumWinding);
345 void setUpWindings(SkOpSpanBase* start, SkOpSpanBase* end, int* sumMiWinding , int* sumSuWinding, 348 void setUpWindings(SkOpSpanBase* start, SkOpSpanBase* end, int* sumMiWinding , int* sumSuWinding,
346 int* maxWinding, int* sumWinding, int* oppMaxWinding, int * oppSumWinding); 349 int* maxWinding, int* sumWinding, int* oppMaxWinding, int * oppSumWinding);
347 void sortAngles(); 350 void sortAngles();
348 351
349 static int SpanSign(const SkOpSpanBase* start, const SkOpSpanBase* end) { 352 static int SpanSign(const SkOpSpanBase* start, const SkOpSpanBase* end) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 SkPathOpsBounds fBounds; // tight bounds 419 SkPathOpsBounds fBounds; // tight bounds
417 SkScalar fWeight; 420 SkScalar fWeight;
418 int fCount; // number of spans (one for a non-intersecting segment) 421 int fCount; // number of spans (one for a non-intersecting segment)
419 int fDoneCount; // number of processed spans (zero initially) 422 int fDoneCount; // number of processed spans (zero initially)
420 SkPath::Verb fVerb; 423 SkPath::Verb fVerb;
421 bool fVisited; // used by missing coincidence check 424 bool fVisited; // used by missing coincidence check
422 SkDEBUGCODE(int fID); 425 SkDEBUGCODE(int fID);
423 }; 426 };
424 427
425 #endif 428 #endif
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