Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: third_party/WebKit/LayoutTests/images/paint-subrect.html

Issue 2496663002: Merge css3/image/ and fast/images/ to images/ (Closed)
Patch Set: Address failing tests (3 of them) Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <canvas id="canvas" width="200" height="100"></canvas> 1 <canvas id="canvas" width="200" height="100"></canvas>
2 <script> 2 <script>
3 if (window.testRunner) 3 if (window.testRunner)
4 testRunner.dumpAsTextWithPixelResults(); 4 testRunner.dumpAsTextWithPixelResults();
5 5
6 var img = new Image(); 6 var img = new Image();
7 // This is a 2x1 image, blue at (0, 0) and green at (1, 0). 7 // This is a 2x1 image, blue at (0, 0) and green at (1, 0).
8 img.src = 'data:image/png;base64,' + 8 img.src = 'data:image/png;base64,' +
9 'iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7QOjdAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwA A' + 9 'iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAIAAAB7QOjdAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwA A' +
10 'CxMBAJqcGAAAAAd0SU1FB9wIGxQKIbPpHtMAAAAPSURBVAjXY2Bg+M/wnwEABgEB/6KPEdkAAAAASUV O' + 10 'CxMBAJqcGAAAAAd0SU1FB9wIGxQKIbPpHtMAAAAPSURBVAjXY2Bg+M/wnwEABgEB/6KPEdkAAAAASUV O' +
11 'RK5CYII='; 11 'RK5CYII=';
12 12
13 img.onload = function() 13 img.onload = function()
14 { 14 {
15 // Start from the middle of the blue pixel and stretch to the entire 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 16 // canvas. Canvas should have 1/3 blue on the left and 2/3 green on the
17 // right, with gradient if interpolation allows. 17 // right, with gradient if interpolation allows.
18 var ctx = document.getElementById("canvas").getContext("2d"); 18 var ctx = document.getElementById("canvas").getContext("2d");
19 ctx.drawImage(img, 0.5, 0, 1.5, 1, 0, 0, 200, 100); 19 ctx.drawImage(img, 0.5, 0, 1.5, 1, 0, 0, 200, 100);
20 } 20 }
21 </script> 21 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698