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

Side by Side Diff: src/effects/SkTableMaskFilter.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 7
8 8
9 #include "SkFixed.h" 9 #include "SkFixed.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 margin->set(0, 0); 64 margin->set(0, 0);
65 } 65 }
66 return true; 66 return true;
67 } 67 }
68 68
69 SkMask::Format SkTableMaskFilter::getFormat() const { 69 SkMask::Format SkTableMaskFilter::getFormat() const {
70 return SkMask::kA8_Format; 70 return SkMask::kA8_Format;
71 } 71 }
72 72
73 void SkTableMaskFilter::flatten(SkWriteBuffer& wb) const { 73 void SkTableMaskFilter::flatten(SkWriteBuffer& wb) const {
74 wb.writeByteArray(fTable, 256); 74 wb.writeByteArray("fTable", fTable, 256);
75 } 75 }
76 76
77 sk_sp<SkFlattenable> SkTableMaskFilter::CreateProc(SkReadBuffer& buffer) { 77 sk_sp<SkFlattenable> SkTableMaskFilter::CreateProc(SkReadBuffer& buffer) {
78 uint8_t table[256]; 78 uint8_t table[256];
79 if (!buffer.readByteArray(table, 256)) { 79 if (!buffer.readByteArray(table, 256)) {
80 return nullptr; 80 return nullptr;
81 } 81 }
82 return sk_sp<SkFlattenable>(Create(table)); 82 return sk_sp<SkFlattenable>(Create(table));
83 } 83 }
84 84
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 str->append("table: "); 137 str->append("table: ");
138 for (int i = 0; i < 255; ++i) { 138 for (int i = 0; i < 255; ++i) {
139 str->appendf("%d, ", fTable[i]); 139 str->appendf("%d, ", fTable[i]);
140 } 140 }
141 str->appendf("%d", fTable[255]); 141 str->appendf("%d", fTable[255]);
142 142
143 str->append(")"); 143 str->append(")");
144 } 144 }
145 #endif 145 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698