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

Side by Side Diff: src/effects/SkLayerDrawLooper.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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 #include "SkCanvas.h" 7 #include "SkCanvas.h"
8 #include "SkColor.h" 8 #include "SkColor.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 bsRec->fColor = fRecs->fPaint.getColor(); 191 bsRec->fColor = fRecs->fPaint.getColor();
192 bsRec->fStyle = maskBlur.fStyle; 192 bsRec->fStyle = maskBlur.fStyle;
193 bsRec->fQuality = maskBlur.fQuality; 193 bsRec->fQuality = maskBlur.fQuality;
194 } 194 }
195 return true; 195 return true;
196 } 196 }
197 197
198 /////////////////////////////////////////////////////////////////////////////// 198 ///////////////////////////////////////////////////////////////////////////////
199 199
200 void SkLayerDrawLooper::flatten(SkWriteBuffer& buffer) const { 200 void SkLayerDrawLooper::flatten(SkWriteBuffer& buffer) const {
201 buffer.writeInt(fCount); 201 buffer.writeInt("fCount", fCount);
202 202
203 Rec* rec = fRecs; 203 Rec* rec = fRecs;
204 for (int i = 0; i < fCount; i++) { 204 for (int i = 0; i < fCount; i++) {
205 // Legacy "flagsmask" field -- now ignored, remove when we bump version 205 // Legacy "flagsmask" field -- now ignored, remove when we bump version
206 buffer.writeInt(0); 206 buffer.writeInt("flagsmask", 0);
207 207
208 buffer.writeInt(rec->fInfo.fPaintBits); 208 buffer.writeInt("fPaintBits", rec->fInfo.fPaintBits);
209 buffer.writeInt(rec->fInfo.fColorMode); 209 buffer.writeInt("fColorMode", rec->fInfo.fColorMode);
210 buffer.writePoint(rec->fInfo.fOffset); 210 buffer.writePoint("fOffset", rec->fInfo.fOffset);
211 buffer.writeBool(rec->fInfo.fPostTranslate); 211 buffer.writeBool("fPostTranslate", rec->fInfo.fPostTranslate);
212 buffer.writePaint(rec->fPaint); 212 buffer.writePaint("fPaint", rec->fPaint);
213 rec = rec->fNext; 213 rec = rec->fNext;
214 } 214 }
215 } 215 }
216 216
217 sk_sp<SkFlattenable> SkLayerDrawLooper::CreateProc(SkReadBuffer& buffer) { 217 sk_sp<SkFlattenable> SkLayerDrawLooper::CreateProc(SkReadBuffer& buffer) {
218 int count = buffer.readInt(); 218 int count = buffer.readInt();
219 219
220 Builder builder; 220 Builder builder;
221 for (int i = 0; i < count; i++) { 221 for (int i = 0; i < count; i++) {
222 LayerInfo info; 222 LayerInfo info;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 SkLayerDrawLooper* looper = new SkLayerDrawLooper; 347 SkLayerDrawLooper* looper = new SkLayerDrawLooper;
348 looper->fCount = fCount; 348 looper->fCount = fCount;
349 looper->fRecs = fRecs; 349 looper->fRecs = fRecs;
350 350
351 fCount = 0; 351 fCount = 0;
352 fRecs = nullptr; 352 fRecs = nullptr;
353 fTopRec = nullptr; 353 fTopRec = nullptr;
354 354
355 return sk_sp<SkDrawLooper>(looper); 355 return sk_sp<SkDrawLooper>(looper);
356 } 356 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698