Chromium Code Reviews| Index: src/core/SkReadBuffer.cpp |
| diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp |
| index ce87d513661dace26852094b9fb6910e01ced112..480d29e53bc14349143a682281a9f53d151c3426 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,13 @@ 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."); |
| - } |
| + SkErrorInternals::SetError(kParseError_SkError, "SkWriteBuffer::writeBitmap " |
|
Brian Osman
2016/05/02 17:06:22
I couldn't figure out how recently setBitmapHeap w
mtklein
2016/05/02 18:14:14
It looks like we were at picture version 39 when w
|
| + "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(); |