| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkColorMatrix_DEFINED | 8 #ifndef SkColorMatrix_DEFINED |
| 9 #define SkColorMatrix_DEFINED | 9 #define SkColorMatrix_DEFINED |
| 10 | 10 |
| 11 #include "SkScalar.h" | 11 #include "SkScalar.h" |
| 12 | 12 |
| 13 class SK_API SkColorMatrix { | 13 class SK_API SkColorMatrix { |
| 14 public: | 14 public: |
| 15 enum { | 15 SkScalar fMat[20]; |
| 16 kCount = 20 | |
| 17 }; | |
| 18 SkScalar fMat[kCount]; | |
| 19 | 16 |
| 20 enum Elem { | 17 enum Elem { |
| 21 kR_Scale = 0, | 18 kR_Scale = 0, |
| 22 kG_Scale = 6, | 19 kG_Scale = 6, |
| 23 kB_Scale = 12, | 20 kB_Scale = 12, |
| 24 kA_Scale = 18, | 21 kA_Scale = 18, |
| 25 | 22 |
| 26 kR_Trans = 4, | 23 kR_Trans = 4, |
| 27 kG_Trans = 9, | 24 kG_Trans = 9, |
| 28 kB_Trans = 14, | 25 kB_Trans = 14, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return 0 == memcmp(fMat, other.fMat, sizeof(fMat)); | 58 return 0 == memcmp(fMat, other.fMat, sizeof(fMat)); |
| 62 } | 59 } |
| 63 | 60 |
| 64 bool operator!=(const SkColorMatrix& other) const { return !((*this) == othe
r); } | 61 bool operator!=(const SkColorMatrix& other) const { return !((*this) == othe
r); } |
| 65 | 62 |
| 66 static bool NeedsClamping(const SkScalar[20]); | 63 static bool NeedsClamping(const SkScalar[20]); |
| 67 static void SetConcat(SkScalar result[20], const SkScalar outer[20], const S
kScalar inner[20]); | 64 static void SetConcat(SkScalar result[20], const SkScalar outer[20], const S
kScalar inner[20]); |
| 68 }; | 65 }; |
| 69 | 66 |
| 70 #endif | 67 #endif |
| OLD | NEW |