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

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

Issue 2046563007: fix null check bugs found by µmix static analyzer (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | src/ports/SkFontMgr_win_dw.cpp » ('j') | src/ports/SkFontMgr_win_dw.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 // given a prospective edge, compute its initial winding by projecting a ray 8 // given a prospective edge, compute its initial winding by projecting a ray
9 // if the ray hits another edge 9 // if the ray hits another edge
10 // if the edge doesn't have a winding yet, hop up to that edge and start ove r 10 // if the edge doesn't have a winding yet, hop up to that edge and start ove r
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 int wind = 0; 282 int wind = 0;
283 int oppWind = 0; 283 int oppWind = 0;
284 for (int index = 0; index < count; ++index) { 284 for (int index = 0; index < count; ++index) {
285 hit = sorted[index]; 285 hit = sorted[index];
286 if (!hit->fValid) { 286 if (!hit->fValid) {
287 return false; 287 return false;
288 } 288 }
289 bool ccw = ccw_dxdy(hit->fSlope, dir); 289 bool ccw = ccw_dxdy(hit->fSlope, dir);
290 // SkASSERT(!approximately_zero(hit->fT) || !hit->fValid); 290 // SkASSERT(!approximately_zero(hit->fT) || !hit->fValid);
291 SkOpSpan* span = hit->fSpan; 291 SkOpSpan* span = hit->fSpan;
292 SkOpSegment* hitSegment = span->segment();
293 if (!span) { 292 if (!span) {
294 return false; 293 return false;
295 } 294 }
295 SkOpSegment* hitSegment = span->segment();
296 if (span->windValue() == 0 && span->oppValue() == 0) { 296 if (span->windValue() == 0 && span->oppValue() == 0) {
297 continue; 297 continue;
298 } 298 }
299 if (last && SkDPoint::ApproximatelyEqual(*last, hit->fPt)) { 299 if (last && SkDPoint::ApproximatelyEqual(*last, hit->fPt)) {
300 return false; 300 return false;
301 } 301 }
302 if (index < count - 1) { 302 if (index < count - 1) {
303 const SkPoint& next = sorted[index + 1]->fPt; 303 const SkPoint& next = sorted[index + 1]->fPt;
304 if (SkDPoint::ApproximatelyEqual(next, hit->fPt)) { 304 if (SkDPoint::ApproximatelyEqual(next, hit->fPt)) {
305 return false; 305 return false;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 continue; 398 continue;
399 } 399 }
400 SkOpSpan* result = contour->findSortableTop(contourHead); 400 SkOpSpan* result = contour->findSortableTop(contourHead);
401 if (result) { 401 if (result) {
402 return result; 402 return result;
403 } 403 }
404 } while ((contour = contour->next())); 404 } while ((contour = contour->next()));
405 } 405 }
406 return nullptr; 406 return nullptr;
407 } 407 }
OLDNEW
« no previous file with comments | « no previous file | src/ports/SkFontMgr_win_dw.cpp » ('j') | src/ports/SkFontMgr_win_dw.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698