loolwsd/TileCache.cpp |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit d1a57455191c3e0ebe98229c8ec1fdf3fa1a2b76
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Wed Sep 21 18:47:00 2016 -0400

    loolwsd: TileBeingRendered now holds the original TileDesc
    
    Change-Id: I1c56e6b87703285ce55818aefd51ded3fefa3b74
    Reviewed-on: https://gerrit.libreoffice.org/29164
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index 4b2ac2d..88ece86 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -78,15 +78,18 @@ TileCache::~TileCache()
 struct TileCache::TileBeingRendered
 {
     std::vector<std::weak_ptr<ClientSession>> _subscribers;
-    TileBeingRendered(const std::string& cachedName, const int version)
+
+    TileBeingRendered(const std::string& cachedName, const TileDesc& tile)
      : _startTime(std::chrono::steady_clock::now()),
-       _cachedName(cachedName),
-       _ver(version)
+       _tile(tile),
+       _cachedName(cachedName)
     {
     }
 
+    const TileDesc& getTile() const { return _tile; }
     const std::string& getCacheName() const { return _cachedName; }
-    int getVersion() const { return _ver; }
+    int getVersion() const { return _tile.getVersion(); }
+    void setVersion(int version) { _tile.setVersion(version); }
 
     std::chrono::steady_clock::time_point getStartTime() const { return 
_startTime; }
     double getElapsedTimeMs() const { return 
std::chrono::duration_cast<std::chrono::milliseconds>
@@ -98,8 +101,8 @@ struct TileCache::TileBeingRendered
 
 private:
     std::chrono::steady_clock::time_point _startTime;
+    TileDesc _tile;
     std::string _cachedName;
-    int _ver;
 };
 
 std::shared_ptr<TileCache::TileBeingRendered> 
TileCache::findTileBeingRendered(const TileDesc& tileDesc)
@@ -457,7 +460,7 @@ int TileCache::subscribeToTileRendering(const TileDesc& 
tile, const std::shared_
 
         assert(_tilesBeingRendered.find(cachedName) == 
_tilesBeingRendered.end());
 
-        tileBeingRendered = std::make_shared<TileBeingRendered>(cachedName, 
tile.getVersion());
+        tileBeingRendered = std::make_shared<TileBeingRendered>(cachedName, 
tile);
         tileBeingRendered->_subscribers.push_back(subscriber);
         _tilesBeingRendered[cachedName] = tileBeingRendered;
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to