loleaflet/src/layer/tile/GridLayer.js |   49 ++++++++++++++++++----------------
 wsd/ClientSession.cpp                 |    5 +++
 2 files changed, 31 insertions(+), 23 deletions(-)

New commits:
commit 9473908d45a884827356b504c5f768e2f29cc46b
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Sun Aug 26 06:11:08 2018 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Sun Aug 26 06:52:21 2018 +0200

    loleaflet: Request invalid tiles too by view change
    
    Change-Id: I43c65ce025d3b18bd664d2ad16107cf828bab300

diff --git a/loleaflet/src/layer/tile/GridLayer.js 
b/loleaflet/src/layer/tile/GridLayer.js
index dc77255e9..ca4103077 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -532,7 +532,8 @@ L.GridLayer = L.Layer.extend({
 
                                key = this._tileCoordsToKey(coords);
                                var tile = this._tiles[key];
-                               if (tile) {
+                               var invalid = tile && tile._invalidCount && 
tile._invalidCount > 0;
+                               if (tile && tile.loaded && !invalid) {
                                        tile.current = true;
                                        newView = false;
                                } else {
@@ -866,34 +867,36 @@ L.GridLayer = L.Layer.extend({
                        key = this._tileCoordsToKey(coords);
 
                        if (coords.part === this._selectedPart) {
-                               var tile = 
this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, 
coords));
+                               if (!this._tiles[key]) {
+                                       var tile = 
this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, 
coords));
 
-                               this._initTile(tile);
+                                       this._initTile(tile);
 
-                               // if createTile is defined with a second 
argument ("done" callback),
-                               // we know that tile is async and will be ready 
later; otherwise
-                               if (this.createTile.length < 2) {
-                                       // mark tile as ready, but delay one 
frame for opacity animation to happen
-                                       setTimeout(L.bind(this._tileReady, 
this, coords, null, tile), 0);
-                               }
+                                       // if createTile is defined with a 
second argument ("done" callback),
+                                       // we know that tile is async and will 
be ready later; otherwise
+                                       if (this.createTile.length < 2) {
+                                               // mark tile as ready, but 
delay one frame for opacity animation to happen
+                                               
setTimeout(L.bind(this._tileReady, this, coords, null, tile), 0);
+                                       }
 
-                               // we prefer top/left over translate3d so that 
we don't create a HW-accelerated layer from each tile
-                               // which is slow, and it also fixes gaps 
between tiles in Safari
-                               L.DomUtil.setPosition(tile, tilePos, true);
+                                       // we prefer top/left over translate3d 
so that we don't create a HW-accelerated layer from each tile
+                                       // which is slow, and it also fixes 
gaps between tiles in Safari
+                                       L.DomUtil.setPosition(tile, tilePos, 
true);
 
-                               // save tile in cache
-                               this._tiles[key] = {
-                                       el: tile,
-                                       coords: coords,
-                                       current: true
-                               };
+                                       // save tile in cache
+                                       this._tiles[key] = {
+                                               el: tile,
+                                               coords: coords,
+                                               current: true
+                                       };
 
-                               fragment.appendChild(tile);
+                                       fragment.appendChild(tile);
 
-                               this.fire('tileloadstart', {
-                                       tile: tile,
-                                       coords: coords
-                               });
+                                       this.fire('tileloadstart', {
+                                               tile: tile,
+                                               coords: coords
+                                       });
+                               }
                        }
 
                        if (this._tileCache[key]) {
commit 1b01af36059623627fd8895353f028efc20ef26f
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Fri Aug 24 14:01:44 2018 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Sun Aug 26 06:49:34 2018 +0200

    First forward invalidation to client and request tiles after

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 588a17ad5..4a61bbe49 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -950,7 +950,12 @@ bool ClientSession::handleKitToClientMessage(const char* 
buffer, const int lengt
         else if (tokens[0] == "invalidatetiles:")
         {
             assert(firstLine.size() == 
static_cast<std::string::size_type>(length));
+
+            // First forward invalidation
+            bool ret = forwardToClient(payload);
+
             handleTileInvalidation(firstLine, docBroker);
+            return ret;
         }
         else if (tokens[0] == "invalidatecursor:")
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to