diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPictureFlat.cpp | 7 | ||||
-rw-r--r-- | src/core/SkPictureFlat.h | 16 | ||||
-rw-r--r-- | src/core/SkWriteBuffer.cpp | 24 |
3 files changed, 1 insertions, 46 deletions
diff --git a/src/core/SkPictureFlat.cpp b/src/core/SkPictureFlat.cpp index 71f39ea0f9..792345885c 100644 --- a/src/core/SkPictureFlat.cpp +++ b/src/core/SkPictureFlat.cpp @@ -63,13 +63,11 @@ SkFlatController::SkFlatController(uint32_t writeBufferFlags) : fBitmapHeap(nullptr) , fTypefaceSet(nullptr) , fTypefacePlayback(nullptr) -, fFactorySet(nullptr) , fWriteBufferFlags(writeBufferFlags) {} SkFlatController::~SkFlatController() { SkSafeUnref(fBitmapHeap); SkSafeUnref(fTypefaceSet); - SkSafeUnref(fFactorySet); } void SkFlatController::setBitmapHeap(SkBitmapHeap* heap) { @@ -83,8 +81,3 @@ void SkFlatController::setTypefaceSet(SkRefCntSet *set) { void SkFlatController::setTypefacePlayback(SkTypefacePlayback* playback) { fTypefacePlayback = playback; } - -SkNamedFactorySet* SkFlatController::setNamedFactorySet(SkNamedFactorySet* set) { - SkRefCnt_SafeAssign(fFactorySet, set); - return set; -} diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h index 73103c69f0..cd750bffab 100644 --- a/src/core/SkPictureFlat.h +++ b/src/core/SkPictureFlat.h @@ -230,12 +230,6 @@ public: SkTypefacePlayback* getTypefacePlayback() { return fTypefacePlayback; } /** - * Optional factory recorder used during creation of SkFlatData objects. Set - * using the protected method setNamedFactorySet. - */ - SkNamedFactorySet* getNamedFactorySet() { return fFactorySet; } - - /** * Flags to use during creation of SkFlatData objects. Defaults to zero. */ uint32_t getWriteBufferFlags() { return fWriteBufferFlags; } @@ -259,18 +253,10 @@ protected: */ void setTypefacePlayback(SkTypefacePlayback*); - /** - * Set an SkNamedFactorySet to be used to store Factorys and their - * corresponding names during flattening. Ref counted. Returns the same - * set as a convenience. - */ - SkNamedFactorySet* setNamedFactorySet(SkNamedFactorySet*); - private: SkBitmapHeap* fBitmapHeap; SkRefCntSet* fTypefaceSet; SkTypefacePlayback* fTypefacePlayback; - SkNamedFactorySet* fFactorySet; const uint32_t fWriteBufferFlags; typedef SkRefCnt INHERITED; @@ -287,7 +273,6 @@ public: buffer.setBitmapHeap(controller->getBitmapHeap()); buffer.setTypefaceRecorder(controller->getTypefaceSet()); - buffer.setNamedFactoryRecorder(controller->getNamedFactorySet()); Traits::Flatten(buffer, obj); size_t size = buffer.bytesWritten(); @@ -498,7 +483,6 @@ private: SkASSERT(fController->getBitmapHeap() != nullptr); fScratch.setBitmapHeap(fController->getBitmapHeap()); fScratch.setTypefaceRecorder(fController->getTypefaceSet()); - fScratch.setNamedFactoryRecorder(fController->getNamedFactorySet()); fReady = true; } diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp index c33a7aec52..1674b931ee 100644 --- a/src/core/SkWriteBuffer.cpp +++ b/src/core/SkWriteBuffer.cpp @@ -17,7 +17,6 @@ SkWriteBuffer::SkWriteBuffer(uint32_t flags) : fFlags(flags) , fFactorySet(nullptr) - , fNamedFactorySet(nullptr) , fBitmapHeap(nullptr) , fTFSet(nullptr) { } @@ -25,7 +24,6 @@ SkWriteBuffer::SkWriteBuffer(uint32_t flags) SkWriteBuffer::SkWriteBuffer(void* storage, size_t storageSize, uint32_t flags) : fFlags(flags) , fFactorySet(nullptr) - , fNamedFactorySet(nullptr) , fWriter(storage, storageSize) , fBitmapHeap(nullptr) , fTFSet(nullptr) { @@ -33,7 +31,6 @@ SkWriteBuffer::SkWriteBuffer(void* storage, size_t storageSize, uint32_t flags) SkWriteBuffer::~SkWriteBuffer() { SkSafeUnref(fFactorySet); - SkSafeUnref(fNamedFactorySet); SkSafeUnref(fBitmapHeap); SkSafeUnref(fTFSet); } @@ -233,19 +230,6 @@ void SkWriteBuffer::writeTypeface(SkTypeface* obj) { SkFactorySet* SkWriteBuffer::setFactoryRecorder(SkFactorySet* rec) { SkRefCnt_SafeAssign(fFactorySet, rec); - if (fNamedFactorySet != nullptr) { - fNamedFactorySet->unref(); - fNamedFactorySet = nullptr; - } - return rec; -} - -SkNamedFactorySet* SkWriteBuffer::setNamedFactoryRecorder(SkNamedFactorySet* rec) { - SkRefCnt_SafeAssign(fNamedFactorySet, rec); - if (fFactorySet != nullptr) { - fFactorySet->unref(); - fFactorySet = nullptr; - } return rec; } @@ -286,7 +270,7 @@ void SkWriteBuffer::writeFlattenable(const SkFlattenable* flattenable) { if (nullptr == flattenable) { if (this->isValidating()) { this->writeString(""); - } else if (fFactorySet != nullptr || fNamedFactorySet != nullptr) { + } else if (fFactorySet != nullptr) { this->write32(0); } else { this->writeFunctionPtr(nullptr); @@ -313,12 +297,6 @@ void SkWriteBuffer::writeFlattenable(const SkFlattenable* flattenable) { this->writeString(flattenable->getTypeName()); } else if (fFactorySet) { this->write32(fFactorySet->add(factory)); - } else if (fNamedFactorySet) { - int32_t index = fNamedFactorySet->find(factory); - this->write32(index); - if (0 == index) { - return; - } } else { this->writeFunctionPtr((void*)factory); } |