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

Side by Side Diff: src/core/SkPath.cpp

Issue 2465253008: Fix quad convexity with only one backward dir (Closed)
Patch Set: Created 4 years, 1 month 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/PathTest.cpp » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 <cmath> 8 #include <cmath>
9 #include "SkBuffer.h" 9 #include "SkBuffer.h"
10 #include "SkCubicClipper.h" 10 #include "SkCubicClipper.h"
(...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 } else if (dir != fExpectedDir) { 2398 } else if (dir != fExpectedDir) {
2399 fConvexity = SkPath::kConcave_Convexity; 2399 fConvexity = SkPath::kConcave_Convexity;
2400 fFirstDirection = SkPathPriv::kUnknown_FirstDirection; 2400 fFirstDirection = SkPathPriv::kUnknown_FirstDirection;
2401 } 2401 }
2402 fLastVec = vec; 2402 fLastVec = vec;
2403 break; 2403 break;
2404 case kStraight_DirChange: 2404 case kStraight_DirChange:
2405 break; 2405 break;
2406 case kBackwards_DirChange: 2406 case kBackwards_DirChange:
2407 if (fIsCurve) { 2407 if (fIsCurve) {
2408 fConvexity = SkPath::kConcave_Convexity; 2408 // If any of the subsequent dir is non-backward, it'll be co ncave.
2409 fFirstDirection = SkPathPriv::kUnknown_FirstDirection; 2409 // Otherwise, it's still convex.
2410 fExpectedDir = dir;
2410 } 2411 }
2411 fLastVec = vec; 2412 fLastVec = vec;
2412 break; 2413 break;
2413 case kInvalid_DirChange: 2414 case kInvalid_DirChange:
2414 SkFAIL("Use of invalid direction change flag"); 2415 SkFAIL("Use of invalid direction change flag");
2415 break; 2416 break;
2416 } 2417 }
2417 } 2418 }
2418 2419
2419 SkPoint fPriorPt; 2420 SkPoint fPriorPt;
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
3390 path->arcTo(oval, startAngle, 180.f, false); 3391 path->arcTo(oval, startAngle, 180.f, false);
3391 startAngle += 180.f; 3392 startAngle += 180.f;
3392 forceMoveTo = false; 3393 forceMoveTo = false;
3393 sweepAngle -= 360.f; 3394 sweepAngle -= 360.f;
3394 } 3395 }
3395 path->arcTo(oval, startAngle, sweepAngle, forceMoveTo); 3396 path->arcTo(oval, startAngle, sweepAngle, forceMoveTo);
3396 if (useCenter) { 3397 if (useCenter) {
3397 path->close(); 3398 path->close();
3398 } 3399 }
3399 } 3400 }
OLDNEW
« no previous file with comments | « no previous file | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698