OLD | NEW |
---|---|
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 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 just return the middle 3 points, since the first and last are dups of src |
1340 // | 1340 // |
1341 static void p3d_interp(const SkScalar src[3], SkScalar dst[3], SkScalar t) { | 1341 static void p3d_interp(const SkScalar src[9], SkScalar dst[9], SkScalar t) { |
reed1
2014/01/28 13:20:36
Maybe they should be [7] ?
| |
1342 SkScalar ab = SkScalarInterp(src[0], src[3], t); | 1342 SkScalar ab = SkScalarInterp(src[0], src[3], t); |
1343 SkScalar bc = SkScalarInterp(src[3], src[6], t); | 1343 SkScalar bc = SkScalarInterp(src[3], src[6], t); |
1344 dst[0] = ab; | 1344 dst[0] = ab; |
1345 dst[3] = SkScalarInterp(ab, bc, t); | 1345 dst[3] = SkScalarInterp(ab, bc, t); |
1346 dst[6] = bc; | 1346 dst[6] = bc; |
1347 } | 1347 } |
1348 | 1348 |
1349 static void ratquad_mapTo3D(const SkPoint src[3], SkScalar w, SkP3D dst[]) { | 1349 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); | 1350 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); | 1351 dst[1].set(src[1].fX * w, src[1].fY * w, w); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1520 } | 1520 } |
1521 if (this->findYExtrema(&t)) { | 1521 if (this->findYExtrema(&t)) { |
1522 this->evalAt(t, &pts[count++]); | 1522 this->evalAt(t, &pts[count++]); |
1523 } | 1523 } |
1524 bounds->set(pts, count); | 1524 bounds->set(pts, count); |
1525 } | 1525 } |
1526 | 1526 |
1527 void SkConic::computeFastBounds(SkRect* bounds) const { | 1527 void SkConic::computeFastBounds(SkRect* bounds) const { |
1528 bounds->set(fPts, 3); | 1528 bounds->set(fPts, 3); |
1529 } | 1529 } |
OLD | NEW |