diff options
author | 2014-09-30 11:14:38 -0700 | |
---|---|---|
committer | 2014-09-30 11:14:38 -0700 | |
commit | 5bc760a6a6a61ff462a204e0c051ad6147760223 (patch) | |
tree | b3c7d7a609839549fed8833ddd6f13409ab6c020 /src | |
parent | 7874dc8e717036f97f14f87daa9431d6f611e467 (diff) |
Remove support for SkPicture::clone().
This folds SK_SUPPORT_LEGACY_PICTURE_CLONE through as undefined.
Chrome's not used clone() for a month or two, and we don't use it ourselves.
Don't think Android ever did.
CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot
BUG=skia:
R=reed@google.com, mtklein@google.com, robertphillips@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/620533002
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPicture.cpp | 7 | ||||
-rw-r--r-- | src/core/SkPictureData.cpp | 56 | ||||
-rw-r--r-- | src/core/SkPictureData.h | 18 |
3 files changed, 0 insertions, 81 deletions
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index 19ff36d5a6..eab0b927ab 100644 --- a/src/core/SkPicture.cpp +++ b/src/core/SkPicture.cpp @@ -280,13 +280,6 @@ SkPicture::~SkPicture() { } // fRecord OK -#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE -SkPicture* SkPicture::clone() const { - return SkRef(const_cast<SkPicture*>(this)); -} -#endif//SK_SUPPORT_LEGACY_PICTURE_CLONE - -// fRecord OK void SkPicture::EXPERIMENTAL_addAccelData(const SkPicture::AccelData* data) const { fAccelData.reset(SkRef(data)); } diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp index fbef0e8e55..877c3f4c33 100644 --- a/src/core/SkPictureData.cpp +++ b/src/core/SkPictureData.cpp @@ -89,62 +89,6 @@ SkPictureData::SkPictureData(const SkPictureRecord& record, } } -#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE -SkPictureData::SkPictureData(const SkPictureData& src, SkPictCopyInfo* deepCopyInfo) - : 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); - - if (deepCopyInfo) { - int paintCount = SafeCount(src.fPaints); - - if (src.fBitmaps) { - fBitmaps = SkTRefArray<SkBitmap>::Create(src.fBitmaps->begin(), src.fBitmaps->count()); - } - - fPaints = SkTRefArray<SkPaint>::Create(paintCount); - SkASSERT(deepCopyInfo->paintData.count() == paintCount); - SkBitmapHeap* bmHeap = deepCopyInfo->controller.getBitmapHeap(); - SkTypefacePlayback* tfPlayback = deepCopyInfo->controller.getTypefacePlayback(); - for (int i = 0; i < paintCount; i++) { - if (deepCopyInfo->paintData[i]) { - deepCopyInfo->paintData[i]->unflatten<SkPaintFlatteningTraits>( - &fPaints->writableAt(i), bmHeap, tfPlayback); - } else { - // needs_deep_copy was false, so just need to assign - fPaints->writableAt(i) = src.fPaints->at(i); - } - } - - } else { - fBitmaps = SkSafeRef(src.fBitmaps); - fPaints = SkSafeRef(src.fPaints); - } - - fPictureCount = src.fPictureCount; - fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); - for (int i = 0; i < fPictureCount; i++) { - if (deepCopyInfo) { - fPictureRefs[i] = src.fPictureRefs[i]->clone(); - } else { - fPictureRefs[i] = src.fPictureRefs[i]; - fPictureRefs[i]->ref(); - } - } -} -#endif//SK_SUPPORT_LEGACY_PICTURE_CLONE - void SkPictureData::init() { fBitmaps = NULL; fPaints = NULL; diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h index d2b5b4af67..b875151b50 100644 --- a/src/core/SkPictureData.h +++ b/src/core/SkPictureData.h @@ -57,24 +57,8 @@ struct SkPictInfo { // Always write this guy last (with no length field afterwards) #define SK_PICT_EOF_TAG SkSetFourByteTag('e', 'o', 'f', ' ') -#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE -/** - * Container for data that is needed to deep copy a SkPicture. The container - * enables the data to be generated once and reused for subsequent copies. - */ -struct SkPictCopyInfo { - SkPictCopyInfo() : controller(1024) {} - - SkChunkFlatController controller; - SkTDArray<SkFlatData*> paintData; -}; -#endif - class SkPictureData { public: -#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE - SkPictureData(const SkPictureData& src, SkPictCopyInfo* deepCopyInfo = NULL); -#endif SkPictureData(const SkPictureRecord& record, const SkPictInfo&, bool deepCopyOps); static SkPictureData* CreateFromStream(SkStream*, const SkPictInfo&, @@ -166,8 +150,6 @@ public: #endif private: - friend class SkPicture; // needed in SkPicture::clone (rm when it is removed) - void init(); // these help us with reading/writing |