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>
This commit is contained in:
Mike Reed 2017-11-28 14:43:41 -05:00 committed by Skia Commit-Bot
parent 592c225b03
commit d395596165
4 changed files with 0 additions and 41 deletions

View File

@ -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;

View File

@ -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)));

View File

@ -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);

View File

@ -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;