| 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 "SkOrderedWriteBuffer.h" | 9 #include "SkOrderedWriteBuffer.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (0 == index) { | 303 if (0 == index) { |
| 304 return; | 304 return; |
| 305 } | 305 } |
| 306 } else { | 306 } else { |
| 307 this->writeFunctionPtr((void*)factory); | 307 this->writeFunctionPtr((void*)factory); |
| 308 } | 308 } |
| 309 | 309 |
| 310 // make room for the size of the flattened object | 310 // make room for the size of the flattened object |
| 311 (void)fWriter.reserve(sizeof(uint32_t)); | 311 (void)fWriter.reserve(sizeof(uint32_t)); |
| 312 // record the current size, so we can subtract after the object writes. | 312 // record the current size, so we can subtract after the object writes. |
| 313 uint32_t offset = fWriter.size(); | 313 uint32_t offset = fWriter.bytesWritten(); |
| 314 // now flatten the object | 314 // now flatten the object |
| 315 flattenObject(flattenable, *this); | 315 flattenObject(flattenable, *this); |
| 316 uint32_t objSize = fWriter.size() - offset; | 316 uint32_t objSize = fWriter.bytesWritten() - offset; |
| 317 // record the obj's size | 317 // record the obj's size |
| 318 *fWriter.peek32(offset - sizeof(uint32_t)) = objSize; | 318 *fWriter.peek32(offset - sizeof(uint32_t)) = objSize; |
| 319 } | 319 } |
| OLD | NEW |