From 3ccbe5bca0dcf7d7d01371c327e3e42173e8313a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 4 Jun 2015 19:15:19 +0300 Subject: [PATCH] trigger tile compositing in Safari MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This kind of reverts #2377 that doesn’t make sense after tile animation refactorings, because it makes Safari terribly slow. It reintroduces the tile gaps, but oh well, we choose the lesser evil here. Also, performance in latest iOS is the same with and without the patch so there’s no harm in removing this. --- CHANGELOG.md | 2 -- src/dom/DomUtil.js | 4 ++-- src/layer/tile/GridLayer.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57ad20fa..5db3abbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,8 +91,6 @@ These changes were targeted at removing any hardcoded projection-specific logic ### Animations refactoring -* Improved performance in iOS Safari; pinch-zooming should be smoother now. [#2377](https://github.com/Leaflet/Leaflet/pull/2377) -* Fixed gaps between tiles during animations in desktop Safari. [#2377](https://github.com/Leaflet/Leaflet/pull/2377) * Improved panning inertia behavior so that there are no tearing during animation when panning around quickly. [#2360](https://github.com/Leaflet/Leaflet/issues/2360) ## Other performance improvements diff --git a/src/dom/DomUtil.js b/src/dom/DomUtil.js index 67de1558..4f834018 100644 --- a/src/dom/DomUtil.js +++ b/src/dom/DomUtil.js @@ -146,13 +146,13 @@ L.DomUtil = { 'translate3d(' + pos.x + 'px,' + pos.y + 'px' + ',0)' + (scale ? ' scale(' + scale + ')' : ''); }, - setPosition: function (el, point, no3d) { // (HTMLElement, Point[, Boolean]) + setPosition: function (el, point) { // (HTMLElement, Point[, Boolean]) /*eslint-disable */ el._leaflet_pos = point; /*eslint-enable */ - if (L.Browser.any3d && !no3d) { + if (L.Browser.any3d) { L.DomUtil.setTransform(el, point); } else { el.style.left = point.x + 'px'; diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index 730960f1..5218a6e7 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -556,7 +556,7 @@ L.GridLayer = L.Layer.extend({ // 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); + L.DomUtil.setPosition(tile, tilePos); // save tile in cache this._tiles[key] = {