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

Side by Side Diff: src/utils/SkCurveMeasure.cpp

Issue 2242603002: Fix bug in cubic derivative coefficient with missing parens (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 2016 Google Inc. 2 * Copyright 2016 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 #include "SkCurveMeasure.h" 8 #include "SkCurveMeasure.h"
9 #include "SkGeometry.h" 9 #include "SkGeometry.h"
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 float By = pts[1].y(); 123 float By = pts[1].y();
124 float Cy = pts[2].y(); 124 float Cy = pts[2].y();
125 float Dy = pts[3].y(); 125 float Dy = pts[3].y();
126 126
127 // precompute coefficients for derivative 127 // precompute coefficients for derivative
128 xCoeff[0] = Sk8f(3.0f*(-Ax + 3.0f*(Bx - Cx) + Dx)); 128 xCoeff[0] = Sk8f(3.0f*(-Ax + 3.0f*(Bx - Cx) + Dx));
129 xCoeff[1] = Sk8f(3.0f*(2.0f*(Ax - 2.0f*Bx + Cx))); 129 xCoeff[1] = Sk8f(3.0f*(2.0f*(Ax - 2.0f*Bx + Cx)));
130 xCoeff[2] = Sk8f(3.0f*(-Ax + Bx)); 130 xCoeff[2] = Sk8f(3.0f*(-Ax + Bx));
131 131
132 yCoeff[0] = Sk8f(3.0f*(-Ay + 3.0f*(By - Cy) + Dy)); 132 yCoeff[0] = Sk8f(3.0f*(-Ay + 3.0f*(By - Cy) + Dy));
133 yCoeff[1] = Sk8f(3.0f * -Ay + By + 2.0f*(Ay - 2.0f*By + Cy)); 133 yCoeff[1] = Sk8f(3.0f*(2.0f*(Ay - 2.0f*By + Cy)));
reed1 2016/08/16 21:19:35 this seems fine. two nits: 1. don't need 3.0f whe
134 yCoeff[2] = Sk8f(3.0f*(-Ay + By)); 134 yCoeff[2] = Sk8f(3.0f*(-Ay + By));
135 } 135 }
136 break; 136 break;
137 case kConic_SegType: 137 case kConic_SegType:
138 UNIMPLEMENTED; 138 UNIMPLEMENTED;
139 break; 139 break;
140 default: 140 default:
141 UNIMPLEMENTED; 141 UNIMPLEMENTED;
142 } 142 }
143 } 143 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 if (time) { 301 if (time) {
302 *time = t; 302 *time = t;
303 } 303 }
304 if (pos) { 304 if (pos) {
305 *pos = evaluate(fPts, fSegType, t); 305 *pos = evaluate(fPts, fSegType, t);
306 } 306 }
307 if (tan) { 307 if (tan) {
308 *tan = evaluateDerivative(fPts, fSegType, t); 308 *tan = evaluateDerivative(fPts, fSegType, t);
309 } 309 }
310 } 310 }
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