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

Side by Side Diff: src/gpu/GrPathUtils.cpp

Issue 2234563003: Remove a useless call: Calling lineVec.dot(qPts[0]) (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 2011 Google Inc. 2 * Copyright 2011 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 "GrPathUtils.h" 8 #include "GrPathUtils.h"
9 9
10 #include "GrTypes.h" 10 #include "GrTypes.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 maxEdge = 2; 242 maxEdge = 2;
243 } 243 }
244 // We could have a tolerance here, not sure if it would improve anything 244 // We could have a tolerance here, not sure if it would improve anything
245 if (maxD > 0) { 245 if (maxD > 0) {
246 // Set the matrix to give (u = 0, v = distance_to_line) 246 // Set the matrix to give (u = 0, v = distance_to_line)
247 SkVector lineVec = qPts[(maxEdge + 1)%3] - qPts[maxEdge]; 247 SkVector lineVec = qPts[(maxEdge + 1)%3] - qPts[maxEdge];
248 // when looking from the point 0 down the line we want positive 248 // when looking from the point 0 down the line we want positive
249 // distances to be to the left. This matches the non-degenerate 249 // distances to be to the left. This matches the non-degenerate
250 // case. 250 // case.
251 lineVec.setOrthog(lineVec, SkPoint::kLeft_Side); 251 lineVec.setOrthog(lineVec, SkPoint::kLeft_Side);
252 lineVec.dot(qPts[0]);
253 // first row 252 // first row
254 fM[0] = 0; 253 fM[0] = 0;
255 fM[1] = 0; 254 fM[1] = 0;
256 fM[2] = 0; 255 fM[2] = 0;
257 // second row 256 // second row
258 fM[3] = lineVec.fX; 257 fM[3] = lineVec.fX;
259 fM[4] = lineVec.fY; 258 fM[4] = lineVec.fY;
260 fM[5] = -lineVec.dot(qPts[maxEdge]); 259 fM[5] = -lineVec.dot(qPts[maxEdge]);
261 } else { 260 } else {
262 // It's a point. It should cover zero area. Just set the matrix such 261 // It's a point. It should cover zero area. Just set the matrix such
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 set_loop_klm(d, controlK, controlL, controlM); 813 set_loop_klm(d, controlK, controlL, controlM);
815 } else if (kCusp_SkCubicType == cType) { 814 } else if (kCusp_SkCubicType == cType) {
816 SkASSERT(0.f == d[0]); 815 SkASSERT(0.f == d[0]);
817 set_cusp_klm(d, controlK, controlL, controlM); 816 set_cusp_klm(d, controlK, controlL, controlM);
818 } else if (kQuadratic_SkCubicType == cType) { 817 } else if (kQuadratic_SkCubicType == cType) {
819 set_quadratic_klm(d, controlK, controlL, controlM); 818 set_quadratic_klm(d, controlK, controlL, controlM);
820 } 819 }
821 820
822 calc_cubic_klm(p, controlK, controlL, controlM, klm, &klm[3], &klm[6]); 821 calc_cubic_klm(p, controlK, controlL, controlM, klm, &klm[3], &klm[6]);
823 } 822 }
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