drawImage sizes 0

Benchmark created by Jason Oster on


Preparation HTML

<img id="test" alt="Lena" src="http://www.fldoe.org/asp/k12memo/Presentations/CorporateTaxCreditScholarshipAndNRT_files/images/image8.png">
<br>
<canvas id="canvas" width="1024" height="1024" style="background-color: gray"></canvas>
<script>
  function $(e) {
    return document.getElementById(e);
  }
  var context = $("canvas").getContext("2d");
  var img = $("test");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
1. 16x16
context.drawImage(img, 504, 504, 16, 16, 504, 504, 16, 16);
ready
2. 32x32
context.drawImage(img, 496, 496, 32, 32, 496, 496, 32, 32);
ready
3. 64x64
context.drawImage(img, 480, 480, 64, 64, 480, 480, 64, 64);
ready
4. 100x100
context.drawImage(img, 462, 462, 100, 100, 462, 462, 100, 100);
ready
5. 128x128
context.drawImage(img, 448, 448, 128, 128, 448, 448, 128, 128);
ready
6. 256x256
context.drawImage(img, 384, 384, 256, 256, 384, 384, 256, 256);
ready
7. 512x512
context.drawImage(img, 256, 256, 512, 512, 256, 256, 512, 512);
ready
8. 1024x1024
context.drawImage(img, 0, 0, 1024, 1024, 0, 0, 1024, 1024);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by Jason Oster on