diff options
author | Mike Reed <reed@google.com> | 2017-11-28 14:43:41 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-28 20:12:08 +0000 |
commit | d3955961655ab8a852332276474a6b841c26b35f (patch) | |
tree | 50c9f0cb96dd79ea974ad02d16038f4ac04f5cc5 | |
parent | 592c225b03ca677a1217eabdbc38eede6afcdb14 (diff) |
remove writeBitmap from SkWriteBuffer -- unused
Bug: skia:
Change-Id: I8809e7e138d64cc30389e8efc76265011b287611
Reviewed-on: https://skia-review.googlesource.com/77060
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
-rw-r--r-- | include/core/SkWriteBuffer.h | 2 | ||||
-rw-r--r-- | src/core/SkWriteBuffer.cpp | 32 | ||||
-rw-r--r-- | tools/debugger/SkJsonWriteBuffer.cpp | 6 | ||||
-rw-r--r-- | tools/debugger/SkJsonWriteBuffer.h | 1 |
4 files changed, 0 insertions, 41 deletions
diff --git a/include/core/SkWriteBuffer.h b/include/core/SkWriteBuffer.h index 48c09eaf27..b2db00873a 100644 --- a/include/core/SkWriteBuffer.h +++ b/include/core/SkWriteBuffer.h @@ -59,7 +59,6 @@ public: virtual void writeRegion(const SkRegion& region) = 0; virtual void writePath(const SkPath& path) = 0; virtual size_t writeStream(SkStream* stream, size_t length) = 0; - virtual void writeBitmap(const SkBitmap& bitmap) = 0; virtual void writeImage(const SkImage*) = 0; virtual void writeTypeface(SkTypeface* typeface) = 0; virtual void writePaint(const SkPaint& paint) = 0; @@ -132,7 +131,6 @@ public: void writeRegion(const SkRegion& region) override; void writePath(const SkPath& path) override; size_t writeStream(SkStream* stream, size_t length) override; - void writeBitmap(const SkBitmap& bitmap) override; void writeImage(const SkImage*) override; void writeTypeface(SkTypeface* typeface) override; void writePaint(const SkPaint& paint) override; diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp index 43a63c9638..45f3ccaedd 100644 --- a/src/core/SkWriteBuffer.cpp +++ b/src/core/SkWriteBuffer.cpp @@ -137,38 +137,6 @@ static void write_encoded_bitmap(SkBinaryWriteBuffer* buffer, SkData* data, buffer->write32(origin.fY); } -void SkBinaryWriteBuffer::writeBitmap(const SkBitmap& bitmap) { - // Record the width and height. This way if readBitmap fails a dummy bitmap can be drawn at the - // right size. - this->writeInt(bitmap.width()); - this->writeInt(bitmap.height()); - - // Record information about the bitmap in one of two ways, in order of priority: - // 1. If there is a function for encoding bitmaps, use it to write an encoded version of the - // bitmap. After writing a boolean value of false, signifying that a heap was not used, write - // the size of the encoded data. A non-zero size signifies that encoded data was written. - // 2. Call SkBitmap::flatten. After writing a boolean value of false, signifying that a heap was - // not used, write a zero to signify that the data was not encoded. - - // Write a bool to indicate that we did not use an SkBitmapHeap. That feature is deprecated. - this->writeBool(false); - - // see if the caller wants to manually encode - SkPixmap result; - if (fPixelSerializer && bitmap.peekPixels(&result)) { - sk_sp<SkData> data = fPixelSerializer->encodeToData(result); - if (data) { - // if we have to "encode" the bitmap, then we assume there is no - // offset to share, since we are effectively creating a new pixelref - write_encoded_bitmap(this, data.get(), SkIPoint::Make(0, 0)); - return; - } - } - - this->writeUInt(0); // signal raw pixels - SkBitmap::WriteRawPixels(this, bitmap); -} - void SkBinaryWriteBuffer::writeImage(const SkImage* image) { if (fDeduper) { this->write32(fDeduper->findOrDefineImage(const_cast<SkImage*>(image))); diff --git a/tools/debugger/SkJsonWriteBuffer.cpp b/tools/debugger/SkJsonWriteBuffer.cpp index 4b075dd2f2..bdabc8aea5 100644 --- a/tools/debugger/SkJsonWriteBuffer.cpp +++ b/tools/debugger/SkJsonWriteBuffer.cpp @@ -134,12 +134,6 @@ size_t SkJsonWriteBuffer::writeStream(SkStream* stream, size_t length) { return 0; } -void SkJsonWriteBuffer::writeBitmap(const SkBitmap& bitmap) { - Json::Value jsonBitmap; - SkDrawCommand::flatten(bitmap, &jsonBitmap, *fUrlDataManager); - this->append("bitmap", jsonBitmap); -} - void SkJsonWriteBuffer::writeImage(const SkImage* image) { Json::Value jsonImage; SkDrawCommand::flatten(*image, &jsonImage, *fUrlDataManager); diff --git a/tools/debugger/SkJsonWriteBuffer.h b/tools/debugger/SkJsonWriteBuffer.h index a0cf4e720b..c1a72313e0 100644 --- a/tools/debugger/SkJsonWriteBuffer.h +++ b/tools/debugger/SkJsonWriteBuffer.h @@ -45,7 +45,6 @@ public: void writeRegion(const SkRegion& region) override; void writePath(const SkPath& path) override; size_t writeStream(SkStream* stream, size_t length) override; - void writeBitmap(const SkBitmap& bitmap) override; void writeImage(const SkImage*) override; void writeTypeface(SkTypeface* typeface) override; void writePaint(const SkPaint& paint) override; |