OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 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 | 8 |
9 #ifndef SkBlurDrawLooper_DEFINED | 9 #ifndef SkBlurDrawLooper_DEFINED |
10 #define SkBlurDrawLooper_DEFINED | 10 #define SkBlurDrawLooper_DEFINED |
11 | 11 |
12 #include "SkDrawLooper.h" | 12 #include "SkDrawLooper.h" |
13 #include "SkColor.h" | 13 #include "SkColor.h" |
14 | 14 |
15 class SkMaskFilter; | 15 class SkMaskFilter; |
16 class SkColorFilter; | 16 class SkColorFilter; |
17 | 17 |
18 /** \class SkBlurDrawLooper | 18 /** \class SkBlurDrawLooper |
19 This class draws a shadow of the object (possibly offset), and then draws | 19 This class draws a shadow of the object (possibly offset), and then draws |
20 the original object in its original position. | 20 the original object in its original position. |
21 should there be an option to just draw the shadow/blur layer? webkit? | 21 should there be an option to just draw the shadow/blur layer? webkit? |
22 */ | 22 */ |
23 class SK_API SkBlurDrawLooper : public SkDrawLooper { | 23 class SK_API SkBlurDrawLooper : public SkDrawLooper { |
| 24 typedef SkDrawLooper INHERITED; |
| 25 |
24 public: | 26 public: |
25 enum BlurFlags { | 27 enum BlurFlags { |
26 kNone_BlurFlag = 0x00, | 28 kNone_BlurFlag = 0x00, |
27 /** | 29 /** |
28 The blur layer's dx/dy/radius aren't affected by the canvas | 30 The blur layer's dx/dy/radius aren't affected by the canvas |
29 transform. | 31 transform. |
30 */ | 32 */ |
31 kIgnoreTransform_BlurFlag = 0x01, | 33 kIgnoreTransform_BlurFlag = 0x01, |
32 kOverrideColor_BlurFlag = 0x02, | 34 kOverrideColor_BlurFlag = 0x02, |
33 kHighQuality_BlurFlag = 0x04, | 35 kHighQuality_BlurFlag = 0x04, |
(...skipping 28 matching lines...) Expand all Loading... |
62 uint32_t fBlurFlags; | 64 uint32_t fBlurFlags; |
63 | 65 |
64 enum State { | 66 enum State { |
65 kBeforeEdge, | 67 kBeforeEdge, |
66 kAfterEdge, | 68 kAfterEdge, |
67 kDone | 69 kDone |
68 }; | 70 }; |
69 State fState; | 71 State fState; |
70 | 72 |
71 void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t
flags); | 73 void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t
flags); |
72 | |
73 typedef SkDrawLooper INHERITED; | |
74 }; | 74 }; |
75 | 75 |
76 #endif | 76 #endif |
OLD | NEW |