aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPicturePlayback.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-06-27 12:34:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-27 12:34:44 -0700
commitd3e474e20c6f0f24ddb6b2643e92975d60190daa (patch)
treef2e39eab8d338bc80f524904de5ab15bd4e0df5e /src/core/SkPicturePlayback.cpp
parent67ec1f8eecfb48bc0a6ba04c0057f103c1c9696f (diff)
Deprecate SkPicture::clone().
Chrome will need -DSK_SUPPORT_LEGACY_PICTURE_CLONE. This removes the modes from our tools that use clone(). No bots run these. DM used clone() in a way that we can just share the picture now. I plan to bring back the ability to test multithreaded picture rendering soon. BUG=skia:2378 R=robertphillips@google.com, mtklein@google.com, bsalomon@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/338633011
Diffstat (limited to 'src/core/SkPicturePlayback.cpp')
-rw-r--r--src/core/SkPicturePlayback.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index c3f24b95e1..148237a5a8 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -168,6 +168,7 @@ SkPicturePlayback::SkPicturePlayback(const SkPictureRecord& record,
#endif
}
+#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE
SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInfo* deepCopyInfo)
: fInfo(src.fInfo) {
this->init();
@@ -223,6 +224,32 @@ SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInf
}
}
}
+#else
+SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src) : fInfo(src.fInfo) {
+ this->init();
+
+ fBitmapHeap.reset(SkSafeRef(src.fBitmapHeap.get()));
+ fPathHeap.reset(SkSafeRef(src.fPathHeap.get()));
+
+ fOpData = SkSafeRef(src.fOpData);
+
+ fBoundingHierarchy = src.fBoundingHierarchy;
+ fStateTree = src.fStateTree;
+ fContentInfo.set(src.fContentInfo);
+
+ SkSafeRef(fBoundingHierarchy);
+ SkSafeRef(fStateTree);
+
+ fBitmaps = SkSafeRef(src.fBitmaps);
+ fPaints = SkSafeRef(src.fPaints);
+
+ fPictureCount = src.fPictureCount;
+ fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount);
+ for (int i = 0; i < fPictureCount; i++) {
+ fPictureRefs[i] = SkRef(src.fPictureRefs[i]);
+ }
+}
+#endif//SK_SUPPORT_LEGACY_PICTURE_CLONE
void SkPicturePlayback::init() {
fBitmaps = NULL;