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 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 protected: | 58 protected: |
59 SkBlurDrawLooper(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy, | 59 SkBlurDrawLooper(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy, |
60 uint32_t flags); | 60 uint32_t flags); |
61 | 61 |
62 void flatten(SkWriteBuffer&) const override; | 62 void flatten(SkWriteBuffer&) const override; |
63 | 63 |
64 bool asABlurShadow(BlurShadowRec*) const override; | 64 bool asABlurShadow(BlurShadowRec*) const override; |
65 | 65 |
66 private: | 66 private: |
67 SkMaskFilter* fBlur; | 67 SkMaskFilter* fBlur; |
68 sk_sp<SkColorFilter> fColorFilter; | 68 SkColorFilter* fColorFilter; |
69 SkScalar fDx, fDy, fSigma; | 69 SkScalar fDx, fDy, fSigma; |
70 SkColor fBlurColor; | 70 SkColor fBlurColor; |
71 uint32_t fBlurFlags; | 71 uint32_t fBlurFlags; |
72 | 72 |
73 enum State { | 73 enum State { |
74 kBeforeEdge, | 74 kBeforeEdge, |
75 kAfterEdge, | 75 kAfterEdge, |
76 kDone | 76 kDone |
77 }; | 77 }; |
78 | 78 |
79 class BlurDrawLooperContext : public SkDrawLooper::Context { | 79 class BlurDrawLooperContext : public SkDrawLooper::Context { |
80 public: | 80 public: |
81 explicit BlurDrawLooperContext(const SkBlurDrawLooper* looper); | 81 explicit BlurDrawLooperContext(const SkBlurDrawLooper* looper); |
82 | 82 |
83 bool next(SkCanvas* canvas, SkPaint* paint) override; | 83 bool next(SkCanvas* canvas, SkPaint* paint) override; |
84 | 84 |
85 private: | 85 private: |
86 const SkBlurDrawLooper* fLooper; | 86 const SkBlurDrawLooper* fLooper; |
87 State fState; | 87 State fState; |
88 }; | 88 }; |
89 | 89 |
90 void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t
flags); | 90 void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t
flags); |
91 void initEffects(); | 91 void initEffects(); |
92 | 92 |
93 typedef SkDrawLooper INHERITED; | 93 typedef SkDrawLooper INHERITED; |
94 }; | 94 }; |
95 | 95 |
96 #endif | 96 #endif |
OLD | NEW |