OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |