Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / images / paint-subrect.html
blob87b72bb199dff09269a8b81a2b0018daf00abaa8
1 <canvas id="canvas" width="200" height="100"></canvas>
2 <script>
3 if (window.testRunner)
4 testRunner.dumpAsTextWithPixelResults();
6 var img = new Image();
7 // This is a 2x1 image, blue at (0, 0) and green at (1, 0).
8 img.src = 'data:image/png;base64,' +
9 'iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7QOjdAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAA' +
10 'CxMBAJqcGAAAAAd0SU1FB9wIGxQKIbPpHtMAAAAPSURBVAjXY2Bg+M/wnwEABgEB/6KPEdkAAAAASUVO' +
11 'RK5CYII=';
13 img.onload = function()
15 // Start from the middle of the blue pixel and stretch to the entire
16 // canvas. Canvas should have 1/3 blue on the left and 2/3 green on the
17 // right, with gradient if interpolation allows.
18 var ctx = document.getElementById("canvas").getContext("2d");
19 ctx.drawImage(img, 0.5, 0, 1.5, 1, 0, 0, 200, 100);
21 </script>