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

Unified Diff: src/core/SkPicture.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 | « no previous file | src/core/SkPicturePlayback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index c2c8aaf57251e8851ca7bc124875a985ef47fa51..7120f611791d1632b7dc2ccb2c800d44da868756 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -137,7 +137,13 @@ SkPicturePlayback* SkPicture::FakeEndRecording(const SkPicture* resourceSrc,
const SkPictureRecord& record) {
SkPictInfo info;
resourceSrc->createHeader(&info);
- return SkNEW_ARGS(SkPicturePlayback, (resourceSrc, record, info));
+
+ // FakeEndRecording is only called from partialReplay. For that use case
+ // we cannot be certain that the next call to SkWriter32::overwriteTAt
+ // will be preceded by an append (i.e., that the required copy on write
+ // will occur). In this case just force a deep copy of the operations.
+ const bool deepCopyOps = true;
+ return SkNEW_ARGS(SkPicturePlayback, (resourceSrc, record, info, deepCopyOps));
}
SkPicture::SkPicture(const SkPicture& src)
« no previous file with comments | « no previous file | src/core/SkPicturePlayback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698