diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-02-14 20:01:43 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-02-14 21:46:39 +0100 |
commit | 36e9d5b376ce246e405901e584a5920a45064a18 (patch) | |
tree | 849d6b099a220e3192d5b255a2032066d4066ea1 /common | |
parent | b83ca07306cd93f0f70e1087ad6ba3fd2ed35348 (diff) |
TileCache: re-factor API to work in terms of vectors, not file references.
Change-Id: Ia9d48773121ab965b79ddb16b55b5d3fdcd7fd5c
Diffstat (limited to 'common')
-rw-r--r-- | common/MessageQueue.hpp | 1 | ||||
-rw-r--r-- | common/Unit.cpp | 9 | ||||
-rw-r--r-- | common/Unit.hpp | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/common/MessageQueue.hpp b/common/MessageQueue.hpp index d0a7e8054..74acc7ea8 100644 --- a/common/MessageQueue.hpp +++ b/common/MessageQueue.hpp @@ -125,7 +125,6 @@ private: std::vector<Payload> _queue; mutable std::mutex _mutex; std::condition_variable _cv; - }; typedef MessageQueueBase<std::vector<char>> MessageQueue; diff --git a/common/Unit.cpp b/common/Unit.cpp index 28dba3488..6221cd1e9 100644 --- a/common/Unit.cpp +++ b/common/Unit.cpp @@ -170,16 +170,13 @@ void UnitWSD::configure(Poco::Util::LayeredConfiguration &config) } void UnitWSD::lookupTile(int part, int width, int height, int tilePosX, int tilePosY, - int tileWidth, int tileHeight, std::unique_ptr<std::fstream>& cacheFile) + int tileWidth, int tileHeight, + std::shared_ptr<std::vector<char>> &tile) { - if (cacheFile && cacheFile->is_open()) - { + if (tile) onTileCacheHit(part, width, height, tilePosX, tilePosY, tileWidth, tileHeight); - } else - { onTileCacheMiss(part, width, height, tilePosX, tilePosY, tileWidth, tileHeight); - } } UnitKit::UnitKit() diff --git a/common/Unit.hpp b/common/Unit.hpp index 4d018b80b..2c390ad94 100644 --- a/common/Unit.hpp +++ b/common/Unit.hpp @@ -214,7 +214,8 @@ public: // ---------------- TileCache hooks ---------------- /// Called before the lookupTile call returns. Should always be called to fire events. virtual void lookupTile(int part, int width, int height, int tilePosX, int tilePosY, - int tileWidth, int tileHeight, std::unique_ptr<std::fstream>& cacheFile); + int tileWidth, int tileHeight, + std::shared_ptr<std::vector<char>> &tile); // ---------------- DocumentBroker hooks ---------------- virtual bool filterLoad(const std::string& /* sessionId */, |