OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 uint32_t flags) { | 99 uint32_t flags) { |
100 // use !(sigma > 0) instead of sigma <= 0 to reject NaN values | 100 // use !(sigma > 0) instead of sigma <= 0 to reject NaN values |
101 if (!(sigma > 0) || (unsigned)style >= SkBlurMaskFilter::kBlurStyleCount | 101 if (!(sigma > 0) || (unsigned)style >= SkBlurMaskFilter::kBlurStyleCount |
102 || flags > SkBlurMaskFilter::kAll_BlurFlag) { | 102 || flags > SkBlurMaskFilter::kAll_BlurFlag) { |
103 return NULL; | 103 return NULL; |
104 } | 104 } |
105 | 105 |
106 return SkNEW_ARGS(SkBlurMaskFilterImpl, (sigma, style, flags)); | 106 return SkNEW_ARGS(SkBlurMaskFilterImpl, (sigma, style, flags)); |
107 } | 107 } |
108 | 108 |
| 109 SkFlattenable::Factory SkBlurMaskFilter::GetFactory(SkFlattenable::Type type) { |
| 110 if (type == SkFlattenable::kSkBlurMaskFilterImpl_Type) { |
| 111 return SkBlurMaskFilterImpl::CreateProc; |
| 112 } |
| 113 return NULL; |
| 114 } |
| 115 |
| 116 SkFlattenable::TypeCheck SkBlurMaskFilter::GetTypeCheck(SkFlattenable::Type type
) { |
| 117 if (type == SkFlattenable::kSkBlurMaskFilterImpl_Type) { |
| 118 return SkBlurMaskFilterImpl::IsA; |
| 119 } |
| 120 return NULL; |
| 121 } |
| 122 |
109 /////////////////////////////////////////////////////////////////////////////// | 123 /////////////////////////////////////////////////////////////////////////////// |
110 | 124 |
111 SkBlurMaskFilterImpl::SkBlurMaskFilterImpl(SkScalar sigma, | 125 SkBlurMaskFilterImpl::SkBlurMaskFilterImpl(SkScalar sigma, |
112 SkBlurMaskFilter::BlurStyle style, | 126 SkBlurMaskFilter::BlurStyle style, |
113 uint32_t flags) | 127 uint32_t flags) |
114 : fSigma(sigma), fBlurStyle(style), fBlurFlags(flags) { | 128 : fSigma(sigma), fBlurStyle(style), fBlurFlags(flags) { |
115 #if 0 | 129 #if 0 |
116 fGamma = NULL; | 130 fGamma = NULL; |
117 if (gammaScale) { | 131 if (gammaScale) { |
118 fGamma = new U8[256]; | 132 fGamma = new U8[256]; |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 } else { | 487 } else { |
474 str->append("None"); | 488 str->append("None"); |
475 } | 489 } |
476 str->append("))"); | 490 str->append("))"); |
477 } | 491 } |
478 #endif | 492 #endif |
479 | 493 |
480 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 494 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
481 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 495 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
482 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 496 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |