| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="application/x-javascript"> | 3 <script type="application/x-javascript"> |
| 4 function createImage() { | 4 function createImage() { |
| 5 var image = document.createElement('canvas'); | 5 var image = document.createElement('canvas'); |
| 6 image.height = 2; | 6 image.height = 2; |
| 7 image.width = 2; | 7 image.width = 2; |
| 8 // We use this to colour the individual pixels | 8 // We use this to colour the individual pixels |
| 9 var dotter = image.getContext('2d').createImageData(1, 1); | 9 var dotter = image.getContext('2d').createImageData(1, 1); |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 ctx.imageSmoothingEnabled = smoothing; | 56 ctx.imageSmoothingEnabled = smoothing; |
| 57 ctx.scale(10, 10); | 57 ctx.scale(10, 10); |
| 58 ctx.beginPath(); | 58 ctx.beginPath(); |
| 59 ctx.moveTo(0,0); | 59 ctx.moveTo(0,0); |
| 60 ctx.lineTo(10, 10); | 60 ctx.lineTo(10, 10); |
| 61 ctx.stroke(); | 61 ctx.stroke(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 function draw() { | 64 function draw() { |
| 65 if (window.testRunner) | 65 if (window.testRunner) |
| 66 testRunner.dumpAsText(true); | 66 testRunner.dumpAsTextWithPixelResults(); |
| 67 | 67 |
| 68 var image = createImage(); | 68 var image = createImage(); |
| 69 drawFillRect(document.getElementById('unsmoothedFillRect'), image, | 69 drawFillRect(document.getElementById('unsmoothedFillRect'), image, |
| 70 false); | 70 false); |
| 71 drawFillRect(document.getElementById('smoothedFillRect'), image, | 71 drawFillRect(document.getElementById('smoothedFillRect'), image, |
| 72 true); | 72 true); |
| 73 drawFill(document.getElementById('unsmoothedFill'), image, | 73 drawFill(document.getElementById('unsmoothedFill'), image, |
| 74 false); | 74 false); |
| 75 drawFill(document.getElementById('smoothedFill'), image, | 75 drawFill(document.getElementById('smoothedFill'), image, |
| 76 true); | 76 true); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 90 <div> | 90 <div> |
| 91 <canvas id="unsmoothedFill" width="100" height="100"></canvas> | 91 <canvas id="unsmoothedFill" width="100" height="100"></canvas> |
| 92 <canvas id="smoothedFill" width = "100" height="100"></canvas> | 92 <canvas id="smoothedFill" width = "100" height="100"></canvas> |
| 93 </div> | 93 </div> |
| 94 <div> | 94 <div> |
| 95 <canvas id="unsmoothedStroke" width="100" height="100"></canvas> | 95 <canvas id="unsmoothedStroke" width="100" height="100"></canvas> |
| 96 <canvas id="smoothedStroke" width = "100" height="100"></canvas> | 96 <canvas id="smoothedStroke" width = "100" height="100"></canvas> |
| 97 </div> | 97 </div> |
| 98 </body> | 98 </body> |
| 99 </html> | 99 </html> |
| OLD | NEW |