Delete unused fNamedFactorySet from SkWriteBuffer

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1903483002

Review URL: https://codereview.chromium.org/1903483002
This commit is contained in:
msarett 2016-04-19 07:27:58 -07:00 committed by Commit bot
parent 3c920243f8
commit be991efbd9
4 changed files with 1 additions and 49 deletions

View File

@ -21,7 +21,6 @@ class SkBitmap;
class SkBitmapHeap;
class SkFactorySet;
class SkFlattenable;
class SkNamedFactorySet;
class SkRefCntSet;
class SkWriteBuffer {
@ -81,7 +80,6 @@ public:
void writeToMemory(void* dst) { fWriter.flatten(dst); }
SkFactorySet* setFactoryRecorder(SkFactorySet*);
SkNamedFactorySet* setNamedFactoryRecorder(SkNamedFactorySet*);
SkRefCntSet* getTypefaceRecorder() const { return fTFSet; }
SkRefCntSet* setTypefaceRecorder(SkRefCntSet*);
@ -114,7 +112,6 @@ private:
const uint32_t fFlags;
SkFactorySet* fFactorySet;
SkNamedFactorySet* fNamedFactorySet;
SkWriter32 fWriter;
SkBitmapHeap* fBitmapHeap;

View File

@ -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;
}

View File

@ -229,12 +229,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.
*/
@ -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;
}

View File

@ -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);
}