diff --git a/debug/raster-streets.html b/debug/raster-streets.html new file mode 100644 index 00000000000..aafc9c30268 --- /dev/null +++ b/debug/raster-streets.html @@ -0,0 +1,48 @@ + + + + Mapbox GL JS debug page + + + + + + + +
+ + + + + + diff --git a/src/geo/transform.js b/src/geo/transform.js index 28a37e2f5fa..44fa6736d21 100644 --- a/src/geo/transform.js +++ b/src/geo/transform.js @@ -33,6 +33,7 @@ class Transform { pixelsToGLUnits: Array; cameraToCenterDistance: number; projMatrix: Float64Array; + alignedProjMatrix: Float64Array; pixelMatrix: Float64Array; pixelMatrixInverse: Float64Array; _fov: number; @@ -45,6 +46,7 @@ class Transform { _center: LngLat; _constraining: boolean; _posMatrixCache: {[number]: Float32Array}; + _alignedPosMatrixCache: {[number]: Float32Array}; constructor(minZoom: ?number, maxZoom: ?number, renderWorldCopies: boolean | void) { this.tileSize = 512; // constant @@ -64,6 +66,7 @@ class Transform { this._pitch = 0; this._unmodified = true; this._posMatrixCache = {}; + this._alignedPosMatrixCache = {}; } clone(): Transform { @@ -398,10 +401,11 @@ class Transform { * Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map. * @param {UnwrappedTileID} unwrappedTileID; */ - calculatePosMatrix(unwrappedTileID: UnwrappedTileID): Float32Array { + calculatePosMatrix(unwrappedTileID: UnwrappedTileID, aligned: boolean = false): Float32Array { const posMatrixKey = unwrappedTileID.key; - if (this._posMatrixCache[posMatrixKey]) { - return this._posMatrixCache[posMatrixKey]; + const cache = aligned ? this._alignedPosMatrixCache : this._posMatrixCache; + if (cache[posMatrixKey]) { + return cache[posMatrixKey]; } const canonical = unwrappedTileID.canonical; @@ -411,10 +415,10 @@ class Transform { const posMatrix = mat4.identity(new Float64Array(16)); mat4.translate(posMatrix, posMatrix, [unwrappedX * scale, canonical.y * scale, 0]); mat4.scale(posMatrix, posMatrix, [scale / EXTENT, scale / EXTENT, 1]); - mat4.multiply(posMatrix, this.projMatrix, posMatrix); + mat4.multiply(posMatrix, aligned ? this.alignedProjMatrix : this.projMatrix, posMatrix); - this._posMatrixCache[posMatrixKey] = new Float32Array(posMatrix); - return this._posMatrixCache[posMatrixKey]; + cache[posMatrixKey] = new Float32Array(posMatrix); + return cache[posMatrixKey]; } _constrain() { @@ -496,6 +500,7 @@ class Transform { const halfFov = this._fov / 2; const groundAngle = Math.PI / 2 + this._pitch; const topHalfSurfaceDistance = Math.sin(halfFov) * this.cameraToCenterDistance / Math.sin(Math.PI - groundAngle - halfFov); + const x = this.x, y = this.y; // Calculate z distance of the farthest fragment that should be rendered. const furthestDistance = Math.cos(Math.PI / 2 - this._pitch) * topHalfSurfaceDistance + this.cameraToCenterDistance; @@ -510,7 +515,7 @@ class Transform { mat4.translate(m, m, [0, 0, -this.cameraToCenterDistance]); mat4.rotateX(m, m, this._pitch); mat4.rotateZ(m, m, this.angle); - mat4.translate(m, m, [-this.x, -this.y, 0]); + mat4.translate(m, m, [-x, -y, 0]); // scale vertically to meters per pixel (inverse of ground resolution): // worldSize / (circumferenceOfEarth * cos(lat * π / 180)) @@ -519,6 +524,20 @@ class Transform { this.projMatrix = m; + // Make a second projection matrix that is aligned to a pixel grid for rendering raster tiles. + // We're rounding the (floating point) x/y values to achieve to avoid rendering raster images to fractional + // coordinates. Additionally, we adjust by half a pixel in either direction in case that viewport dimension + // is an odd integer to preserve rendering to the pixel grid. We're rotating this shift based on the angle + // of the transformation so that 0°, 90°, 180°, and 270° rasters are crisp, and adjust the shift so that + // it is always <= 0.5 pixels. + const xShift = (this.width % 2) / 2, yShift = (this.height % 2) / 2, + angleCos = Math.cos(this.angle), angleSin = Math.sin(this.angle), + dx = x - Math.round(x) + angleCos * xShift + angleSin * yShift, + dy = y - Math.round(y) + angleCos * yShift + angleSin * xShift; + const alignedM = new Float64Array(m); + mat4.translate(alignedM, alignedM, [ dx > 0.5 ? dx - 1 : dx, dy > 0.5 ? dy - 1 : dy, 0 ]); + this.alignedProjMatrix = alignedM; + // matrix for conversion from location to screen coordinates m = mat4.create(); mat4.scale(m, m, [this.width / 2, -this.height / 2, 1]); @@ -531,6 +550,7 @@ class Transform { this.pixelMatrixInverse = m; this._posMatrixCache = {}; + this._alignedPosMatrixCache = {}; } } diff --git a/src/render/draw_raster.js b/src/render/draw_raster.js index b7eb07ed5cf..0c9227787e8 100644 --- a/src/render/draw_raster.js +++ b/src/render/draw_raster.js @@ -44,7 +44,7 @@ function drawRaster(painter: Painter, sourceCache: SourceCache, layer: RasterSty layer.paint.get('raster-opacity') === 1 ? DepthMode.ReadWrite : DepthMode.ReadOnly, gl.LESS)); const tile = sourceCache.getTile(coord); - const posMatrix = painter.transform.calculatePosMatrix(coord.toUnwrapped()); + const posMatrix = painter.transform.calculatePosMatrix(coord.toUnwrapped(), true); tile.registerFadeDuration(layer.paint.get('raster-fade-duration')); diff --git a/test/integration/render-tests/background-opacity/image/expected.png b/test/integration/render-tests/background-opacity/image/expected.png index 8b1d3cd4a79..1fac5074c00 100644 Binary files a/test/integration/render-tests/background-opacity/image/expected.png and b/test/integration/render-tests/background-opacity/image/expected.png differ diff --git a/test/integration/render-tests/combinations/background-opaque--raster-translucent/expected.png b/test/integration/render-tests/combinations/background-opaque--raster-translucent/expected.png index 7b0378519f1..92bf9b304bc 100644 Binary files a/test/integration/render-tests/combinations/background-opaque--raster-translucent/expected.png and b/test/integration/render-tests/combinations/background-opaque--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/background-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/background-translucent--raster-translucent/expected.png index 1a572c4186a..d727f124fca 100644 Binary files a/test/integration/render-tests/combinations/background-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/background-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/circle-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/circle-translucent--raster-translucent/expected.png index 39dfcaf5bce..16fa5d2a380 100644 Binary files a/test/integration/render-tests/combinations/circle-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/circle-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/fill-extrusion-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/fill-extrusion-translucent--raster-translucent/expected.png index 321a9056ab3..8ded99d2453 100644 Binary files a/test/integration/render-tests/combinations/fill-extrusion-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/fill-extrusion-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/fill-opaque--raster-translucent/expected.png b/test/integration/render-tests/combinations/fill-opaque--raster-translucent/expected.png index 96dadbeef1a..0de5f88544e 100644 Binary files a/test/integration/render-tests/combinations/fill-opaque--raster-translucent/expected.png and b/test/integration/render-tests/combinations/fill-opaque--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/fill-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/fill-translucent--raster-translucent/expected.png index e5d66cc8d58..7537ed05c2c 100644 Binary files a/test/integration/render-tests/combinations/fill-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/fill-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/heatmap-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/heatmap-translucent--raster-translucent/expected.png index 4917263b1d1..c8c0286f1cd 100644 Binary files a/test/integration/render-tests/combinations/heatmap-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/heatmap-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/hillshade-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/hillshade-translucent--raster-translucent/expected.png index 16f6cde1acf..ae61cc01805 100644 Binary files a/test/integration/render-tests/combinations/hillshade-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/hillshade-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/line-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/line-translucent--raster-translucent/expected.png index 8561a2590cb..984e982cd87 100644 Binary files a/test/integration/render-tests/combinations/line-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/line-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--background-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--background-translucent/expected.png index eec0e4b285f..f7fc3868437 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--background-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--background-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--circle-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--circle-translucent/expected.png index 82ed3ec7af8..c2d254a0f4a 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--circle-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--circle-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--fill-extrusion-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--fill-extrusion-translucent/expected.png index 0152947eb94..62721248f55 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--fill-extrusion-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--fill-extrusion-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--fill-opaque/expected.png b/test/integration/render-tests/combinations/raster-translucent--fill-opaque/expected.png index c968af312b5..3e5d898c632 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--fill-opaque/expected.png and b/test/integration/render-tests/combinations/raster-translucent--fill-opaque/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--fill-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--fill-translucent/expected.png index 30d5449a617..727b0ad456d 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--fill-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--fill-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--heatmap-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--heatmap-translucent/expected.png index f37e930302a..a1673758077 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--heatmap-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--heatmap-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--hillshade-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--hillshade-translucent/expected.png index 6890e7c6e2e..d439aa3af1e 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--hillshade-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--hillshade-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--line-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--line-translucent/expected.png index 4db0eef1ef5..6ca59693fd5 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--line-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--line-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--raster-translucent/expected.png index cccf8d52dd6..c403b34d42b 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/raster-translucent--symbol-translucent/expected.png b/test/integration/render-tests/combinations/raster-translucent--symbol-translucent/expected.png index 1d658fc22bf..cea127953fc 100644 Binary files a/test/integration/render-tests/combinations/raster-translucent--symbol-translucent/expected.png and b/test/integration/render-tests/combinations/raster-translucent--symbol-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/symbol-translucent--raster-translucent/expected.png b/test/integration/render-tests/combinations/symbol-translucent--raster-translucent/expected.png index 30ea7ea27b5..7adc9f774b8 100644 Binary files a/test/integration/render-tests/combinations/symbol-translucent--raster-translucent/expected.png and b/test/integration/render-tests/combinations/symbol-translucent--raster-translucent/expected.png differ diff --git a/test/integration/render-tests/image/default/expected.png b/test/integration/render-tests/image/default/expected.png index 66527ed23d8..7558d9a3fc4 100644 Binary files a/test/integration/render-tests/image/default/expected.png and b/test/integration/render-tests/image/default/expected.png differ diff --git a/test/integration/render-tests/image/pitched/expected.png b/test/integration/render-tests/image/pitched/expected.png index 0dce8cd9894..abe3b35857b 100644 Binary files a/test/integration/render-tests/image/pitched/expected.png and b/test/integration/render-tests/image/pitched/expected.png differ diff --git a/test/integration/render-tests/image/raster-brightness/expected.png b/test/integration/render-tests/image/raster-brightness/expected.png index dc11255b6a2..badca67c64c 100644 Binary files a/test/integration/render-tests/image/raster-brightness/expected.png and b/test/integration/render-tests/image/raster-brightness/expected.png differ diff --git a/test/integration/render-tests/image/raster-contrast/expected.png b/test/integration/render-tests/image/raster-contrast/expected.png index d38adafdb91..9cda650fca2 100644 Binary files a/test/integration/render-tests/image/raster-contrast/expected.png and b/test/integration/render-tests/image/raster-contrast/expected.png differ diff --git a/test/integration/render-tests/image/raster-hue-rotate/expected.png b/test/integration/render-tests/image/raster-hue-rotate/expected.png index 4dec66238c9..fc5afc0c9d2 100644 Binary files a/test/integration/render-tests/image/raster-hue-rotate/expected.png and b/test/integration/render-tests/image/raster-hue-rotate/expected.png differ diff --git a/test/integration/render-tests/image/raster-opacity/expected.png b/test/integration/render-tests/image/raster-opacity/expected.png index ed4d03533c2..12fab4eb9b4 100644 Binary files a/test/integration/render-tests/image/raster-opacity/expected.png and b/test/integration/render-tests/image/raster-opacity/expected.png differ diff --git a/test/integration/render-tests/image/raster-saturation/expected.png b/test/integration/render-tests/image/raster-saturation/expected.png index de70b12e1f7..5eded170e57 100644 Binary files a/test/integration/render-tests/image/raster-saturation/expected.png and b/test/integration/render-tests/image/raster-saturation/expected.png differ diff --git a/test/integration/render-tests/image/raster-visibility/expected.png b/test/integration/render-tests/image/raster-visibility/expected.png index 66527ed23d8..7558d9a3fc4 100644 Binary files a/test/integration/render-tests/image/raster-visibility/expected.png and b/test/integration/render-tests/image/raster-visibility/expected.png differ diff --git a/test/integration/render-tests/raster-alpha/default/expected.png b/test/integration/render-tests/raster-alpha/default/expected.png index 74be57c4208..e30f2c4d4f1 100644 Binary files a/test/integration/render-tests/raster-alpha/default/expected.png and b/test/integration/render-tests/raster-alpha/default/expected.png differ diff --git a/test/integration/render-tests/raster-brightness/default/expected.png b/test/integration/render-tests/raster-brightness/default/expected.png index fc52dff7059..d99342a47ae 100644 Binary files a/test/integration/render-tests/raster-brightness/default/expected.png and b/test/integration/render-tests/raster-brightness/default/expected.png differ diff --git a/test/integration/render-tests/raster-brightness/function/expected.png b/test/integration/render-tests/raster-brightness/function/expected.png index e5ddf5912d9..568209c86ae 100644 Binary files a/test/integration/render-tests/raster-brightness/function/expected.png and b/test/integration/render-tests/raster-brightness/function/expected.png differ diff --git a/test/integration/render-tests/raster-brightness/literal/expected.png b/test/integration/render-tests/raster-brightness/literal/expected.png index 3135277bd84..e2f1f5718e4 100644 Binary files a/test/integration/render-tests/raster-brightness/literal/expected.png and b/test/integration/render-tests/raster-brightness/literal/expected.png differ diff --git a/test/integration/render-tests/raster-contrast/default/expected.png b/test/integration/render-tests/raster-contrast/default/expected.png index fc52dff7059..d99342a47ae 100644 Binary files a/test/integration/render-tests/raster-contrast/default/expected.png and b/test/integration/render-tests/raster-contrast/default/expected.png differ diff --git a/test/integration/render-tests/raster-contrast/function/expected.png b/test/integration/render-tests/raster-contrast/function/expected.png index 0f41ab6b269..6711d477d7d 100644 Binary files a/test/integration/render-tests/raster-contrast/function/expected.png and b/test/integration/render-tests/raster-contrast/function/expected.png differ diff --git a/test/integration/render-tests/raster-contrast/literal/expected.png b/test/integration/render-tests/raster-contrast/literal/expected.png index 43404ff737a..edfa78b4770 100644 Binary files a/test/integration/render-tests/raster-contrast/literal/expected.png and b/test/integration/render-tests/raster-contrast/literal/expected.png differ diff --git a/test/integration/render-tests/raster-hue-rotate/default/expected.png b/test/integration/render-tests/raster-hue-rotate/default/expected.png index fc52dff7059..d99342a47ae 100644 Binary files a/test/integration/render-tests/raster-hue-rotate/default/expected.png and b/test/integration/render-tests/raster-hue-rotate/default/expected.png differ diff --git a/test/integration/render-tests/raster-hue-rotate/function/expected.png b/test/integration/render-tests/raster-hue-rotate/function/expected.png index 5089dfd1aae..72b731e17c3 100644 Binary files a/test/integration/render-tests/raster-hue-rotate/function/expected.png and b/test/integration/render-tests/raster-hue-rotate/function/expected.png differ diff --git a/test/integration/render-tests/raster-hue-rotate/literal/expected.png b/test/integration/render-tests/raster-hue-rotate/literal/expected.png index 903e24f444b..9e639c8638c 100644 Binary files a/test/integration/render-tests/raster-hue-rotate/literal/expected.png and b/test/integration/render-tests/raster-hue-rotate/literal/expected.png differ diff --git a/test/integration/render-tests/raster-loading/missing/expected.png b/test/integration/render-tests/raster-loading/missing/expected.png index a1ad7a5b57b..e9bdc8d4ed7 100644 Binary files a/test/integration/render-tests/raster-loading/missing/expected.png and b/test/integration/render-tests/raster-loading/missing/expected.png differ diff --git a/test/integration/render-tests/raster-masking/overlapping-zoom/expected.png b/test/integration/render-tests/raster-masking/overlapping-zoom/expected.png index f2c81d2ba5f..4a9078bba81 100644 Binary files a/test/integration/render-tests/raster-masking/overlapping-zoom/expected.png and b/test/integration/render-tests/raster-masking/overlapping-zoom/expected.png differ diff --git a/test/integration/render-tests/raster-masking/overlapping/expected.png b/test/integration/render-tests/raster-masking/overlapping/expected.png index 9afbdfa73ef..94d9ab2a035 100644 Binary files a/test/integration/render-tests/raster-masking/overlapping/expected.png and b/test/integration/render-tests/raster-masking/overlapping/expected.png differ diff --git a/test/integration/render-tests/raster-opacity/default/expected.png b/test/integration/render-tests/raster-opacity/default/expected.png index fc52dff7059..d99342a47ae 100644 Binary files a/test/integration/render-tests/raster-opacity/default/expected.png and b/test/integration/render-tests/raster-opacity/default/expected.png differ diff --git a/test/integration/render-tests/raster-opacity/function/expected.png b/test/integration/render-tests/raster-opacity/function/expected.png index e0436e48c54..e23d5af377c 100644 Binary files a/test/integration/render-tests/raster-opacity/function/expected.png and b/test/integration/render-tests/raster-opacity/function/expected.png differ diff --git a/test/integration/render-tests/raster-opacity/literal/expected.png b/test/integration/render-tests/raster-opacity/literal/expected.png index 58a5890d04b..27a06a6cef9 100644 Binary files a/test/integration/render-tests/raster-opacity/literal/expected.png and b/test/integration/render-tests/raster-opacity/literal/expected.png differ diff --git a/test/integration/render-tests/raster-rotation/0/expected.png b/test/integration/render-tests/raster-rotation/0/expected.png new file mode 100644 index 00000000000..d99342a47ae Binary files /dev/null and b/test/integration/render-tests/raster-rotation/0/expected.png differ diff --git a/test/integration/render-tests/raster-rotation/0/style.json b/test/integration/render-tests/raster-rotation/0/style.json new file mode 100644 index 00000000000..bfbebd2c095 --- /dev/null +++ b/test/integration/render-tests/raster-rotation/0/style.json @@ -0,0 +1,34 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 16, + "bearing": 0, + "sources": { + "satellite": { + "type": "raster", + "tiles": [ + "local://tiles/{z}-{x}-{y}.satellite.png" + ], + "maxzoom": 17, + "tileSize": 256 + } + }, + "layers": [ + { + "id": "raster", + "type": "raster", + "source": "satellite", + "paint": { + "raster-fade-duration": 0 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/raster-rotation/180/expected.png b/test/integration/render-tests/raster-rotation/180/expected.png new file mode 100644 index 00000000000..7a4ed1a82de Binary files /dev/null and b/test/integration/render-tests/raster-rotation/180/expected.png differ diff --git a/test/integration/render-tests/raster-rotation/180/style.json b/test/integration/render-tests/raster-rotation/180/style.json new file mode 100644 index 00000000000..974b7a02d38 --- /dev/null +++ b/test/integration/render-tests/raster-rotation/180/style.json @@ -0,0 +1,34 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 16, + "bearing": 180, + "sources": { + "satellite": { + "type": "raster", + "tiles": [ + "local://tiles/{z}-{x}-{y}.satellite.png" + ], + "maxzoom": 17, + "tileSize": 256 + } + }, + "layers": [ + { + "id": "raster", + "type": "raster", + "source": "satellite", + "paint": { + "raster-fade-duration": 0 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/raster-rotation/270/expected.png b/test/integration/render-tests/raster-rotation/270/expected.png new file mode 100644 index 00000000000..d3f4a664bbc Binary files /dev/null and b/test/integration/render-tests/raster-rotation/270/expected.png differ diff --git a/test/integration/render-tests/raster-rotation/270/style.json b/test/integration/render-tests/raster-rotation/270/style.json new file mode 100644 index 00000000000..3105d4859fe --- /dev/null +++ b/test/integration/render-tests/raster-rotation/270/style.json @@ -0,0 +1,34 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 16, + "bearing": 270, + "sources": { + "satellite": { + "type": "raster", + "tiles": [ + "local://tiles/{z}-{x}-{y}.satellite.png" + ], + "maxzoom": 17, + "tileSize": 256 + } + }, + "layers": [ + { + "id": "raster", + "type": "raster", + "source": "satellite", + "paint": { + "raster-fade-duration": 0 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/raster-rotation/45/expected.png b/test/integration/render-tests/raster-rotation/45/expected.png new file mode 100644 index 00000000000..139f69445c5 Binary files /dev/null and b/test/integration/render-tests/raster-rotation/45/expected.png differ diff --git a/test/integration/render-tests/raster-rotation/45/style.json b/test/integration/render-tests/raster-rotation/45/style.json new file mode 100644 index 00000000000..afafdf4dad0 --- /dev/null +++ b/test/integration/render-tests/raster-rotation/45/style.json @@ -0,0 +1,34 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 16, + "bearing": 45, + "sources": { + "satellite": { + "type": "raster", + "tiles": [ + "local://tiles/{z}-{x}-{y}.satellite.png" + ], + "maxzoom": 17, + "tileSize": 256 + } + }, + "layers": [ + { + "id": "raster", + "type": "raster", + "source": "satellite", + "paint": { + "raster-fade-duration": 0 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/raster-rotation/90/expected.png b/test/integration/render-tests/raster-rotation/90/expected.png new file mode 100644 index 00000000000..79b2bcd9a23 Binary files /dev/null and b/test/integration/render-tests/raster-rotation/90/expected.png differ diff --git a/test/integration/render-tests/raster-rotation/90/style.json b/test/integration/render-tests/raster-rotation/90/style.json new file mode 100644 index 00000000000..bb9d7269d8b --- /dev/null +++ b/test/integration/render-tests/raster-rotation/90/style.json @@ -0,0 +1,34 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 16, + "bearing": 90, + "sources": { + "satellite": { + "type": "raster", + "tiles": [ + "local://tiles/{z}-{x}-{y}.satellite.png" + ], + "maxzoom": 17, + "tileSize": 256 + } + }, + "layers": [ + { + "id": "raster", + "type": "raster", + "source": "satellite", + "paint": { + "raster-fade-duration": 0 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/raster-saturation/default/expected.png b/test/integration/render-tests/raster-saturation/default/expected.png index fc52dff7059..d99342a47ae 100644 Binary files a/test/integration/render-tests/raster-saturation/default/expected.png and b/test/integration/render-tests/raster-saturation/default/expected.png differ diff --git a/test/integration/render-tests/raster-saturation/function/expected.png b/test/integration/render-tests/raster-saturation/function/expected.png index 117239e9ccb..3e90cf2894b 100644 Binary files a/test/integration/render-tests/raster-saturation/function/expected.png and b/test/integration/render-tests/raster-saturation/function/expected.png differ diff --git a/test/integration/render-tests/raster-saturation/literal/expected.png b/test/integration/render-tests/raster-saturation/literal/expected.png index 310230a601f..54a8f4dce1d 100644 Binary files a/test/integration/render-tests/raster-saturation/literal/expected.png and b/test/integration/render-tests/raster-saturation/literal/expected.png differ diff --git a/test/integration/render-tests/raster-visibility/visible/expected.png b/test/integration/render-tests/raster-visibility/visible/expected.png index fc52dff7059..d99342a47ae 100644 Binary files a/test/integration/render-tests/raster-visibility/visible/expected.png and b/test/integration/render-tests/raster-visibility/visible/expected.png differ diff --git a/test/integration/render-tests/retina-raster/default/expected.png b/test/integration/render-tests/retina-raster/default/expected.png index 561f9d06f1c..55ec18e1ab9 100644 Binary files a/test/integration/render-tests/retina-raster/default/expected.png and b/test/integration/render-tests/retina-raster/default/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/layer-add-raster/expected.png b/test/integration/render-tests/runtime-styling/layer-add-raster/expected.png index 1c1ef5d4c64..cbed9630dad 100644 Binary files a/test/integration/render-tests/runtime-styling/layer-add-raster/expected.png and b/test/integration/render-tests/runtime-styling/layer-add-raster/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/set-style-layer-add-raster/expected.png b/test/integration/render-tests/runtime-styling/set-style-layer-add-raster/expected.png index 1c1ef5d4c64..cbed9630dad 100644 Binary files a/test/integration/render-tests/runtime-styling/set-style-layer-add-raster/expected.png and b/test/integration/render-tests/runtime-styling/set-style-layer-add-raster/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/set-style-source-add-raster-inline/expected.png b/test/integration/render-tests/runtime-styling/set-style-source-add-raster-inline/expected.png index 1c1ef5d4c64..cbed9630dad 100644 Binary files a/test/integration/render-tests/runtime-styling/set-style-source-add-raster-inline/expected.png and b/test/integration/render-tests/runtime-styling/set-style-source-add-raster-inline/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/set-style-source-add-raster-url/expected.png b/test/integration/render-tests/runtime-styling/set-style-source-add-raster-url/expected.png index 1c1ef5d4c64..cbed9630dad 100644 Binary files a/test/integration/render-tests/runtime-styling/set-style-source-add-raster-url/expected.png and b/test/integration/render-tests/runtime-styling/set-style-source-add-raster-url/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/source-add-raster-inline/expected.png b/test/integration/render-tests/runtime-styling/source-add-raster-inline/expected.png index 1c1ef5d4c64..cbed9630dad 100644 Binary files a/test/integration/render-tests/runtime-styling/source-add-raster-inline/expected.png and b/test/integration/render-tests/runtime-styling/source-add-raster-inline/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/source-add-raster-url/expected.png b/test/integration/render-tests/runtime-styling/source-add-raster-url/expected.png index 1c1ef5d4c64..cbed9630dad 100644 Binary files a/test/integration/render-tests/runtime-styling/source-add-raster-url/expected.png and b/test/integration/render-tests/runtime-styling/source-add-raster-url/expected.png differ diff --git a/test/integration/render-tests/video/default/expected.png b/test/integration/render-tests/video/default/expected.png index 3726dca56f9..4c00c22aa62 100644 Binary files a/test/integration/render-tests/video/default/expected.png and b/test/integration/render-tests/video/default/expected.png differ diff --git a/test/integration/render-tests/zoomed-raster/fractional/expected.png b/test/integration/render-tests/zoomed-raster/fractional/expected.png index 44b96fdf584..3f2d2f0ef43 100644 Binary files a/test/integration/render-tests/zoomed-raster/fractional/expected.png and b/test/integration/render-tests/zoomed-raster/fractional/expected.png differ diff --git a/test/integration/render-tests/zoomed-raster/overzoom/expected.png b/test/integration/render-tests/zoomed-raster/overzoom/expected.png index 561f9d06f1c..946a47b32bb 100644 Binary files a/test/integration/render-tests/zoomed-raster/overzoom/expected.png and b/test/integration/render-tests/zoomed-raster/overzoom/expected.png differ diff --git a/test/integration/render-tests/zoomed-raster/underzoom/expected.png b/test/integration/render-tests/zoomed-raster/underzoom/expected.png index 459e62180fc..2c804bd2eb1 100644 Binary files a/test/integration/render-tests/zoomed-raster/underzoom/expected.png and b/test/integration/render-tests/zoomed-raster/underzoom/expected.png differ