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

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

Issue 773433003: Force SkMatrix type while recording too. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase again Created 6 years 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/SkRecordDraw.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
11 #define SkMatrix_DEFINED 11 #define SkMatrix_DEFINED
12 12
13 #include "SkDynamicAnnotations.h"
14 #include "SkRect.h" 13 #include "SkRect.h"
15 14
16 class SkString; 15 class SkString;
17 16
18 // TODO: can we remove these 3 (need to check chrome/android) 17 // TODO: can we remove these 3 (need to check chrome/android)
19 typedef SkScalar SkPersp; 18 typedef SkScalar SkPersp;
20 #define SkScalarToPersp(x) (x) 19 #define SkScalarToPersp(x) (x)
21 #define SkPerspToScalar(x) (x) 20 #define SkPerspToScalar(x) (x)
22 21
23 /** \class SkMatrix 22 /** \class SkMatrix
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 kPerspective_Mask, 640 kPerspective_Mask,
642 641
643 kAllMasks = kTranslate_Mask | 642 kAllMasks = kTranslate_Mask |
644 kScale_Mask | 643 kScale_Mask |
645 kAffine_Mask | 644 kAffine_Mask |
646 kPerspective_Mask | 645 kPerspective_Mask |
647 kRectStaysRect_Mask 646 kRectStaysRect_Mask
648 }; 647 };
649 648
650 SkScalar fMat[9]; 649 SkScalar fMat[9];
651 mutable SkTRacy<uint32_t> fTypeMask; 650 mutable uint32_t fTypeMask;
652 651
653 void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty) { 652 void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty) {
654 fMat[kMScaleX] = sx; 653 fMat[kMScaleX] = sx;
655 fMat[kMSkewX] = 0; 654 fMat[kMSkewX] = 0;
656 fMat[kMTransX] = tx; 655 fMat[kMTransX] = tx;
657 656
658 fMat[kMSkewY] = 0; 657 fMat[kMSkewY] = 0;
659 fMat[kMScaleY] = sy; 658 fMat[kMScaleY] = sy;
660 fMat[kMTransY] = ty; 659 fMat[kMTransY] = ty;
661 660
662 fMat[kMPersp0] = 0; 661 fMat[kMPersp0] = 0;
663 fMat[kMPersp1] = 0; 662 fMat[kMPersp1] = 0;
664 fMat[kMPersp2] = 1; 663 fMat[kMPersp2] = 1;
665 664
666 unsigned mask = 0; 665 unsigned mask = 0;
667 if (sx != 1 || sy != 1) { 666 if (sx != 1 || sy != 1) {
668 mask |= kScale_Mask; 667 mask |= kScale_Mask;
669 } 668 }
670 if (tx || ty) { 669 if (tx || ty) {
671 mask |= kTranslate_Mask; 670 mask |= kTranslate_Mask;
672 } 671 }
673 this->setTypeMask(mask | kRectStaysRect_Mask); 672 this->setTypeMask(mask | kRectStaysRect_Mask);
674 } 673 }
675 674
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], 737 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[],
739 int count); 738 int count);
740 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 739 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
741 740
742 static const MapPtsProc gMapPtsProcs[]; 741 static const MapPtsProc gMapPtsProcs[];
743 742
744 friend class SkPerspIter; 743 friend class SkPerspIter;
745 }; 744 };
746 745
747 #endif 746 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698