| 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 /** Apply this matrix to the rectangle, and write the transformed rectangle | 463 /** Apply this matrix to the rectangle, and write the transformed rectangle |
| 464 back into it. This is accomplished by transforming the 4 corners of | 464 back into it. This is accomplished by transforming the 4 corners of |
| 465 rect, and then setting it to the bounds of those points | 465 rect, and then setting it to the bounds of those points |
| 466 @param rect The rectangle to transform. | 466 @param rect The rectangle to transform. |
| 467 @return the result of calling rectStaysRect() | 467 @return the result of calling rectStaysRect() |
| 468 */ | 468 */ |
| 469 bool mapRect(SkRect* rect) const { | 469 bool mapRect(SkRect* rect) const { |
| 470 return this->mapRect(rect, *rect); | 470 return this->mapRect(rect, *rect); |
| 471 } | 471 } |
| 472 | 472 |
| 473 /** Apply this matrix to the src rectangle, and write the four transformed |
| 474 points into dst. The points written to dst will be the original top-left
, top-right, |
| 475 bottom-right, and bottom-left points transformed by the matrix. |
| 476 @param dst Where the transformed quad is written. |
| 477 @param rect The original rectangle to be transformed. |
| 478 */ |
| 479 void mapRectToQuad(SkPoint dst[4], const SkRect& rect) const { |
| 480 // This could potentially be faster if we only transformed each x and y
of the rect once. |
| 481 rect.toQuad(dst); |
| 482 this->mapPoints(dst, 4); |
| 483 } |
| 484 |
| 473 /** Return the mean radius of a circle after it has been mapped by | 485 /** Return the mean radius of a circle after it has been mapped by |
| 474 this matrix. NOTE: in perspective this value assumes the circle | 486 this matrix. NOTE: in perspective this value assumes the circle |
| 475 has its center at the origin. | 487 has its center at the origin. |
| 476 */ | 488 */ |
| 477 SkScalar mapRadius(SkScalar radius) const; | 489 SkScalar mapRadius(SkScalar radius) const; |
| 478 | 490 |
| 479 typedef void (*MapXYProc)(const SkMatrix& mat, SkScalar x, SkScalar y, | 491 typedef void (*MapXYProc)(const SkMatrix& mat, SkScalar x, SkScalar y, |
| 480 SkPoint* result); | 492 SkPoint* result); |
| 481 | 493 |
| 482 static MapXYProc GetMapXYProc(TypeMask mask) { | 494 static MapXYProc GetMapXYProc(TypeMask mask) { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], | 677 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], |
| 666 int count); | 678 int count); |
| 667 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); | 679 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); |
| 668 | 680 |
| 669 static const MapPtsProc gMapPtsProcs[]; | 681 static const MapPtsProc gMapPtsProcs[]; |
| 670 | 682 |
| 671 friend class SkPerspIter; | 683 friend class SkPerspIter; |
| 672 }; | 684 }; |
| 673 | 685 |
| 674 #endif | 686 #endif |
| OLD | NEW |