aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-05-02 07:51:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-02 07:51:08 -0700
commit18f13f3673c20fec220a1594b3174f9dcab35c5d (patch)
treeee4ba2545f33bc08d5aa643e74ccacee88780cbb
parent3994c161ec5a2b83e8f6bab4d9c469eec2668d92 (diff)
Remove (almost) unused read/writeFunctionPtr API.
-rw-r--r--include/core/SkWriteBuffer.h1
-rw-r--r--src/core/SkReadBuffer.cpp18
-rw-r--r--src/core/SkReadBuffer.h8
-rw-r--r--src/core/SkValidatingReadBuffer.cpp10
-rw-r--r--src/core/SkValidatingReadBuffer.h1
-rw-r--r--tests/ImageFilterTest.cpp11
6 files changed, 3 insertions, 46 deletions
diff --git a/include/core/SkWriteBuffer.h b/include/core/SkWriteBuffer.h
index 1577ad04bc..66b325016f 100644
--- a/include/core/SkWriteBuffer.h
+++ b/include/core/SkWriteBuffer.h
@@ -54,7 +54,6 @@ public:
void writeUInt(uint32_t value);
void write32(int32_t value);
void writeString(const char* value);
- void writeFunctionPtr(void* ptr) { fWriter.writePtr(ptr); }
void writeFlattenable(const SkFlattenable* flattenable);
void writeColor(const SkColor& color);
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
index b0a371390b..ce87d51366 100644
--- a/src/core/SkReadBuffer.cpp
+++ b/src/core/SkReadBuffer.cpp
@@ -392,21 +392,3 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
}
return obj.release();
}
-
-/**
- * Needs to follow the same pattern as readFlattenable(), but explicitly skip whatever data
- * has been written.
- */
-void SkReadBuffer::skipFlattenable() {
- if (fFactoryCount > 0) {
- if (0 == fReader.readU32()) {
- return;
- }
- } else {
- if (nullptr == this->readFunctionPtr()) {
- return;
- }
- }
- uint32_t sizeRecorded = fReader.readU32();
- fReader.skip(sizeRecorded);
-}
diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h
index ae03a69042..607f7d843f 100644
--- a/src/core/SkReadBuffer.h
+++ b/src/core/SkReadBuffer.h
@@ -107,8 +107,6 @@ public:
bool eof() { return fReader.eof(); }
virtual const void* skip(size_t size) { return fReader.skip(size); }
- void* readFunctionPtr() { return fReader.readPtr(); }
-
// primitives
virtual bool readBool();
virtual SkColor readColor();
@@ -148,12 +146,6 @@ public:
sk_sp<SkShader> readShader() { return this->readFlattenable<SkShader>(); }
sk_sp<SkXfermode> readXfermode() { return this->readFlattenable<SkXfermode>(); }
- /**
- * Like readFlattenable() but explicitly just skips the data that was written for the
- * flattenable (or the sentinel that there wasn't one).
- */
- virtual void skipFlattenable();
-
// binary data and arrays
virtual bool readByteArray(void* value, size_t size);
virtual bool readColorArray(SkColor* colors, size_t size);
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp
index a27d42d82d..2779516889 100644
--- a/src/core/SkValidatingReadBuffer.cpp
+++ b/src/core/SkValidatingReadBuffer.cpp
@@ -281,13 +281,3 @@ SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type type)
}
return obj.release();
}
-
-void SkValidatingReadBuffer::skipFlattenable() {
- SkString name;
- this->readString(&name);
- if (fError) {
- return;
- }
- uint32_t sizeRecorded = this->readUInt();
- this->skip(sizeRecorded);
-}
diff --git a/src/core/SkValidatingReadBuffer.h b/src/core/SkValidatingReadBuffer.h
index cd2d0c1ebf..3729e72b29 100644
--- a/src/core/SkValidatingReadBuffer.h
+++ b/src/core/SkValidatingReadBuffer.h
@@ -45,7 +45,6 @@ public:
// common data structures
SkFlattenable* readFlattenable(SkFlattenable::Type type) override;
- void skipFlattenable() override;
void readPoint(SkPoint* point) override;
void readMatrix(SkMatrix* matrix) override;
void readIRect(SkIRect* rect) override;
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 56b3aaf5cd..592f5c6b86 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -65,9 +65,7 @@ protected:
}
void flatten(SkWriteBuffer& buffer) const override {
- this->INHERITED::flatten(buffer);
- buffer.writeFunctionPtr(fReporter);
- buffer.writeMatrix(fExpectedMatrix);
+ SkDEBUGFAIL("Should never get here");
}
private:
@@ -289,11 +287,8 @@ private:
}
sk_sp<SkFlattenable> MatrixTestImageFilter::CreateProc(SkReadBuffer& buffer) {
- SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
- skiatest::Reporter* reporter = (skiatest::Reporter*)buffer.readFunctionPtr();
- SkMatrix matrix;
- buffer.readMatrix(&matrix);
- return MatrixTestImageFilter::Make(reporter, matrix);
+ SkDEBUGFAIL("Should never get here");
+ return nullptr;
}
#ifndef SK_IGNORE_TO_STRING