loolwsd/DocumentBroker.cpp |   29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

New commits:
commit 7a8248875dcf6627e302b918c105438673ed0112
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Fri Sep 2 07:29:59 2016 -0400

    loolwsd: don't combine tiles by row to allow for better culling
    
    Reviewed-on: https://gerrit.libreoffice.org/28615
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>
    (cherry picked from commit 99d0ee2ac111e7199626f6c17fb7ce723dac9126)
    
    Change-Id: Ibfe6b7430cbdf78bc13b42d19789ce23226a5a5a
    Reviewed-on: https://gerrit.libreoffice.org/29064
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index cd4639f..709c2a0 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -549,8 +549,7 @@ void 
DocumentBroker::handleTileCombinedRequest(TileCombined& tileCombined,
     Log::trace() << "TileCombined request for " << tileCombined.serialize() << 
Log::end;
 
     // Satisfy as many tiles from the cache.
-    // The rest, group by rows.
-    std::map<int, std::vector<TileDesc>> rows;
+    std::vector<TileDesc> tiles;
     for (auto& tile : tileCombined.getTiles())
     {
         std::unique_ptr<std::fstream> cachedTile = 
_tileCache->lookupTile(tile);
@@ -604,34 +603,16 @@ void 
DocumentBroker::handleTileCombinedRequest(TileCombined& tileCombined,
             }
         }
 
-        const auto tilePosY = tile.getTilePosY();
-        auto it = rows.lower_bound(tilePosY);
-        if (it != rows.end())
-        {
-            it->second.emplace_back(tile);
-        }
-        else
-        {
-            rows.emplace_hint(it, tilePosY, std::vector<TileDesc>({ tile }));
-        }
+        tiles.push_back(tile);
     }
 
-    if (rows.empty())
+    for (auto& tile : tiles)
     {
-        // Done.
-        return;
-    }
-
-    auto& tiles = tileCombined.getTiles();
-    for (auto& row : rows)
-    {
-        tiles = row.second;
-        const auto tileMsg = tileCombined.serialize();
+        const auto tileMsg = tile.serialize("tile ");
         Log::debug() << "TileCombined residual request for " << tileMsg << 
Log::end;
 
         // Forward to child to render.
-        const std::string request = "tilecombine " + tileMsg;
-        _childProcess->getWebSocket()->sendFrame(request.data(), 
request.size());
+        _childProcess->getWebSocket()->sendFrame(tileMsg.data(), 
tileMsg.size());
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to