Commit 917efa03 authored by Reza.Zakerinasab's avatar Reza.Zakerinasab Committed by Commit Bot

Enable canvas-createImageBitmap-colorClamping layout test

virtual/gpu/fast/canvas/canvas-createImageBitmap-colorClamping.html is
consistently passing on Linux and Windows and failing on Mac. Trying
to re-enable this disabled test.

https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=webkit_layout_tests&tests=virtual/gpu/fast/canvas/canvas-createImageBitmap-colorClamping.html


Bug: 791554
Change-Id: I4e89ec29a19f1d9c3d7b122214dcd39dfd7eb648
Reviewed-on: https://chromium-review.googlesource.com/803903Reviewed-by: default avatarJustin Novosad <junov@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521433}
parent 64a5af6e
...@@ -132,8 +132,6 @@ crbug.com/504613 crbug.com/524248 [ Mac ] paint/images/image-backgrounds-not-ant ...@@ -132,8 +132,6 @@ crbug.com/504613 crbug.com/524248 [ Mac ] paint/images/image-backgrounds-not-ant
crbug.com/619103 paint/invalidation/background/background-resize-width.html [ Failure Pass ] crbug.com/619103 paint/invalidation/background/background-resize-width.html [ Failure Pass ]
crbug.com/619103 virtual/spv175/paint/invalidation/background/background-resize-width.html [ Skip ] crbug.com/619103 virtual/spv175/paint/invalidation/background/background-resize-width.html [ Skip ]
crbug.com/627844 virtual/gpu/fast/canvas/canvas-createImageBitmap-colorClamping.html [ Failure ]
# Scanlines off by 1, but code path should be the same # Scanlines off by 1, but code path should be the same
crbug.com/644433 virtual/gpu/fast/canvas/OffscreenCanvas-2d-pattern-in-worker.html [ Failure ] crbug.com/644433 virtual/gpu/fast/canvas/OffscreenCanvas-2d-pattern-in-worker.html [ Failure ]
......
<html>
<body>
<canvas id="c"></canvas>
<script>
var canvas = document.getElementById("c");
canvas.setAttribute("width", "250");
canvas.setAttribute("height", "200");
var ctx = canvas.getContext("2d");
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 100, 100);
ctx.save();
ctx.beginPath();
ctx.rect(120, 0, 150, 150);
ctx.clip();
ctx.fillRect(0, 0, 250, 200);
ctx.restore();
</script>
<p>Two green squares with no color bleeding should be visible.</p>
</body>
</html>
<html> <script src="../../resources/testharness.js"></script>
<body> <script src="../../resources/testharnessreport.js"></script>
<canvas id="c"></canvas>
<script> <script>
if (window.testRunner)
testRunner.waitUntilDone();
var aCanvas = document.createElement("canvas"); function checkPixels(ctx, coordinates, color) {
aCanvas.setAttribute("width", "300"); for (i = 0; i < coordinates.length; i++) {
aCanvas.setAttribute("height", "300"); var pixel = ctx.getImageData(coordinates[i][0], coordinates[i][1], 1, 1).data;
var aCtx = aCanvas.getContext("2d"); var message = "Pixel at " + coordinates[i] + " must be " + color;
aCtx.fillStyle = 'red'; assert_array_equals(pixel, color, message);
aCtx.fillRect(0, 0, 300, 300); }
aCtx.fillStyle = 'green'; }
aCtx.fillRect(100, 100, 100, 100);
var canvas = document.getElementById("c"); function checkLines(ctx, lines, areVertical, color) {
canvas.setAttribute("width", "250"); var pixels;
canvas.setAttribute("height", "200"); for (l = 0; l < lines.length; l++) {
var ctx = canvas.getContext("2d"); line = lines[l];
if (areVertical)
pixels = ctx.getImageData(line[0], line[1], 1, line[2]).data;
else
pixels = ctx.getImageData(line[0], line[1], line[2], 1).data;
for (i = 0; i < line[2]; i++) {
var pixel = pixels.slice(i * 4, i * 4 + 4);
var message = "Pixel #" + i + " must be " + color;
assert_array_equals(pixel, color, message);
}
}
}
createImageBitmap(aCanvas, 100, 100, 100, 100).then(function (imageBitmap) { async_test(function(t) {
ctx.drawImage(imageBitmap, 0, 0); var aCanvas = document.createElement("canvas");
ctx.drawImage(imageBitmap, 120, 0, 150, 150); aCanvas.setAttribute("width", "300");
if (window.testRunner) aCanvas.setAttribute("height", "300");
testRunner.notifyDone(); var aCtx = aCanvas.getContext("2d");
}); aCtx.fillStyle = 'red';
aCtx.fillRect(0, 0, 300, 300);
aCtx.fillStyle = 'green';
aCtx.fillRect(100, 100, 100, 100);
var canvas = document.createElement("canvas");
canvas.setAttribute("width", "350");
canvas.setAttribute("height", "200");
var ctx = canvas.getContext("2d");
var greenPixels = [[10, 10], [10,109], [109,10], [109,109],
[150, 10], [150,159], [299,10], [299,159]];
// x, y, length
var noBleedingHorizontalLines = [[9, 9, 102], [9, 110, 102],
[149, 9, 152], [149, 160, 152]];
var noBleedingVerticalLines = [[9, 9, 100], [110, 9, 100],
[149, 9, 152], [300, 9, 152]];
createImageBitmap(aCanvas, 100, 100, 100, 100).then(t.step_func_done(function(imageBitmap) {
ctx.drawImage(imageBitmap, 10, 10);
ctx.drawImage(imageBitmap, 150, 10, 150, 150);
checkPixels(ctx, greenPixels, [0, 128, 0, 255]);
checkLines(ctx, noBleedingHorizontalLines, false, [0, 0, 0, 0]);
checkLines(ctx, noBleedingVerticalLines, true, [0, 0, 0, 0]);
t.done();
}));
}, "Two green squares with no color bleeding should be visible.");
</script> </script>
<p>Two green squares with no color bleeding should be visible.</p>
</body> \ No newline at end of file
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment