Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkMatrix_DEFINED | 10 #ifndef SkMatrix_DEFINED |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 416 size_t stride, int count) const { | 416 size_t stride, int count) const { |
| 417 SkASSERT(stride >= sizeof(SkPoint)); | 417 SkASSERT(stride >= sizeof(SkPoint)); |
| 418 SkASSERT(0 == stride % sizeof(SkScalar)); | 418 SkASSERT(0 == stride % sizeof(SkScalar)); |
| 419 for (int i = 0; i < count; ++i) { | 419 for (int i = 0; i < count; ++i) { |
| 420 this->mapPoints(dst, src, 1); | 420 this->mapPoints(dst, src, 1); |
| 421 src = (SkPoint*)((intptr_t)src + stride); | 421 src = (SkPoint*)((intptr_t)src + stride); |
| 422 dst = (SkPoint*)((intptr_t)dst + stride); | 422 dst = (SkPoint*)((intptr_t)dst + stride); |
| 423 } | 423 } |
| 424 } | 424 } |
| 425 | 425 |
| 426 /** Apply this matrix to the array of homogeneous points, specified by src, | |
| 427 where a homogeneous point is defined by 3 contiguous scalar values, | |
| 428 and write the transformed points into the array of scalars specified by dst. | |
| 429 dst[] = M * src[] | |
| 430 @param dst Where the transformed coordinates are written. It must | |
| 431 contain at least 3 * count entries | |
| 432 @param src The original coordinates that are to be transformed. It | |
| 433 must contain at least 3 * count entries | |
| 434 @param count The number of points in src to read, and then transform | |
|
reed1
2013/08/07 18:16:50
Lets be very clear what 'count' is measuring. Its
| |
| 435 into dst. | |
| 436 */ | |
| 437 void mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int count) c onst; | |
| 438 | |
| 426 void mapXY(SkScalar x, SkScalar y, SkPoint* result) const { | 439 void mapXY(SkScalar x, SkScalar y, SkPoint* result) const { |
| 427 SkASSERT(result); | 440 SkASSERT(result); |
| 428 this->getMapXYProc()(*this, x, y, result); | 441 this->getMapXYProc()(*this, x, y, result); |
| 429 } | 442 } |
| 430 | 443 |
| 431 /** Apply this matrix to the array of vectors specified by src, and write | 444 /** Apply this matrix to the array of vectors specified by src, and write |
| 432 the transformed vectors into the array of vectors specified by dst. | 445 the transformed vectors into the array of vectors specified by dst. |
| 433 This is similar to mapPoints, but ignores any translation in the matrix. | 446 This is similar to mapPoints, but ignores any translation in the matrix. |
| 434 @param dst Where the transformed coordinates are written. It must | 447 @param dst Where the transformed coordinates are written. It must |
| 435 contain at least count entries | 448 contain at least count entries |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 659 static void Identity_pts(const SkMatrix&, SkPoint[], const SkPoint[], int); | 672 static void Identity_pts(const SkMatrix&, SkPoint[], const SkPoint[], int); |
| 660 static void Trans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 673 static void Trans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
| 661 static void Scale_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 674 static void Scale_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
| 662 static void ScaleTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], | 675 static void ScaleTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], |
| 663 int count); | 676 int count); |
| 664 static void Rot_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 677 static void Rot_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
| 665 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], | 678 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], |
| 666 int count); | 679 int count); |
| 667 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 680 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
| 668 | 681 |
| 682 static void Homogeneous_pts(const SkMatrix&, SkScalar dst[], const SkScalar[ ], int); | |
|
reed1
2013/08/07 18:16:50
Why is there a separate static function? Can just
| |
| 683 | |
| 669 static const MapPtsProc gMapPtsProcs[]; | 684 static const MapPtsProc gMapPtsProcs[]; |
| 670 | 685 |
| 671 friend class SkPerspIter; | 686 friend class SkPerspIter; |
| 672 }; | 687 }; |
| 673 | 688 |
| 674 #endif | 689 #endif |
| OLD | NEW |