OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkErrorInternals.h" | 10 #include "SkErrorInternals.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 void SkReadBuffer::readRect(SkRect* rect) { | 143 void SkReadBuffer::readRect(SkRect* rect) { |
144 memcpy(rect, fReader.skip(sizeof(SkRect)), sizeof(SkRect)); | 144 memcpy(rect, fReader.skip(sizeof(SkRect)), sizeof(SkRect)); |
145 } | 145 } |
146 | 146 |
147 void SkReadBuffer::readRegion(SkRegion* region) { | 147 void SkReadBuffer::readRegion(SkRegion* region) { |
148 fReader.readRegion(region); | 148 fReader.readRegion(region); |
149 } | 149 } |
150 | 150 |
151 void SkReadBuffer::readPatch(SkPatch* patch) { | |
152 fReader.readPatch(patch); | |
153 } | |
154 | |
155 void SkReadBuffer::readPath(SkPath* path) { | 151 void SkReadBuffer::readPath(SkPath* path) { |
156 fReader.readPath(path); | 152 fReader.readPath(path); |
157 } | 153 } |
158 | 154 |
159 bool SkReadBuffer::readArray(void* value, size_t size, size_t elementSize) { | 155 bool SkReadBuffer::readArray(void* value, size_t size, size_t elementSize) { |
160 const size_t count = this->getArrayCount(); | 156 const size_t count = this->getArrayCount(); |
161 if (count == size) { | 157 if (count == size) { |
162 (void)fReader.skip(sizeof(uint32_t)); // Skip array count | 158 (void)fReader.skip(sizeof(uint32_t)); // Skip array count |
163 const size_t byteLength = count * elementSize; | 159 const size_t byteLength = count * elementSize; |
164 memcpy(value, fReader.skip(SkAlign4(byteLength)), byteLength); | 160 memcpy(value, fReader.skip(SkAlign4(byteLength)), byteLength); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 return; | 355 return; |
360 } | 356 } |
361 } else { | 357 } else { |
362 if (NULL == this->readFunctionPtr()) { | 358 if (NULL == this->readFunctionPtr()) { |
363 return; | 359 return; |
364 } | 360 } |
365 } | 361 } |
366 uint32_t sizeRecorded = fReader.readU32(); | 362 uint32_t sizeRecorded = fReader.readU32(); |
367 fReader.skip(sizeRecorded); | 363 fReader.skip(sizeRecorded); |
368 } | 364 } |
OLD | NEW |