| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 bottom-right, and bottom-left points transformed by the matrix. | 554 bottom-right, and bottom-left points transformed by the matrix. |
| 555 @param dst Where the transformed quad is written. | 555 @param dst Where the transformed quad is written. |
| 556 @param rect The original rectangle to be transformed. | 556 @param rect The original rectangle to be transformed. |
| 557 */ | 557 */ |
| 558 void mapRectToQuad(SkPoint dst[4], const SkRect& rect) const { | 558 void mapRectToQuad(SkPoint dst[4], const SkRect& rect) const { |
| 559 // This could potentially be faster if we only transformed each x and y
of the rect once. | 559 // This could potentially be faster if we only transformed each x and y
of the rect once. |
| 560 rect.toQuad(dst); | 560 rect.toQuad(dst); |
| 561 this->mapPoints(dst, 4); | 561 this->mapPoints(dst, 4); |
| 562 } | 562 } |
| 563 | 563 |
| 564 /** |
| 565 * Maps a rect to another rect, asserting (in debug mode) that the matrix o
nly contains |
| 566 * scale and translate elements. If it contains other elements, the results
are undefined. |
| 567 */ |
| 568 void mapRectScaleTranslate(SkRect* dst, const SkRect& src) const; |
| 569 |
| 564 /** Return the mean radius of a circle after it has been mapped by | 570 /** Return the mean radius of a circle after it has been mapped by |
| 565 this matrix. NOTE: in perspective this value assumes the circle | 571 this matrix. NOTE: in perspective this value assumes the circle |
| 566 has its center at the origin. | 572 has its center at the origin. |
| 567 */ | 573 */ |
| 568 SkScalar mapRadius(SkScalar radius) const; | 574 SkScalar mapRadius(SkScalar radius) const; |
| 569 | 575 |
| 570 typedef void (*MapXYProc)(const SkMatrix& mat, SkScalar x, SkScalar y, | 576 typedef void (*MapXYProc)(const SkMatrix& mat, SkScalar x, SkScalar y, |
| 571 SkPoint* result); | 577 SkPoint* result); |
| 572 | 578 |
| 573 static MapXYProc GetMapXYProc(TypeMask mask) { | 579 static MapXYProc GetMapXYProc(TypeMask mask) { |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 836 |
| 831 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int
); | 837 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int
); |
| 832 | 838 |
| 833 static const MapPtsProc gMapPtsProcs[]; | 839 static const MapPtsProc gMapPtsProcs[]; |
| 834 | 840 |
| 835 friend class SkPerspIter; | 841 friend class SkPerspIter; |
| 836 }; | 842 }; |
| 837 SK_END_REQUIRE_DENSE | 843 SK_END_REQUIRE_DENSE |
| 838 | 844 |
| 839 #endif | 845 #endif |
| OLD | NEW |