diff options
author | reed <reed@chromium.org> | 2014-12-20 15:23:55 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-20 15:23:55 -0800 |
commit | 5e8b1688eeaa343848d255daee2b1fc26eb54f57 (patch) | |
tree | d02f7cb31f22e988acc9cb3df23d5759d1d14df7 | |
parent | f53ff623fa912118774098be4dd1dbbd340dda37 (diff) |
remove dead SK_LEGACY_ENCODE_BITMAP flag
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/820903002
-rw-r--r-- | include/core/SkPicture.h | 13 | ||||
-rw-r--r-- | src/core/SkPicture.cpp | 34 |
2 files changed, 0 insertions, 47 deletions
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index f38df4f17d..368eac539a 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -36,8 +36,6 @@ namespace SkRecords { class CollectLayers; }; -//#define SK_LEGACY_ENCODE_BITMAP - /** \class SkPicture The SkPicture class records the drawing commands made to a canvas, to @@ -139,17 +137,6 @@ public: */ typedef SkData* (*EncodeBitmap)(size_t* pixelRefOffset, const SkBitmap& bm); -#ifdef SK_LEGACY_ENCODE_BITMAP - /** - * Serialize to a stream. If non NULL, encoder will be used to encode - * any bitmaps in the picture. - * encoder will never be called with a NULL pixelRefOffset. - * DEPRECATED - use serialize(SkWStream*, SkPixelSerializer* serializer) - * instead. - */ - void serialize(SkWStream* wStream, EncodeBitmap encoder) const; -#endif - /** * Serialize to a stream. If non NULL, serializer will be used to serialize * any bitmaps in the picture. diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index d110e295b1..63f32e650b 100644 --- a/src/core/SkPicture.cpp +++ b/src/core/SkPicture.cpp @@ -453,40 +453,6 @@ SkPictureData* SkPicture::Backport(const SkRecord& src, const SkPictInfo& info, 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); - } - - bool onUseEncodedData(const void*, size_t) SK_OVERRIDE { return true; } - - SkData* onEncodePixels(const SkImageInfo& info, const void* pixels, - size_t rowBytes) SK_OVERRIDE { - // Required by signature of EncodeBitmap. - size_t unused; - SkBitmap bm; - bm.installPixels(info, const_cast<void*>(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 { SkPictInfo info; this->createHeader(&info); |