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" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 fColorFilter = NULL; | 62 fColorFilter = NULL; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 SkBlurDrawLooper::SkBlurDrawLooper(SkFlattenableReadBuffer& buffer) | 66 SkBlurDrawLooper::SkBlurDrawLooper(SkFlattenableReadBuffer& buffer) |
67 : INHERITED(buffer) { | 67 : INHERITED(buffer) { |
68 | 68 |
69 fDx = buffer.readScalar(); | 69 fDx = buffer.readScalar(); |
70 fDy = buffer.readScalar(); | 70 fDy = buffer.readScalar(); |
71 fBlurColor = buffer.readColor(); | 71 fBlurColor = buffer.readColor(); |
72 fBlur = buffer.readFlattenableT<SkMaskFilter>(); | 72 fBlur = buffer.readMaskFilter(); |
73 fColorFilter = buffer.readFlattenableT<SkColorFilter>(); | 73 fColorFilter = buffer.readColorFilter(); |
74 fBlurFlags = buffer.readUInt() & kAll_BlurFlag; | 74 fBlurFlags = buffer.readUInt() & kAll_BlurFlag; |
75 } | 75 } |
76 | 76 |
77 SkBlurDrawLooper::~SkBlurDrawLooper() { | 77 SkBlurDrawLooper::~SkBlurDrawLooper() { |
78 SkSafeUnref(fBlur); | 78 SkSafeUnref(fBlur); |
79 SkSafeUnref(fColorFilter); | 79 SkSafeUnref(fColorFilter); |
80 } | 80 } |
81 | 81 |
82 void SkBlurDrawLooper::flatten(SkFlattenableWriteBuffer& buffer) const { | 82 void SkBlurDrawLooper::flatten(SkFlattenableWriteBuffer& buffer) const { |
83 this->INHERITED::flatten(buffer); | 83 this->INHERITED::flatten(buffer); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 &needsSeparator); | 157 &needsSeparator); |
158 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", | 158 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", |
159 &needsSeparator); | 159 &needsSeparator); |
160 } | 160 } |
161 str->append(")"); | 161 str->append(")"); |
162 | 162 |
163 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added | 163 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added |
164 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here | 164 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here |
165 } | 165 } |
166 #endif | 166 #endif |
OLD | NEW |