Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: include/core/SkMatrix.h

Issue 1188433011: Added check for ill-conditioned invert (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address further code review comments (always perform exhaustive check) Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 kAllMasks = kTranslate_Mask | 712 kAllMasks = kTranslate_Mask |
713 kScale_Mask | 713 kScale_Mask |
714 kAffine_Mask | 714 kAffine_Mask |
715 kPerspective_Mask | 715 kPerspective_Mask |
716 kRectStaysRect_Mask 716 kRectStaysRect_Mask
717 }; 717 };
718 718
719 SkScalar fMat[9]; 719 SkScalar fMat[9];
720 mutable uint32_t fTypeMask; 720 mutable uint32_t fTypeMask;
721 721
722 /** Are all elements of the matrix finite?
723 */
724 bool isFinite() const;
725
726 static void ComputeInv(SkScalar dst[9], const SkScalar src[9], SkScalar invD et, bool isPersp);
727
722 void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty) { 728 void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty) {
723 fMat[kMScaleX] = sx; 729 fMat[kMScaleX] = sx;
724 fMat[kMSkewX] = 0; 730 fMat[kMSkewX] = 0;
725 fMat[kMTransX] = tx; 731 fMat[kMTransX] = tx;
726 732
727 fMat[kMSkewY] = 0; 733 fMat[kMSkewY] = 0;
728 fMat[kMScaleY] = sy; 734 fMat[kMScaleY] = sy;
729 fMat[kMTransY] = ty; 735 fMat[kMTransY] = ty;
730 736
731 fMat[kMPersp0] = 0; 737 fMat[kMPersp0] = 0;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 812 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
807 813
808 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int ); 814 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int );
809 815
810 static const MapPtsProc gMapPtsProcs[]; 816 static const MapPtsProc gMapPtsProcs[];
811 817
812 friend class SkPerspIter; 818 friend class SkPerspIter;
813 }; 819 };
814 820
815 #endif 821 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698