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

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

Issue 1163843003: don't square error term twice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | 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 2008 The Android Open Source Project 2 * Copyright 2008 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 "SkStrokerPriv.h" 8 #include "SkStrokerPriv.h"
9 #include "SkGeometry.h" 9 #include "SkGeometry.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 1032
1033 bool SkPathStroker::cubicStroke(const SkPoint cubic[4], SkQuadConstruct* quadPts ) { 1033 bool SkPathStroker::cubicStroke(const SkPoint cubic[4], SkQuadConstruct* quadPts ) {
1034 if (!fFoundTangents) { 1034 if (!fFoundTangents) {
1035 ResultType resultType = this->tangentsMeet(cubic, quadPts); 1035 ResultType resultType = this->tangentsMeet(cubic, quadPts);
1036 if (kQuad_ResultType != resultType) { 1036 if (kQuad_ResultType != resultType) {
1037 if (kNormalError_ResultType == resultType) { 1037 if (kNormalError_ResultType == resultType) {
1038 return false; 1038 return false;
1039 } 1039 }
1040 if ((kDegenerate_ResultType == resultType 1040 if ((kDegenerate_ResultType == resultType
1041 || points_within_dist(quadPts->fQuad[0], quadPts->fQuad[2], 1041 || points_within_dist(quadPts->fQuad[0], quadPts->fQuad[2],
1042 fInvResScaleSquared)) && cubicMidOnLine(cubic, quadPts)) { 1042 fInvResScale)) && cubicMidOnLine(cubic, quadPts)) {
1043 addDegenerateLine(quadPts); 1043 addDegenerateLine(quadPts);
1044 return true; 1044 return true;
1045 } 1045 }
1046 } else { 1046 } else {
1047 fFoundTangents = true; 1047 fFoundTangents = true;
1048 } 1048 }
1049 } 1049 }
1050 if (fFoundTangents) { 1050 if (fFoundTangents) {
1051 ResultType resultType = this->compareQuadCubic(cubic, quadPts); 1051 ResultType resultType = this->compareQuadCubic(cubic, quadPts);
1052 if (kQuad_ResultType == resultType) { 1052 if (kQuad_ResultType == resultType) {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 default: 1450 default:
1451 break; 1451 break;
1452 } 1452 }
1453 1453
1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { 1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) {
1455 r = rect; 1455 r = rect;
1456 r.inset(radius, radius); 1456 r.inset(radius, radius);
1457 dst->addRect(r, reverse_direction(dir)); 1457 dst->addRect(r, reverse_direction(dir));
1458 } 1458 }
1459 } 1459 }
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