| 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" |
| 11 #include "SkBitmapHeap.h" |
| 11 #include "SkData.h" | 12 #include "SkData.h" |
| 12 #include "SkPixelRef.h" | 13 #include "SkPixelRef.h" |
| 13 #include "SkPtrRecorder.h" | 14 #include "SkPtrRecorder.h" |
| 14 #include "SkStream.h" | 15 #include "SkStream.h" |
| 15 #include "SkTypeface.h" | 16 #include "SkTypeface.h" |
| 16 | 17 |
| 17 SkWriteBuffer::SkWriteBuffer(uint32_t flags) | 18 SkWriteBuffer::SkWriteBuffer(uint32_t flags) |
| 18 : fFlags(flags) | 19 : fFlags(flags) |
| 19 , fFactorySet(NULL) | 20 , fFactorySet(NULL) |
| 20 , fNamedFactorySet(NULL) | 21 , fNamedFactorySet(NULL) |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // make room for the size of the flattened object | 313 // make room for the size of the flattened object |
| 313 (void)fWriter.reserve(sizeof(uint32_t)); | 314 (void)fWriter.reserve(sizeof(uint32_t)); |
| 314 // record the current size, so we can subtract after the object writes. | 315 // record the current size, so we can subtract after the object writes. |
| 315 size_t offset = fWriter.bytesWritten(); | 316 size_t offset = fWriter.bytesWritten(); |
| 316 // now flatten the object | 317 // now flatten the object |
| 317 flattenable->flatten(*this); | 318 flattenable->flatten(*this); |
| 318 size_t objSize = fWriter.bytesWritten() - offset; | 319 size_t objSize = fWriter.bytesWritten() - offset; |
| 319 // record the obj's size | 320 // record the obj's size |
| 320 fWriter.overwriteTAt(offset - sizeof(uint32_t), SkToU32(objSize)); | 321 fWriter.overwriteTAt(offset - sizeof(uint32_t), SkToU32(objSize)); |
| 321 } | 322 } |
| OLD | NEW |