| Index: src/core/SkPicture.cpp
|
| diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
|
| index 3296264be8ab76ac666f0adf91f106bc5536dc7b..0d7773b520ed87e133019573ee7282e1a35b0267 100644
|
| --- a/src/core/SkPicture.cpp
|
| +++ b/src/core/SkPicture.cpp
|
| @@ -1,3 +1,4 @@
|
| +
|
| /*
|
| * Copyright 2007 The Android Open Source Project
|
| *
|
| @@ -453,41 +454,7 @@
|
| return SkNEW_ARGS(SkPictureData, (rec, info, false/*deep copy ops?*/));
|
| }
|
|
|
| -#ifdef SK_LEGACY_ENCODE_BITMAP
|
| -// Helper to support the EncodeBitmap version of serialize.
|
| -// Mimics the old behavior of always accepting the encoded data, and encoding
|
| -// using EncodeBitmap if there was no encoded data.
|
| -class EncodeBitmapSerializer : public SkPixelSerializer {
|
| -public:
|
| - explicit EncodeBitmapSerializer(SkPicture::EncodeBitmap encoder)
|
| - : fEncoder(encoder)
|
| - {
|
| - SkASSERT(fEncoder);
|
| - }
|
| -
|
| - virtual bool onUseEncodedData(const void*, size_t) SK_OVERRIDE { return true; }
|
| -
|
| - virtual SkData* onEncodePixels(const SkImageInfo& info, void* pixels,
|
| - size_t rowBytes) SK_OVERRIDE {
|
| - // Required by signature of EncodeBitmap.
|
| - size_t unused;
|
| - SkBitmap bm;
|
| - bm.installPixels(info, pixels, rowBytes);
|
| - return fEncoder(&unused, bm);
|
| - }
|
| -
|
| -private:
|
| - SkPicture::EncodeBitmap fEncoder;
|
| -};
|
| -
|
| -void SkPicture::serialize(SkWStream* wStream, SkPicture::EncodeBitmap encoder) const {
|
| - EncodeBitmapSerializer serializer(encoder);
|
| - this->serialize(wStream, &serializer);
|
| -}
|
| -
|
| -#endif
|
| -
|
| -void SkPicture::serialize(SkWStream* stream, SkPixelSerializer* pixelSerializer) const {
|
| +void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
|
| SkPictInfo info;
|
| this->createHeader(&info);
|
| SkAutoTDelete<SkPictureData> data(Backport(*fRecord, info, this->drawablePicts(),
|
| @@ -496,7 +463,7 @@
|
| stream->write(&info, sizeof(info));
|
| if (data) {
|
| stream->writeBool(true);
|
| - data->serialize(stream, pixelSerializer);
|
| + data->serialize(stream, encoder);
|
| } else {
|
| stream->writeBool(false);
|
| }
|
|
|