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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 316063005: Fix error revealed by Android unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix typo Created 6 years, 6 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
« no previous file with comments | « src/core/SkPicturePlayback.h ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.cpp
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index d57e30eeb14cdb0b3b97ae390d83e657e05fc751..3f83b6a9cccc7080ba3dd36555141e164e7b0bbd 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -58,7 +58,8 @@ SkPicturePlayback::SkPicturePlayback(const SkPicture* picture, const SkPictInfo&
SkPicturePlayback::SkPicturePlayback(const SkPicture* picture,
const SkPictureRecord& record,
- const SkPictInfo& info)
+ const SkPictInfo& info,
+ bool deepCopyOps)
: fPicture(picture)
, fInfo(info) {
#ifdef SK_DEBUG_SIZE
@@ -106,7 +107,12 @@ SkPicturePlayback::SkPicturePlayback(const SkPicture* picture,
fOpData = SkData::NewEmpty();
return;
}
- fOpData = writer.snapshotAsData();
+ if (deepCopyOps) {
+ // Don't try to do anything clever w.r.t. copy on write
+ fOpData = SkData::NewWithCopy(writer.contiguousArray(), writer.bytesWritten());
+ } else {
+ fOpData = writer.snapshotAsData();
+ }
fBoundingHierarchy = record.fBoundingHierarchy;
fStateTree = record.fStateTree;
« no previous file with comments | « src/core/SkPicturePlayback.h ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698