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

Side by Side Diff: include/effects/SkBlurDrawLooper.h

Issue 21835004: Blur refactoring (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: hide constant Created 7 years, 4 months 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 | Annotate | Revision Log
OLDNEW
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 17 matching lines...) Expand all
28 The blur layer's dx/dy/radius aren't affected by the canvas 28 The blur layer's dx/dy/radius aren't affected by the canvas
29 transform. 29 transform.
30 */ 30 */
31 kIgnoreTransform_BlurFlag = 0x01, 31 kIgnoreTransform_BlurFlag = 0x01,
32 kOverrideColor_BlurFlag = 0x02, 32 kOverrideColor_BlurFlag = 0x02,
33 kHighQuality_BlurFlag = 0x04, 33 kHighQuality_BlurFlag = 0x04,
34 /** mask for all blur flags */ 34 /** mask for all blur flags */
35 kAll_BlurFlag = 0x07 35 kAll_BlurFlag = 0x07
36 }; 36 };
37 37
38 SkBlurDrawLooper(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color,
bsalomon 2013/08/05 20:45:37 What's the plan for removing the unused bool? Coul
39 uint32_t flags /* = kNone_BlurFlag */, bool unused);
40
41 // DEPRECATED - radius-based
38 SkBlurDrawLooper(SkScalar radius, SkScalar dx, SkScalar dy, SkColor color, 42 SkBlurDrawLooper(SkScalar radius, SkScalar dx, SkScalar dy, SkColor color,
39 uint32_t flags = kNone_BlurFlag); 43 uint32_t flags = kNone_BlurFlag);
40 virtual ~SkBlurDrawLooper(); 44 virtual ~SkBlurDrawLooper();
41 45
42 // overrides from SkDrawLooper 46 // overrides from SkDrawLooper
43 virtual void init(SkCanvas*); 47 virtual void init(SkCanvas*);
44 virtual bool next(SkCanvas*, SkPaint* paint); 48 virtual bool next(SkCanvas*, SkPaint* paint);
45 49
46 SK_DEVELOPER_TO_STRING() 50 SK_DEVELOPER_TO_STRING()
47 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurDrawLooper) 51 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurDrawLooper)
48 52
49 protected: 53 protected:
50 SkBlurDrawLooper(SkFlattenableReadBuffer&); 54 SkBlurDrawLooper(SkFlattenableReadBuffer&);
51 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 55 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
52 56
53 private: 57 private:
54 SkMaskFilter* fBlur; 58 SkMaskFilter* fBlur;
55 SkColorFilter* fColorFilter; 59 SkColorFilter* fColorFilter;
56 SkScalar fDx, fDy; 60 SkScalar fDx, fDy;
57 SkColor fBlurColor; 61 SkColor fBlurColor;
58 uint32_t fBlurFlags; 62 uint32_t fBlurFlags;
59 63
60 enum State { 64 enum State {
61 kBeforeEdge, 65 kBeforeEdge,
62 kAfterEdge, 66 kAfterEdge,
63 kDone 67 kDone
64 }; 68 };
65 State fState; 69 State fState;
66 70
71 void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t flags);
72
67 typedef SkDrawLooper INHERITED; 73 typedef SkDrawLooper INHERITED;
68 }; 74 };
69 75
70 #endif 76 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698