Remode dead code from SkReadBuffer
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1845283002 Review URL: https://codereview.chromium.org/1845283002
This commit is contained in:
parent
9db0427423
commit
d19d83ce5e
@ -31,7 +31,6 @@ SkReadBuffer::SkReadBuffer() {
|
||||
fTFArray = nullptr;
|
||||
fTFCount = 0;
|
||||
|
||||
fFactoryTDArray = nullptr;
|
||||
fFactoryArray = nullptr;
|
||||
fFactoryCount = 0;
|
||||
fBitmapDecoder = nullptr;
|
||||
@ -50,7 +49,6 @@ SkReadBuffer::SkReadBuffer(const void* data, size_t size) {
|
||||
fTFArray = nullptr;
|
||||
fTFCount = 0;
|
||||
|
||||
fFactoryTDArray = nullptr;
|
||||
fFactoryArray = nullptr;
|
||||
fFactoryCount = 0;
|
||||
fBitmapDecoder = nullptr;
|
||||
@ -71,7 +69,6 @@ SkReadBuffer::SkReadBuffer(SkStream* stream) {
|
||||
fTFArray = nullptr;
|
||||
fTFCount = 0;
|
||||
|
||||
fFactoryTDArray = nullptr;
|
||||
fFactoryArray = nullptr;
|
||||
fFactoryCount = 0;
|
||||
fBitmapDecoder = nullptr;
|
||||
@ -350,17 +347,6 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
|
||||
return nullptr;
|
||||
}
|
||||
factory = fFactoryArray[index];
|
||||
} else if (fFactoryTDArray) {
|
||||
int32_t index = fReader.readU32();
|
||||
if (0 == index) {
|
||||
return nullptr; // writer failed to give us the flattenable
|
||||
}
|
||||
index -= 1; // we stored the index-base-1
|
||||
if ((unsigned)index >= (unsigned)fFactoryCount) {
|
||||
this->validate(false);
|
||||
return nullptr;
|
||||
}
|
||||
factory = (*fFactoryTDArray)[index];
|
||||
} else {
|
||||
factory = (SkFlattenable::Factory)readFunctionPtr();
|
||||
if (nullptr == factory) {
|
||||
@ -397,10 +383,6 @@ void SkReadBuffer::skipFlattenable() {
|
||||
if (0 == fReader.readU32()) {
|
||||
return;
|
||||
}
|
||||
} else if (fFactoryTDArray) {
|
||||
if (0 == fReader.readU32()) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (nullptr == this->readFunctionPtr()) {
|
||||
return;
|
||||
|
@ -199,22 +199,10 @@ public:
|
||||
* were created/written by the writer. SkPicture uses this.
|
||||
*/
|
||||
void setFactoryPlayback(SkFlattenable::Factory array[], int count) {
|
||||
fFactoryTDArray = nullptr;
|
||||
fFactoryArray = array;
|
||||
fFactoryCount = count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this with an initially empty array, so the reader can cache each
|
||||
* factory it sees by name. Used by the pipe code in conjunction with
|
||||
* SkWriteBuffer::setNamedFactoryRecorder.
|
||||
*/
|
||||
void setFactoryArray(SkTDArray<SkFlattenable::Factory>* array) {
|
||||
fFactoryTDArray = array;
|
||||
fFactoryArray = nullptr;
|
||||
fFactoryCount = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a function to decode an SkBitmap from encoded data. Only used if the writer
|
||||
* encoded the SkBitmap. If the proper decoder cannot be used, a red bitmap with the
|
||||
@ -244,7 +232,6 @@ private:
|
||||
SkTypeface** fTFArray;
|
||||
int fTFCount;
|
||||
|
||||
SkTDArray<SkFlattenable::Factory>* fFactoryTDArray;
|
||||
SkFlattenable::Factory* fFactoryArray;
|
||||
int fFactoryCount;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user