| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkBitmapSource.h" | 9 #include "SkBitmapSource.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 376 |
| 377 // Serialize picture | 377 // Serialize picture |
| 378 SkWriteBuffer writer(SkWriteBuffer::kValidation_Flag); | 378 SkWriteBuffer writer(SkWriteBuffer::kValidation_Flag); |
| 379 pict->flatten(writer); | 379 pict->flatten(writer); |
| 380 size_t size = writer.bytesWritten(); | 380 size_t size = writer.bytesWritten(); |
| 381 void* data = sk_malloc_throw(size); | 381 void* data = sk_malloc_throw(size); |
| 382 writer.writeToMemory(data); | 382 writer.writeToMemory(data); |
| 383 | 383 |
| 384 // Deserialize picture | 384 // Deserialize picture |
| 385 SkValidatingReadBuffer reader(data, size); | 385 SkValidatingReadBuffer reader(data, size); |
| 386 SkPicture* readPict(SkPicture::CreateFromBuffer(reader)); | 386 SkAutoTUnref<SkPicture> readPict( |
| 387 REPORTER_ASSERT(reporter, NULL != readPict); | 387 SkPicture::CreateFromBuffer(reader)); |
| 388 REPORTER_ASSERT(reporter, NULL != readPict.get()); |
| 388 } | 389 } |
| 389 } | 390 } |
| OLD | NEW |