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 |
151 void SkReadBuffer::readPath(SkPath* path) { | 155 void SkReadBuffer::readPath(SkPath* path) { |
152 fReader.readPath(path); | 156 fReader.readPath(path); |
153 } | 157 } |
154 | 158 |
155 bool SkReadBuffer::readArray(void* value, size_t size, size_t elementSize) { | 159 bool SkReadBuffer::readArray(void* value, size_t size, size_t elementSize) { |
156 const size_t count = this->getArrayCount(); | 160 const size_t count = this->getArrayCount(); |
157 if (count == size) { | 161 if (count == size) { |
158 (void)fReader.skip(sizeof(uint32_t)); // Skip array count | 162 (void)fReader.skip(sizeof(uint32_t)); // Skip array count |
159 const size_t byteLength = count * elementSize; | 163 const size_t byteLength = count * elementSize; |
160 memcpy(value, fReader.skip(SkAlign4(byteLength)), byteLength); | 164 memcpy(value, fReader.skip(SkAlign4(byteLength)), byteLength); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 return; | 359 return; |
356 } | 360 } |
357 } else { | 361 } else { |
358 if (NULL == this->readFunctionPtr()) { | 362 if (NULL == this->readFunctionPtr()) { |
359 return; | 363 return; |
360 } | 364 } |
361 } | 365 } |
362 uint32_t sizeRecorded = fReader.readU32(); | 366 uint32_t sizeRecorded = fReader.readU32(); |
363 fReader.skip(sizeRecorded); | 367 fReader.skip(sizeRecorded); |
364 } | 368 } |
OLD | NEW |