Chromium Code Reviews| Index: src/core/SkPicturePlayback.cpp |
| diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp |
| index e71a17fda51095ec44fa49d4e4aa6f81b2493b0b..1717e44b6a988072a8b8c01f5bd771dc81a9a95a 100644 |
| --- a/src/core/SkPicturePlayback.cpp |
| +++ b/src/core/SkPicturePlayback.cpp |
| @@ -28,7 +28,7 @@ SkPicturePlayback::SkPicturePlayback() { |
| this->init(); |
| } |
| -SkPicturePlayback::SkPicturePlayback(const SkPictureRecord& record, bool deepCopy) { |
| +SkPicturePlayback::SkPicturePlayback(SkPictureRecord& record, bool deepCopy) { |
| #ifdef SK_DEBUG_SIZE |
| size_t overallBytes, bitmapBytes, matricesBytes, |
| paintBytes, pathBytes, pictureBytes, regionBytes; |
| @@ -67,7 +67,7 @@ SkPicturePlayback::SkPicturePlayback(const SkPictureRecord& record, bool deepCop |
| #endif |
| record.validate(record.writeStream().bytesWritten(), 0); |
| - const SkWriter32& writer = record.writeStream(); |
| + SkWriter32& writer = record.writeStream(); |
| init(); |
| if (writer.bytesWritten() == 0) { |
| fOpData = SkData::NewEmpty(); |
| @@ -85,11 +85,8 @@ SkPicturePlayback::SkPicturePlayback(const SkPictureRecord& record, bool deepCop |
| } |
| { |
|
mtklein
2014/02/11 13:31:12
Not sure why we have this block around creating th
iancottrell
2014/02/11 13:44:06
Done. I presume it was to scope the old size and b
|
| - size_t size = writer.bytesWritten(); |
| - void* buffer = sk_malloc_throw(size); |
| - writer.flatten(buffer); |
| SkASSERT(!fOpData); |
| - fOpData = SkData::NewFromMalloc(buffer, size); |
| + fOpData = writer.detatchAsData(); |
| } |
| // copy over the refcnt dictionary to our reader |