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

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

Issue 24810002: Yet another attempt to fix quadratic circle approximation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added GMs to ignore file Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBuffer.h" 10 #include "SkBuffer.h"
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 } while (start == stop); 1223 } while (start == stop);
1224 } 1224 }
1225 } 1225 }
1226 1226
1227 SkMatrix matrix; 1227 SkMatrix matrix;
1228 1228
1229 matrix.setScale(SkScalarHalf(oval.width()), SkScalarHalf(oval.height())); 1229 matrix.setScale(SkScalarHalf(oval.width()), SkScalarHalf(oval.height()));
1230 matrix.postTranslate(oval.centerX(), oval.centerY()); 1230 matrix.postTranslate(oval.centerX(), oval.centerY());
1231 1231
1232 return SkBuildQuadArc(start, stop, 1232 return SkBuildQuadArc(start, stop,
1233 sweepAngle > 0 ? kCW_SkRotationDirection : kCCW_SkRotationDirection, 1233 sweepAngle > 0 ? kCW_SkRotationDirection :
1234 kCCW_SkRotationDirection,
1234 &matrix, pts); 1235 &matrix, pts);
1235 } 1236 }
1236 1237
1237 void SkPath::arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, 1238 void SkPath::arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle,
1238 bool forceMoveTo) { 1239 bool forceMoveTo) {
1239 if (oval.width() < 0 || oval.height() < 0) { 1240 if (oval.width() < 0 || oval.height() < 0) {
1240 return; 1241 return;
1241 } 1242 }
1242 1243
1243 SkPoint pts[kSkBuildQuadArcStorage]; 1244 SkPoint pts[kSkBuildQuadArcStorage];
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 switch (this->getFillType()) { 2930 switch (this->getFillType()) {
2930 case SkPath::kEvenOdd_FillType: 2931 case SkPath::kEvenOdd_FillType:
2931 case SkPath::kInverseEvenOdd_FillType: 2932 case SkPath::kInverseEvenOdd_FillType:
2932 w &= 1; 2933 w &= 1;
2933 break; 2934 break;
2934 default: 2935 default:
2935 break; 2936 break;
2936 } 2937 }
2937 return SkToBool(w); 2938 return SkToBool(w);
2938 } 2939 }
OLDNEW
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698