diff options
author | brianosman <brianosman@google.com> | 2016-05-03 06:07:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-03 06:07:38 -0700 |
commit | 444f1ba1b7fcca7eca9fda839ca6b613ff31135e (patch) | |
tree | 331bcf74d3451c5fd2557d3f48a5ce6023351b56 /src/core/SkReadBuffer.cpp | |
parent | db1adf59890dfd50212ac217eaa2d04e70c0d37c (diff) |
Remove SkBitmapHeap and SkBitmapHeapReader. They're unused.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1938033002
Review-Url: https://codereview.chromium.org/1938033002
Diffstat (limited to 'src/core/SkReadBuffer.cpp')
-rw-r--r-- | src/core/SkReadBuffer.cpp | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp index ce87d51366..f55a5b043b 100644 --- a/src/core/SkReadBuffer.cpp +++ b/src/core/SkReadBuffer.cpp @@ -27,7 +27,6 @@ SkReadBuffer::SkReadBuffer() { fVersion = 0; fMemoryPtr = nullptr; - fBitmapStorage = nullptr; fTFArray = nullptr; fTFCount = 0; @@ -45,7 +44,6 @@ SkReadBuffer::SkReadBuffer(const void* data, size_t size) { fReader.setMemory(data, size); fMemoryPtr = nullptr; - fBitmapStorage = nullptr; fTFArray = nullptr; fTFCount = 0; @@ -65,7 +63,6 @@ SkReadBuffer::SkReadBuffer(SkStream* stream) { stream->read(fMemoryPtr, length); fReader.setMemory(fMemoryPtr, length); - fBitmapStorage = nullptr; fTFArray = nullptr; fTFCount = 0; @@ -79,7 +76,6 @@ SkReadBuffer::SkReadBuffer(SkStream* stream) { SkReadBuffer::~SkReadBuffer() { sk_free(fMemoryPtr); - SkSafeUnref(fBitmapStorage); } bool SkReadBuffer::readBool() { @@ -186,25 +182,15 @@ uint32_t SkReadBuffer::getArrayCount() { bool SkReadBuffer::readBitmap(SkBitmap* bitmap) { const int width = this->readInt(); const int height = this->readInt(); + // The writer stored a boolean value to determine whether an SkBitmapHeap was used during - // writing. + // writing. That feature is deprecated. if (this->readBool()) { - // An SkBitmapHeap was used for writing. Read the index from the stream and find the - // corresponding SkBitmap in fBitmapStorage. - const uint32_t index = this->readUInt(); - this->readUInt(); // bitmap generation ID (see SkWriteBuffer::writeBitmap) - if (fBitmapStorage) { - *bitmap = *fBitmapStorage->getBitmap(index); - fBitmapStorage->releaseRef(index); - return true; - } else { - // The bitmap was stored in a heap, but there is no way to access it. Set an error and - // fall through to use a place holder bitmap. - SkErrorInternals::SetError(kParseError_SkError, "SkWriteBuffer::writeBitmap " - "stored the SkBitmap in an SkBitmapHeap, but " - "SkReadBuffer has no SkBitmapHeapReader to " - "retrieve the SkBitmap."); - } + this->readUInt(); // Bitmap index + this->readUInt(); // Bitmap generation ID + SkErrorInternals::SetError(kParseError_SkError, "SkWriteBuffer::writeBitmap " + "stored the SkBitmap in an SkBitmapHeap, but " + "that feature is no longer supported."); } else { // The writer stored false, meaning the SkBitmap was not stored in an SkBitmapHeap. const size_t length = this->readUInt(); |