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 #include "SkBlurDrawLooper.h" | 8 #include "SkBlurDrawLooper.h" |
9 #include "SkBlurMask.h" // just for SkBlurMask::ConvertRadiusToSigma | 9 #include "SkBlurMask.h" // just for SkBlurMask::ConvertRadiusToSigma |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 rec->fStyle = kNormal_SkBlurStyle; | 96 rec->fStyle = kNormal_SkBlurStyle; |
97 rec->fQuality = (fBlurFlags & kHighQuality_BlurFlag) ? | 97 rec->fQuality = (fBlurFlags & kHighQuality_BlurFlag) ? |
98 kHigh_SkBlurQuality : kLow_SkBlurQuality; | 98 kHigh_SkBlurQuality : kLow_SkBlurQuality; |
99 } | 99 } |
100 return true; | 100 return true; |
101 } | 101 } |
102 | 102 |
103 ////////////////////////////////////////////////////////////////////////////////
//////// | 103 ////////////////////////////////////////////////////////////////////////////////
//////// |
104 | 104 |
105 SkDrawLooper::Context* SkBlurDrawLooper::createContext(SkCanvas*, void* storage)
const { | 105 SkDrawLooper::Context* SkBlurDrawLooper::createContext(SkCanvas*, void* storage)
const { |
106 return SkNEW_PLACEMENT_ARGS(storage, BlurDrawLooperContext, (this)); | 106 return new (storage) BlurDrawLooperContext(this); |
107 } | 107 } |
108 | 108 |
109 SkBlurDrawLooper::BlurDrawLooperContext::BlurDrawLooperContext( | 109 SkBlurDrawLooper::BlurDrawLooperContext::BlurDrawLooperContext( |
110 const SkBlurDrawLooper* looper) | 110 const SkBlurDrawLooper* looper) |
111 : fLooper(looper), fState(SkBlurDrawLooper::kBeforeEdge) {} | 111 : fLooper(looper), fState(SkBlurDrawLooper::kBeforeEdge) {} |
112 | 112 |
113 bool SkBlurDrawLooper::BlurDrawLooperContext::next(SkCanvas* canvas, | 113 bool SkBlurDrawLooper::BlurDrawLooperContext::next(SkCanvas* canvas, |
114 SkPaint* paint) { | 114 SkPaint* paint) { |
115 switch (fState) { | 115 switch (fState) { |
116 case kBeforeEdge: | 116 case kBeforeEdge: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 &needsSeparator); | 175 &needsSeparator); |
176 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", | 176 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", |
177 &needsSeparator); | 177 &needsSeparator); |
178 } | 178 } |
179 str->append(")"); | 179 str->append(")"); |
180 | 180 |
181 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added | 181 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added |
182 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here | 182 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here |
183 } | 183 } |
184 #endif | 184 #endif |
OLD | NEW |