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

Unified Diff: src/core/SkPicture.cpp

Issue 447753003: SkPicture: try to no-op away clone(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: new flag Created 6 years, 4 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 | no next file » | 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 0b7a1dbcc592702ec3cf9185f3bfcded0b32bf79..b402297f9c68a9b9474427131651e6ddfee98f9d 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -151,7 +151,9 @@ SkPicture::~SkPicture() {
#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE
// fRecord TODO, fix by deleting this method
SkPicture* SkPicture::clone() const {
-
+#ifdef SK_PICTURE_CLONE_NOOP
+ return SkRef(const_cast<SkPicture*>(this));
+#else
SkAutoTDelete<SkPictureData> newData;
if (fData.get()) {
@@ -204,6 +206,7 @@ SkPicture* SkPicture::clone() const {
clone->fUniqueID = this->uniqueID(); // need to call method to ensure != 0
return clone;
+#endif
}
#endif//SK_SUPPORT_LEGACY_PICTURE_CLONE
@@ -496,7 +499,7 @@ SkPicture::SkPicture(int width, int height, SkRecord* record)
}
// Note that we are assuming that this entry point will only be called from
-// one thread. Currently the only client of this method is
+// one thread. Currently the only client of this method is
// SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single
// thread.
void SkPicture::addDeletionListener(DeletionListener* listener) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698