Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-ClearRect-hidpi.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ClearRect-hidpi.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ClearRect-hidpi.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..824394054dc6097c35d54ecc821fceca7ef787ed |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ClearRect-hidpi.html |
| @@ -0,0 +1,36 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<body> |
| +<canvas id='output' width='300' height='250'></canvas> |
| +<script> |
| +if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
| + testRunner.setBackingScaleFactor(2, function() { init(); }); |
|
Justin Novosad
2016/05/16 15:56:49
function() { init(); } -> init
xidachen
2016/05/16 16:53:15
I tried this, but that doesn't work either. So I m
|
| +} |
| + |
| +var repeat = 500; |
| +var x = y = 0; |
| +var canvas = document.getElementById("output"); |
| +var ctx = canvas.getContext('2d'); |
| +ctx.fillStyle = "#FF0000"; |
| + |
| +function init() { |
| + requestAnimationFrame(animate); |
| +} |
| + |
| +function animate() |
| +{ |
| + ctx.clearRect(x, y, 50, 50); |
| + x++; |
| + y++; |
| + ctx.fillRect(x, y, 50, 50); |
| + repeat--; |
| + if (repeat == 0 && window.testRunner) |
| + testRunner.notifyDone(); |
| + if (repeat > 0) |
| + requestAnimationFrame(animate); |
| +} |
| +</script> |
| +</body> |
| +</html> |
| + |