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 "SkWriteBuffer.h" | 9 #include "SkWriteBuffer.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 314 } |
315 | 315 |
316 // make room for the size of the flattened object | 316 // make room for the size of the flattened object |
317 (void)fWriter.reserve(sizeof(uint32_t)); | 317 (void)fWriter.reserve(sizeof(uint32_t)); |
318 // record the current size, so we can subtract after the object writes. | 318 // record the current size, so we can subtract after the object writes. |
319 uint32_t offset = fWriter.bytesWritten(); | 319 uint32_t offset = fWriter.bytesWritten(); |
320 // now flatten the object | 320 // now flatten the object |
321 flattenable->flatten(*this); | 321 flattenable->flatten(*this); |
322 uint32_t objSize = fWriter.bytesWritten() - offset; | 322 uint32_t objSize = fWriter.bytesWritten() - offset; |
323 // record the obj's size | 323 // record the obj's size |
324 *fWriter.peek32(offset - sizeof(uint32_t)) = objSize; | 324 fWriter.write32At(offset - sizeof(uint32_t), objSize); |
325 } | 325 } |
OLD | NEW |