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 "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void SkBlurDrawLooper::flatten(SkFlattenableWriteBuffer& buffer) const { | 67 void SkBlurDrawLooper::flatten(SkFlattenableWriteBuffer& buffer) const { |
68 this->INHERITED::flatten(buffer); | 68 this->INHERITED::flatten(buffer); |
69 buffer.writeScalar(fDx); | 69 buffer.writeScalar(fDx); |
70 buffer.writeScalar(fDy); | 70 buffer.writeScalar(fDy); |
71 buffer.writeColor(fBlurColor); | 71 buffer.writeColor(fBlurColor); |
72 buffer.writeFlattenable(fBlur); | 72 buffer.writeFlattenable(fBlur); |
73 buffer.writeFlattenable(fColorFilter); | 73 buffer.writeFlattenable(fColorFilter); |
74 buffer.writeUInt(fBlurFlags); | 74 buffer.writeUInt(fBlurFlags); |
75 } | 75 } |
76 | 76 |
77 void SkBlurDrawLooper::init(SkCanvas* canvas) { | 77 void SkBlurDrawLooper::init(SkCanvas*) { |
78 fState = kBeforeEdge; | 78 fState = kBeforeEdge; |
79 } | 79 } |
80 | 80 |
81 bool SkBlurDrawLooper::next(SkCanvas* canvas, SkPaint* paint) { | 81 bool SkBlurDrawLooper::next(SkCanvas* canvas, SkPaint* paint) { |
82 switch (fState) { | 82 switch (fState) { |
83 case kBeforeEdge: | 83 case kBeforeEdge: |
84 // we do nothing if a maskfilter is already installed | 84 // we do nothing if a maskfilter is already installed |
85 if (paint->getMaskFilter()) { | 85 if (paint->getMaskFilter()) { |
86 fState = kDone; | 86 fState = kDone; |
87 return false; | 87 return false; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 &needsSeparator); | 142 &needsSeparator); |
143 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", | 143 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi
ghQuality", |
144 &needsSeparator); | 144 &needsSeparator); |
145 } | 145 } |
146 str->append(")"); | 146 str->append(")"); |
147 | 147 |
148 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added | 148 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr
ing is added |
149 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here | 149 // alternatively we could cache the radius in SkBlurDrawLooper and just add
it here |
150 } | 150 } |
151 #endif | 151 #endif |
OLD | NEW |