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/SkPathOpsTSect.h

Issue 2018513003: fix security bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove extra spaces Created 4 years, 7 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 | tests/PathOpsExtendedTest.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 2014 Google Inc. 2 * Copyright 2014 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 SkPathOpsTSect_DEFINED 7 #ifndef SkPathOpsTSect_DEFINED
8 #define SkPathOpsTSect_DEFINED 8 #define SkPathOpsTSect_DEFINED
9 9
10 #include "SkChunkAlloc.h" 10 #include "SkChunkAlloc.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 SkASSERT(ptsInCommon); 505 SkASSERT(ptsInCommon);
506 return 2; 506 return 2;
507 } 507 }
508 bool linear; 508 bool linear;
509 if (fPart.hullIntersects(opp->fPart, &linear)) { 509 if (fPart.hullIntersects(opp->fPart, &linear)) {
510 if (!linear) { // check set true if linear 510 if (!linear) { // check set true if linear
511 return 1; 511 return 1;
512 } 512 }
513 fIsLinear = true; 513 fIsLinear = true;
514 fIsLine = fPart.controlsInside(); 514 fIsLine = fPart.controlsInside();
515 return ptsInCommon ? 2 : -1; 515 return ptsInCommon ? 1 : -1;
516 } else { // hull is not linear; check set true if intersected at the end po ints 516 } else { // hull is not linear; check set true if intersected at the end po ints
517 return ((int) ptsInCommon) << 1; // 0 or 2 517 return ((int) ptsInCommon) << 1; // 0 or 2
518 } 518 }
519 return 0; 519 return 0;
520 } 520 }
521 521
522 // OPTIMIZE ? If at_most_end_pts_in_common detects that one quad is near linear, 522 // OPTIMIZE ? If at_most_end_pts_in_common detects that one quad is near linear,
523 // use line intersection to guess a better split than 0.5 523 // use line intersection to guess a better split than 0.5
524 // OPTIMIZE Once at_most_end_pts_in_common detects linear, mark span so all futu re splits are linear 524 // OPTIMIZE Once at_most_end_pts_in_common detects linear, mark span so all futu re splits are linear
525 template<typename TCurve, typename OppCurve> 525 template<typename TCurve, typename OppCurve>
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 --last; 2238 --last;
2239 } else { 2239 } else {
2240 intersections->setCoincident(index++); 2240 intersections->setCoincident(index++);
2241 } 2241 }
2242 intersections->setCoincident(index); 2242 intersections->setCoincident(index);
2243 } 2243 }
2244 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); 2244 SkASSERT(intersections->used() <= TCurve::kMaxIntersections);
2245 } 2245 }
2246 2246
2247 #endif 2247 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/PathOpsExtendedTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698