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

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

Issue 1167153002: Remove overly-promiscuous SkNx syntax sugar. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: update test 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 | « bench/PMFloatBench.cpp ('k') | src/core/SkNx.h » ('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 "SkGeometry.h" 8 #include "SkGeometry.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 #include "SkNx.h" 10 #include "SkNx.h"
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 Sk2s ww(fW); 1277 Sk2s ww(fW);
1278 Sk2s one(1); 1278 Sk2s one(1);
1279 1279
1280 Sk2s p1w = p1 * ww; 1280 Sk2s p1w = p1 * ww;
1281 Sk2s C = p0; 1281 Sk2s C = p0;
1282 Sk2s A = p2 - times_2(p1w) + p0; 1282 Sk2s A = p2 - times_2(p1w) + p0;
1283 Sk2s B = times_2(p1w - C); 1283 Sk2s B = times_2(p1w - C);
1284 Sk2s numer = quad_poly_eval(A, B, C, tt); 1284 Sk2s numer = quad_poly_eval(A, B, C, tt);
1285 1285
1286 B = times_2(ww - one); 1286 B = times_2(ww - one);
1287 A = -B; 1287 A = Sk2s(0)-B;
1288 Sk2s denom = quad_poly_eval(A, B, one, tt); 1288 Sk2s denom = quad_poly_eval(A, B, one, tt);
1289 1289
1290 return to_point(numer / denom); 1290 return to_point(numer / denom);
1291 } 1291 }
1292 1292
1293 SkVector SkConic::evalTangentAt(SkScalar t) const { 1293 SkVector SkConic::evalTangentAt(SkScalar t) const {
1294 Sk2s p0 = from_point(fPts[0]); 1294 Sk2s p0 = from_point(fPts[0]);
1295 Sk2s p1 = from_point(fPts[1]); 1295 Sk2s p1 = from_point(fPts[1]);
1296 Sk2s p2 = from_point(fPts[2]); 1296 Sk2s p2 = from_point(fPts[2]);
1297 Sk2s ww(fW); 1297 Sk2s ww(fW);
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 matrix.preScale(SK_Scalar1, -SK_Scalar1); 1579 matrix.preScale(SK_Scalar1, -SK_Scalar1);
1580 } 1580 }
1581 if (userMatrix) { 1581 if (userMatrix) {
1582 matrix.postConcat(*userMatrix); 1582 matrix.postConcat(*userMatrix);
1583 } 1583 }
1584 for (int i = 0; i < conicCount; ++i) { 1584 for (int i = 0; i < conicCount; ++i) {
1585 matrix.mapPoints(dst[i].fPts, 3); 1585 matrix.mapPoints(dst[i].fPts, 3);
1586 } 1586 }
1587 return conicCount; 1587 return conicCount;
1588 } 1588 }
OLDNEW
« no previous file with comments | « bench/PMFloatBench.cpp ('k') | src/core/SkNx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698