| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 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" |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "SkColorFilter.h" | 12 #include "SkColorFilter.h" |
| 13 #include "SkReadBuffer.h" | 13 #include "SkReadBuffer.h" |
| 14 #include "SkWriteBuffer.h" | 14 #include "SkWriteBuffer.h" |
| 15 #include "SkMaskFilter.h" | 15 #include "SkMaskFilter.h" |
| 16 #include "SkPaint.h" | 16 #include "SkPaint.h" |
| 17 #include "SkString.h" | 17 #include "SkString.h" |
| 18 #include "SkStringUtils.h" | 18 #include "SkStringUtils.h" |
| 19 | 19 |
| 20 #ifdef SK_SUPPORT_LEGACY_BLURDRAWLOOPERCONSTRUCTORS |
| 20 SkBlurDrawLooper::SkBlurDrawLooper(SkScalar radius, SkScalar dx, SkScalar dy, | 21 SkBlurDrawLooper::SkBlurDrawLooper(SkScalar radius, SkScalar dx, SkScalar dy, |
| 21 SkColor color, uint32_t flags) { | 22 SkColor color, uint32_t flags) { |
| 22 this->init(SkBlurMask::ConvertRadiusToSigma(radius), dx, dy, color, flags); | 23 this->init(SkBlurMask::ConvertRadiusToSigma(radius), dx, dy, color, flags); |
| 23 } | 24 } |
| 25 #endif |
| 24 | 26 |
| 25 SkBlurDrawLooper::SkBlurDrawLooper(SkColor color, SkScalar sigma, | 27 SkBlurDrawLooper::SkBlurDrawLooper(SkColor color, SkScalar sigma, |
| 26 SkScalar dx, SkScalar dy, uint32_t flags) { | 28 SkScalar dx, SkScalar dy, uint32_t flags) { |
| 27 this->init(sigma, dx, dy, color, flags); | 29 this->init(sigma, dx, dy, color, flags); |
| 28 } | 30 } |
| 29 | 31 |
| 30 void SkBlurDrawLooper::init(SkScalar sigma, SkScalar dx, SkScalar dy, | 32 void SkBlurDrawLooper::init(SkScalar sigma, SkScalar dx, SkScalar dy, |
| 31 SkColor color, uint32_t flags) { | 33 SkColor color, uint32_t flags) { |
| 32 fDx = dx; | 34 fDx = dx; |
| 33 fDy = dy; | 35 fDy = dy; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 &needsSeparator); | 164 &needsSeparator); |
| 163 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", | 165 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", |
| 164 &needsSeparator); | 166 &needsSeparator); |
| 165 } | 167 } |
| 166 str->append(")"); | 168 str->append(")"); |
| 167 | 169 |
| 168 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added | 170 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added |
| 169 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here | 171 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here |
| 170 } | 172 } |
| 171 #endif | 173 #endif |
| OLD | NEW |