aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkReadBuffer.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-11-28 15:23:45 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-28 20:45:27 +0000
commit725d9dbfa59d6804b157f876a7e5d4c0553c6455 (patch)
tree4285b914ab41c91c8abbcfec1235707f13ac2ce0 /src/core/SkReadBuffer.cpp
parent9c1c892af7bcdebfa4c2affdd430b5c9482ec86f (diff)
remove unused readBitmapAsImage from readbuffer
Bug: skia: Change-Id: Ic200ec39999a06f407de29e15b646baddb9e341d Reviewed-on: https://skia-review.googlesource.com/76982 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkReadBuffer.cpp')
-rw-r--r--src/core/SkReadBuffer.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
index b9bcdd4550..318785b479 100644
--- a/src/core/SkReadBuffer.cpp
+++ b/src/core/SkReadBuffer.cpp
@@ -222,52 +222,6 @@ uint32_t SkReadBuffer::getArrayCount() {
return *(uint32_t*)fReader.peek();
}
-sk_sp<SkImage> SkReadBuffer::readBitmapAsImage() {
- 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. That feature is deprecated.
- if (this->readBool()) {
- this->readUInt(); // Bitmap index
- this->readUInt(); // Bitmap generation ID
- // Old unsupported SkBitmapHeap format. No longer supported.
- } else {
- // The writer stored false, meaning the SkBitmap was not stored in an SkBitmapHeap.
- const size_t length = this->readUInt();
- if (length > 0) {
-#ifdef DEBUG_NON_DETERMINISTIC_ASSERT
- fDecodedBitmapIndex++;
-#endif // DEBUG_NON_DETERMINISTIC_ASSERT
- // A non-zero size means the SkBitmap was encoded. Read the data and pixel
- // offset.
- const void* data = this->skip(length);
- const int32_t xOffset = this->readInt();
- const int32_t yOffset = this->readInt();
- SkIRect subset = SkIRect::MakeXYWH(xOffset, yOffset, width, height);
- sk_sp<SkImage> image = fImageDeserializer->makeFromMemory(data, length, &subset);
- if (image) {
- return image;
- }
-
- // This bitmap was encoded when written, but we are unable to
- // decode, possibly due to not having a decoder. Even though we
- // weren't able to decode the pixels, the readbuffer should still
- // be intact, so we return true with an empty bitmap, so we don't
- // force an abort of the larger deserialize.
- return MakeEmptyImage(width, height);
- } else {
- SkBitmap bitmap;
- if (SkBitmap::ReadRawPixels(this, &bitmap)) {
- bitmap.setImmutable();
- return SkImage::MakeFromBitmap(bitmap);
- }
- }
- }
- // Could not read the SkBitmap. Use a placeholder bitmap.
- return nullptr;
-}
-
sk_sp<SkImage> SkReadBuffer::readImage() {
if (fInflator) {
SkImage* img = fInflator->getImage(this->read32());