From 7150baac1aa13c19d220133805b61d62b7305c29 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Tue, 18 Dec 2018 15:59:19 -0500 Subject: [PATCH] set correct color state before rendering custom layer fix #7708 --- src/render/draw_custom.js | 1 + .../mapbox-gl-js#7708/expected.png | Bin 0 -> 150 bytes .../regressions/mapbox-gl-js#7708/style.json | 44 ++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 test/integration/render-tests/regressions/mapbox-gl-js#7708/expected.png create mode 100644 test/integration/render-tests/regressions/mapbox-gl-js#7708/style.json diff --git a/src/render/draw_custom.js b/src/render/draw_custom.js index 03f74ebabde..e9dd3328e2b 100644 --- a/src/render/draw_custom.js +++ b/src/render/draw_custom.js @@ -45,6 +45,7 @@ function drawCustom(painter: Painter, sourceCache: SourceCache, layer: CustomSty } else { painter.setCustomLayerDefaults(); + context.setColorMode(painter.colorModeForRenderPass()); context.setStencilMode(StencilMode.disabled); const depthMode = painter.depthModeForSublayer(0, DepthMode.ReadOnly); diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#7708/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#7708/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..8546863a53e9468c379eb4b129dbb58e4314507c GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0OmKdHx{Y+k=jb z2NW2NY$*C?Yb^Zus+x-DBrtN}>yO#-=f#1Cjf&<^+U`t{E^^L0!MhWk;|5VZNkvNj Y(k3R2pevGLK%*HvUHx3vIVCg!03>@dMF0Q* literal 0 HcmV?d00001 diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#7708/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#7708/style.json new file mode 100644 index 00000000000..c5fc3d05fe1 --- /dev/null +++ b/test/integration/render-tests/regressions/mapbox-gl-js#7708/style.json @@ -0,0 +1,44 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "operations": [ + [ + "addCustomLayer", + "null-island" + ] + ] + } + }, + "sources": { + "geometry": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }] + } + } + }, + "layers": [ + { + "id": "geometry", + "type": "circle", + "source": "geometry", + "layout": { + "visibility": "none" + }, + "paint": { + "circle-radius": 40 + } + } + ] +}