OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
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 SkClampRange_DEFINED | 8 #ifndef SkClampRange_DEFINED |
9 #define SkClampRange_DEFINED | 9 #define SkClampRange_DEFINED |
10 | 10 |
11 #include "SkFixed.h" | 11 #include "SkFixed.h" |
12 #include "SkScalar.h" | 12 #include "SkScalar.h" |
13 | 13 |
14 #define SkGradFixed SkFixed3232 | 14 #define SkGradFixed SkFixed3232 |
15 #define SkScalarToGradFixed SkScalarToFixed3232 | 15 #define SkScalarToGradFixed(x) SkScalarToFixed3232(x) |
16 #define SkFixedToGradFixed SkFixedToFixed3232 | 16 #define SkFixedToGradFixed(x) SkFixedToFixed3232(x) |
17 #define SkGradFixedToFixed(x) (SkFixed)((x) >> 16) | 17 #define SkGradFixedToFixed(x) (SkFixed)((x) >> 16) |
18 #define kFracMax_SkGradFixed 0xFFFFFFFFLL | 18 #define kFracMax_SkGradFixed 0xFFFFFFFFLL |
19 | 19 |
20 /** | 20 /** |
21 * Iteration fixed fx by dx, clamping as you go to [0..kFracMax_SkGradFixed], t
his class | 21 * Iteration fixed fx by dx, clamping as you go to [0..kFracMax_SkGradFixed], t
his class |
22 * computes the (up to) 3 spans there are: | 22 * computes the (up to) 3 spans there are: |
23 * | 23 * |
24 * range0: use constant value V0 | 24 * range0: use constant value V0 |
25 * range1: iterate as usual fx += dx | 25 * range1: iterate as usual fx += dx |
26 * range2: use constant value V1 | 26 * range2: use constant value V1 |
(...skipping 15 matching lines...) Expand all Loading... |
42 SkASSERT(fCount2 >= 0); | 42 SkASSERT(fCount2 >= 0); |
43 SkASSERT(fCount0 + fCount1 + fCount2 == count); | 43 SkASSERT(fCount0 + fCount1 + fCount2 == count); |
44 #endif | 44 #endif |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 void initFor1(SkGradFixed fx); | 48 void initFor1(SkGradFixed fx); |
49 }; | 49 }; |
50 | 50 |
51 #endif | 51 #endif |
OLD | NEW |