drawImage whole pixels (v22)

Revision 22 of this benchmark created on


Preparation HTML

<canvas id="screen"></canvas>
<script>
  var ctx = document.getElementById("screen").getContext("2d");
  var image = document.createElement("img");
  image.src = "http://icons.iconarchive.com/icons/ph03nyx/super-mario/48/Retro-Mushroom-1UP-2-icon.png";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
whole pixel
ctx.drawImage(image, 1, 1);
ready
sub pixel
ctx.drawImage(image, 1.2, 1.2);
ready
sub pixel 2
ctx.drawImage(image, 1.2345, 1.2345);
ready
sub pixel 3
ctx.drawImage(image, 2, 2);
ready
sub pixel round
ctx.drawImage(image, Math.round(1.2345), Math.round(1.2345));
ready
sub pixel round 2
ctx.drawImage(image, ~~(1.2345), ~~(1.2345));
ready
half pixel
ctx.drawImage(image, 1.5, 1.5);
ready

Revisions

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