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

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

Issue 1468483002: Add SK_BEGIN_REQUIRE_DENSE / SK_END_REQUIRE_DENSE. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkStrokeRec Created 5 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 | include/core/SkStrokeRec.h » ('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 "SkRect.h" 13 #include "SkRect.h"
14 14
15 struct SkRSXform; 15 struct SkRSXform;
16 class SkString; 16 class SkString;
17 17
18 /** \class SkMatrix 18 /** \class SkMatrix
19 19
20 The SkMatrix class holds a 3x3 matrix for transforming coordinates. 20 The SkMatrix class holds a 3x3 matrix for transforming coordinates.
21 SkMatrix does not have a constructor, so it must be explicitly initialized 21 SkMatrix does not have a constructor, so it must be explicitly initialized
22 using either reset() - to construct an identity matrix, or one of the set 22 using either reset() - to construct an identity matrix, or one of the set
23 functions (e.g. setTranslate, setRotate, etc.). 23 functions (e.g. setTranslate, setRotate, etc.).
24 */ 24 */
25 SK_BEGIN_REQUIRE_DENSE
25 class SK_API SkMatrix { 26 class SK_API SkMatrix {
26 public: 27 public:
27 static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy) { 28 static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy) {
28 SkMatrix m; 29 SkMatrix m;
29 m.setScale(sx, sy); 30 m.setScale(sx, sy);
30 return m; 31 return m;
31 } 32 }
32 33
33 static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar scale) { 34 static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar scale) {
34 SkMatrix m; 35 SkMatrix m;
35 m.setScale(scale, scale); 36 m.setScale(scale, scale);
36 return m; 37 return m;
37 } 38 }
38 39
39 static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkScalar dx, SkScalar dy) { 40 static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkScalar dx, SkScalar dy) {
40 SkMatrix m; 41 SkMatrix m;
41 m.setTranslate(dx, dy); 42 m.setTranslate(dx, dy);
42 return m; 43 return m;
43 } 44 }
44 45
45 /** Enum of bit fields for the mask return by getType(). 46 /** Enum of bit fields for the mask return by getType().
46 Use this to identify the complexity of the matrix. 47 Use this to identify the complexity of the matrix.
47 */ 48 */
48 enum TypeMask { 49 enum TypeMask {
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 static void ScaleTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], 820 static void ScaleTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[],
820 int count); 821 int count);
821 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 822 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
822 823
823 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int ); 824 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int );
824 825
825 static const MapPtsProc gMapPtsProcs[]; 826 static const MapPtsProc gMapPtsProcs[];
826 827
827 friend class SkPerspIter; 828 friend class SkPerspIter;
828 }; 829 };
830 SK_END_REQUIRE_DENSE
829 831
830 #endif 832 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkStrokeRec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698