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

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

Issue 148383009: That's confusing. Make it clear we're working with 3 points == 9 scalars. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ahh Created 6 years, 10 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 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 10
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 1329
1330 void set(SkScalar x, SkScalar y, SkScalar z) { 1330 void set(SkScalar x, SkScalar y, SkScalar z) {
1331 fX = x; fY = y; fZ = z; 1331 fX = x; fY = y; fZ = z;
1332 } 1332 }
1333 1333
1334 void projectDown(SkPoint* dst) const { 1334 void projectDown(SkPoint* dst) const {
1335 dst->set(fX / fZ, fY / fZ); 1335 dst->set(fX / fZ, fY / fZ);
1336 } 1336 }
1337 }; 1337 };
1338 1338
1339 // we just return the middle 3 points, since the first and last are dups of src 1339 // We only interpolate one dimension at a time (the first, at +0, +3, +6).
1340 // 1340 static void p3d_interp(const SkScalar src[7], SkScalar dst[7], SkScalar t) {
1341 static void p3d_interp(const SkScalar src[3], SkScalar dst[3], SkScalar t) {
1342 SkScalar ab = SkScalarInterp(src[0], src[3], t); 1341 SkScalar ab = SkScalarInterp(src[0], src[3], t);
1343 SkScalar bc = SkScalarInterp(src[3], src[6], t); 1342 SkScalar bc = SkScalarInterp(src[3], src[6], t);
1344 dst[0] = ab; 1343 dst[0] = ab;
1345 dst[3] = SkScalarInterp(ab, bc, t); 1344 dst[3] = SkScalarInterp(ab, bc, t);
1346 dst[6] = bc; 1345 dst[6] = bc;
1347 } 1346 }
1348 1347
1349 static void ratquad_mapTo3D(const SkPoint src[3], SkScalar w, SkP3D dst[]) { 1348 static void ratquad_mapTo3D(const SkPoint src[3], SkScalar w, SkP3D dst[]) {
1350 dst[0].set(src[0].fX * 1, src[0].fY * 1, 1); 1349 dst[0].set(src[0].fX * 1, src[0].fY * 1, 1);
1351 dst[1].set(src[1].fX * w, src[1].fY * w, w); 1350 dst[1].set(src[1].fX * w, src[1].fY * w, w);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 } 1519 }
1521 if (this->findYExtrema(&t)) { 1520 if (this->findYExtrema(&t)) {
1522 this->evalAt(t, &pts[count++]); 1521 this->evalAt(t, &pts[count++]);
1523 } 1522 }
1524 bounds->set(pts, count); 1523 bounds->set(pts, count);
1525 } 1524 }
1526 1525
1527 void SkConic::computeFastBounds(SkRect* bounds) const { 1526 void SkConic::computeFastBounds(SkRect* bounds) const {
1528 bounds->set(fPts, 3); 1527 bounds->set(fPts, 3);
1529 } 1528 }
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