Skip to content

Commit

Permalink
Write PNGs with unassociated alpha
Browse files Browse the repository at this point in the history
And update almost all the expected render test results. Skipping:

combinations/fill-extrusion-translucent--background-opaque
combinations/fill-extrusion-translucent--fill-opaque
fill-outline-color/*
map-mode/static
projection/*
  • Loading branch information
jfirebaugh committed Mar 6, 2018
1 parent b012595 commit 342830b
Show file tree
Hide file tree
Showing 682 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions test/integration/lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ exports.run = function (implementation, ignores, render) {
height: params.height * params.pixelRatio
});

// PNG data must be unassociated (not premultiplied)
for (let i = 0; i < data.length; i++) {
const a = data[i * 4 + 3] / 255;
if (a !== 0) {
data[i * 4 + 0] /= a;
data[i * 4 + 1] /= a;
data[i * 4 + 2] /= a;
}
}

png.data = data;

// there may be multiple expected images, covering different platforms
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/basic-v9/z0/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/bright-v9/z0/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/circle-blur/default/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/circle-blur/literal/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/circle-color/default/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/circle-color/function/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/circle-color/literal/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/integration/render-tests/circle-pitch-scale/map/expected.png
Binary file modified test/integration/render-tests/circle-radius/default/expected.png
Binary file modified test/integration/render-tests/circle-radius/literal/expected.png
Binary file modified test/integration/render-tests/debug/collision-lines/expected.png
Binary file modified test/integration/render-tests/debug/collision/expected.png
Binary file modified test/integration/render-tests/debug/overdraw/expected.png
Binary file modified test/integration/render-tests/debug/tile/expected.png
Binary file modified test/integration/render-tests/extent/1024-circle/expected.png
Binary file modified test/integration/render-tests/extent/1024-fill/expected.png
Binary file modified test/integration/render-tests/extent/1024-line/expected.png
Binary file modified test/integration/render-tests/extent/1024-symbol/expected.png
Binary file modified test/integration/render-tests/fill-color/multiply/expected.png
Binary file modified test/integration/render-tests/fill-color/opacity/expected.png
Binary file modified test/integration/render-tests/fill-opacity/default/expected.png
Binary file modified test/integration/render-tests/fill-opacity/function/expected.png
Binary file modified test/integration/render-tests/fill-opacity/literal/expected.png
Binary file modified test/integration/render-tests/fill-pattern/@2x/expected.png
Binary file modified test/integration/render-tests/fill-pattern/literal/expected.png
Binary file modified test/integration/render-tests/fill-pattern/opacity/expected.png
Binary file modified test/integration/render-tests/fill-pattern/zoomed/expected.png
Binary file modified test/integration/render-tests/fill-visibility/visible/expected.png
Binary file modified test/integration/render-tests/geojson/clustered/expected.png
Binary file modified test/integration/render-tests/geojson/inline-feature/expected.png
Binary file modified test/integration/render-tests/heatmap-color/default/expected.png
Binary file modified test/integration/render-tests/heatmap-radius/default/expected.png
Binary file modified test/integration/render-tests/heatmap-radius/function/expected.png
Binary file modified test/integration/render-tests/heatmap-radius/pitch30/expected.png
Binary file modified test/integration/render-tests/heatmap-weight/default/expected.png
Binary file modified test/integration/render-tests/heatmap-weight/literal/expected.png
Binary file modified test/integration/render-tests/icon-color/function/expected.png
Binary file modified test/integration/render-tests/icon-color/literal/expected.png
Binary file modified test/integration/render-tests/icon-halo-blur/function/expected.png
Binary file modified test/integration/render-tests/icon-image/token/expected.png
Binary file modified test/integration/render-tests/icon-offset/literal/expected.png
Binary file modified test/integration/render-tests/icon-opacity/default/expected.png
Binary file modified test/integration/render-tests/icon-opacity/function/expected.png
Binary file modified test/integration/render-tests/icon-opacity/literal/expected.png
Binary file modified test/integration/render-tests/icon-rotate/literal/expected.png
Binary file modified test/integration/render-tests/icon-size/default/expected.png
Binary file modified test/integration/render-tests/icon-size/function/expected.png
Binary file modified test/integration/render-tests/icon-size/literal/expected.png
Binary file modified test/integration/render-tests/icon-text-fit/both/expected.png
Binary file modified test/integration/render-tests/icon-text-fit/height/expected.png
Binary file modified test/integration/render-tests/icon-text-fit/none/expected.png
Loading

0 comments on commit 342830b

Please sign in to comment.