OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkMergeImageFilter.h" | 8 #include "SkMergeImageFilter.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 if (!buffer.isValid()) { | 168 if (!buffer.isValid()) { |
169 return nullptr; | 169 return nullptr; |
170 } | 170 } |
171 return Make(common.inputs(), count, modes.get(), &common.cropRect()); | 171 return Make(common.inputs(), count, modes.get(), &common.cropRect()); |
172 } | 172 } |
173 return Make(common.inputs(), count, nullptr, &common.cropRect()); | 173 return Make(common.inputs(), count, nullptr, &common.cropRect()); |
174 } | 174 } |
175 | 175 |
176 void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const { | 176 void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const { |
177 this->INHERITED::flatten(buffer); | 177 this->INHERITED::flatten(buffer); |
178 buffer.writeBool(fModes != nullptr); | 178 buffer.writeBool("modesValid", fModes != nullptr); |
179 if (fModes) { | 179 if (fModes) { |
180 buffer.writeByteArray(fModes, this->countInputs() * sizeof(fModes[0])); | 180 buffer.writeByteArray("fModes", fModes, this->countInputs() * sizeof(fMo
des[0])); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 #ifndef SK_IGNORE_TO_STRING | 184 #ifndef SK_IGNORE_TO_STRING |
185 void SkMergeImageFilter::toString(SkString* str) const { | 185 void SkMergeImageFilter::toString(SkString* str) const { |
186 str->appendf("SkMergeImageFilter: ("); | 186 str->appendf("SkMergeImageFilter: ("); |
187 | 187 |
188 for (int i = 0; i < this->countInputs(); ++i) { | 188 for (int i = 0; i < this->countInputs(); ++i) { |
189 SkImageFilter* filter = this->getInput(i); | 189 SkImageFilter* filter = this->getInput(i); |
190 str->appendf("%d: (", i); | 190 str->appendf("%d: (", i); |
191 filter->toString(str); | 191 filter->toString(str); |
192 str->appendf(")"); | 192 str->appendf(")"); |
193 } | 193 } |
194 | 194 |
195 str->append(")"); | 195 str->append(")"); |
196 } | 196 } |
197 #endif | 197 #endif |
OLD | NEW |