Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: src/effects/SkMergeImageFilter.cpp

Issue 1911963008: DNC - JSON of flattenables, with field names. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add names to call sites Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698