| 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 * @return number of bytes read (must be a multiple of 4) or | 628 * @return number of bytes read (must be a multiple of 4) or |
| 629 * 0 if there was not enough memory available | 629 * 0 if there was not enough memory available |
| 630 */ | 630 */ |
| 631 size_t readFromMemory(const void* buffer, size_t length); | 631 size_t readFromMemory(const void* buffer, size_t length); |
| 632 | 632 |
| 633 void dump() const; | 633 void dump() const; |
| 634 void toString(SkString*) const; | 634 void toString(SkString*) const; |
| 635 | 635 |
| 636 /** | 636 /** |
| 637 * Calculates the minimum scaling factor of the matrix as computed from the
SVD of the upper | 637 * Calculates the minimum scaling factor of the matrix as computed from the
SVD of the upper |
| 638 * left 2x2. If the matrix has perspective -1 is returned. | 638 * left 2x2. If the max scale factor cannot be computed (for example overflo
w or perspective) |
| 639 * -1 is returned. |
| 639 * | 640 * |
| 640 * @return minumum scale factor | 641 * @return minimum scale factor |
| 641 */ | 642 */ |
| 642 SkScalar getMinScale() const; | 643 SkScalar getMinScale() const; |
| 643 | 644 |
| 644 /** | 645 /** |
| 645 * Calculates the maximum scaling factor of the matrix as computed from the
SVD of the upper | 646 * Calculates the maximum scaling factor of the matrix as computed from the
SVD of the upper |
| 646 * left 2x2. If the matrix has perspective -1 is returned. | 647 * left 2x2. If the max scale factor cannot be computed (for example overflo
w or perspective) |
| 648 * -1 is returned. |
| 647 * | 649 * |
| 648 * @return maximum scale factor | 650 * @return maximum scale factor |
| 649 */ | 651 */ |
| 650 SkScalar getMaxScale() const; | 652 SkScalar getMaxScale() const; |
| 651 | 653 |
| 652 /** | 654 /** |
| 653 * Gets both the min and max scale factors. The min scale factor is scaleFac
tors[0] and the max | 655 * Gets both the min and max scale factors. The min scale factor is scaleFac
tors[0] and the max |
| 654 * is scaleFactors[1]. If the matrix has perspective false will be returned
and scaleFactors | 656 * is scaleFactors[1]. If the min/max scale factors cannot be computed false
is returned and the |
| 655 * will be unchanged. | 657 * values of scaleFactors[] are undefined. |
| 656 */ | 658 */ |
| 657 bool getMinMaxScales(SkScalar scaleFactors[2]) const; | 659 bool SK_WARN_UNUSED_RESULT getMinMaxScales(SkScalar scaleFactors[2]) const; |
| 658 | 660 |
| 659 /** | 661 /** |
| 660 * Attempt to decompose this matrix into a scale-only component and whateve
r remains, where | 662 * Attempt to decompose this matrix into a scale-only component and whateve
r remains, where |
| 661 * the scale component is to be applied first. | 663 * the scale component is to be applied first. |
| 662 * | 664 * |
| 663 * M -> Remaining * Scale | 665 * M -> Remaining * Scale |
| 664 * | 666 * |
| 665 * On success, return true and assign the scale and remaining components (a
ssuming their | 667 * On success, return true and assign the scale and remaining components (a
ssuming their |
| 666 * respective parameters are not null). On failure return false and ignore
the parameters. | 668 * respective parameters are not null). On failure return false and ignore
the parameters. |
| 667 * | 669 * |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 | 825 |
| 824 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int
); | 826 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int
); |
| 825 | 827 |
| 826 static const MapPtsProc gMapPtsProcs[]; | 828 static const MapPtsProc gMapPtsProcs[]; |
| 827 | 829 |
| 828 friend class SkPerspIter; | 830 friend class SkPerspIter; |
| 829 }; | 831 }; |
| 830 SK_END_REQUIRE_DENSE | 832 SK_END_REQUIRE_DENSE |
| 831 | 833 |
| 832 #endif | 834 #endif |
| OLD | NEW |