From 021e1ae596440cfdee5ffe75907b76069ae44307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 20 Feb 2018 15:06:26 +0100 Subject: [core] introduce Blob for compressed and uncompressed data - Blob is a wrapper type for a shared_ptr that has accessor functions for getting compressed and uncompressed data - Moved util::writeFile, util::readFile, util::compress, util::uncompress, decodeImage, and encodePNG to the Blob interface - Added Blob support to Request and file sources - Added Blob support to VectorTile objects - Added support for gzip decoding to util::uncompress - We're no longer compressing WebP, PNG, and JPEG data when storing in the OfflineDatabase - Android's HTTPRequest returns compressed Blobs by default One caveat is that our previous decompress function didn't support gzip, so once users upgrade to this version, their offline cache may contain both zlib-compressed data and gzip-compressed data, but older versions won't be able to decompress gzip data. On the other hand, we don't support downgrading SDKs anyway, so this shouldn't be a problem. To be on the safe side, we could bump the user_version of the SQLite DB. --- src/mbgl/sprite/sprite_loader_worker.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mbgl/sprite/sprite_loader_worker.hpp') diff --git a/src/mbgl/sprite/sprite_loader_worker.hpp b/src/mbgl/sprite/sprite_loader_worker.hpp index d61e07d14f..4f2e38be29 100644 --- a/src/mbgl/sprite/sprite_loader_worker.hpp +++ b/src/mbgl/sprite/sprite_loader_worker.hpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -14,7 +15,7 @@ class SpriteLoaderWorker { public: SpriteLoaderWorker(ActorRef, ActorRef); - void parse(std::shared_ptr image, std::shared_ptr json); + void parse(Blob image, Blob json); private: ActorRef parent; -- cgit v1.2.1