From d9046032ac0654233efa58a6d1db15c25b525fbe Mon Sep 17 00:00:00 2001 From: David Manthey Date: Thu, 18 Oct 2018 11:50:06 -0400 Subject: [PATCH] Skip having vgl compute geometry bounds. vgl computes the bounds of various geometries, but it isn't actually used for anything we do, so this is wasted work. Make the geometryData computeBounds just set it to a fixed value. --- src/gl/contourFeature.js | 5 +++++ src/gl/lineFeature.js | 5 +++++ src/gl/pointFeature.js | 5 +++++ src/gl/polygonFeature.js | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/src/gl/contourFeature.js b/src/gl/contourFeature.js index d5c578f44d..d3a1c78f27 100644 --- a/src/gl/contourFeature.js +++ b/src/gl/contourFeature.js @@ -240,6 +240,11 @@ var gl_contourFeature = function (arg) { geom.addSource(sourceValues); geom.addSource(sourceOpacity); geom.addPrimitive(primitive); + /* We don't need vgl to comptue bounds, so make the geo.computeBounds just + * set them to 0. */ + geom.computeBounds = function () { + geom.setBounds(0, 0, 0, 0, 0, 0); + }; m_mapper.setGeometryData(geom); }; diff --git a/src/gl/lineFeature.js b/src/gl/lineFeature.js index dbca311b0d..ea7fbb7ea7 100644 --- a/src/gl/lineFeature.js +++ b/src/gl/lineFeature.js @@ -724,6 +724,11 @@ var gl_lineFeature = function (arg) { geom.addSource(strkOpacityData); geom.addSource(flagsData); geom.addPrimitive(triangles); + /* We don't need vgl to comptue bounds, so make the geo.computeBounds just + * set them to 0. */ + geom.computeBounds = function () { + geom.setBounds(0, 0, 0, 0, 0, 0); + }; m_mapper.setGeometryData(geom); return m_this; }; diff --git a/src/gl/pointFeature.js b/src/gl/pointFeature.js index a5c5703507..2b592ecb98 100644 --- a/src/gl/pointFeature.js +++ b/src/gl/pointFeature.js @@ -588,6 +588,11 @@ var gl_pointFeature = function (arg) { geom.addSource(sourceAlpha); geom.addSource(sourceStrokeOpacity); geom.addPrimitive(primitive); + /* We don't need vgl to comptue bounds, so make the geo.computeBounds just + * set them to 0. */ + geom.computeBounds = function () { + geom.setBounds(0, 0, 0, 0, 0, 0); + }; m_mapper.setGeometryData(geom); }; diff --git a/src/gl/polygonFeature.js b/src/gl/polygonFeature.js index 6dcdfed489..8af604a856 100644 --- a/src/gl/polygonFeature.js +++ b/src/gl/polygonFeature.js @@ -311,6 +311,11 @@ var gl_polygonFeature = function (arg) { geom.addSource(sourceFillColor); geom.addSource(sourceFillOpacity); geom.addPrimitive(trianglePrimitive); + /* We don't need vgl to comptue bounds, so make the geo.computeBounds just + * set them to 0. */ + geom.computeBounds = function () { + geom.setBounds(0, 0, 0, 0, 0, 0); + }; m_mapper.setGeometryData(geom); s_init.call(m_this, arg);