Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 167113003: Add capture snapshot as data to SkWriter32, use it to optimise record->playback. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Mutex protect snapshot creation Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkPicturePlayback.cpp
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index b546d397c04617570c7534c1ed338f451abc0af0..f79eb42b9c413feea2ec52d3832384a4b7f10b86 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -84,13 +84,8 @@ SkPicturePlayback::SkPicturePlayback(const SkPictureRecord& record, bool deepCop
fBoundingHierarchy->flushDeferredInserts();
}
- {
- size_t size = writer.bytesWritten();
- void* buffer = sk_malloc_throw(size);
- writer.flatten(buffer);
- SkASSERT(!fOpData);
- fOpData = SkData::NewFromMalloc(buffer, size);
- }
+ SkASSERT(!fOpData);
+ fOpData = writer.snapshotAsData();
mtklein 2014/03/06 18:58:08 Moving this up to / merge this with the other part
iancottrell 2014/03/06 21:31:52 Done.
// copy over the refcnt dictionary to our reader
record.fFlattenableHeap.setupPlaybacks();

Powered by Google App Engine
This is Rietveld 408576698