drawImage whole pixels (v26)

Revision 26 of this benchmark created by ramin on


Preparation HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>2</title>


<script src="app/javascript/easeljs-0.7.0.min.js"></script>
<script src="app/javascript/tweenjs-0.5.0.min.js"></script>
<script src="app/javascript/movieclip-0.7.0.min.js"></script>
<script src="app/javascript/preloadjs-0.4.0.min.js"></script>



<script src="app/javascript/soundjs-0.5.0.min.js"></script>
<script src="2.js"></script>

<script>
var canvas, stage, exportRoot;

function init() {
        canvas = document.getElementById("canvas");
        images = images||{};

        var loader = new createjs.LoadQueue(false);
        loader.installPlugin(createjs.Sound);
        loader.addEventListener("fileload", handleFileLoad);
        loader.addEventListener("complete", handleComplete);
        loader.loadManifest(lib.properties.manifest);
}

function handleFileLoad(evt) {
        if (evt.item.type == "image") { images[evt.item.id] = evt.result; }
}

function handleComplete() {
        exportRoot = new lib._2();

        stage = new createjs.Stage(canvas);
        stage.addChild(exportRoot);
        stage.update();

        createjs.Ticker.setFPS(lib.properties.fps);
        createjs.Ticker.addEventListener("tick", stage);
}

function playSound(id, loop) {
        createjs.Sound.play(id, createjs.Sound.INTERRUPT_EARLY, 0, 0, loop);
}

</script>
</head>

<body onload="init();" style="background-color:#D4D4D4">
        <canvas id="canvas" width="1280" height="720" style="background-color:#FFFFFF"></canvas>
</body>
</html>

Test runner

Ready to run.

Testing in
TestOps/sec
whole pixel
ctx.drawImage(image, 0, 0);
ready
sub pixel
ctx.drawImage(image, 0.5, 0.5);
ready

Revisions

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