Android 4.1+ canvas clearRect fixes comparsion

Benchmark created by Denis Radin on


Preparation HTML

<canvas id="myCanvas" width="400px" height="400px"></canvas>

Setup

var testCanvas = document.querySelectorAll('#myCanvas')[0];

Test runner

Ready to run.

Testing in
TestOps/sec
Opacity fix (m...@wininup.com)
testCanvas.style.opacity = 0.99;

setTimeout(function() {
  testCanvas.style.opacity = 1;
}, 0);
ready
Visibility hidden (Dhashvir Lalla)
testCanvas.style.visibility = 'hidden';
testCanvas.offsetHeight;
testCanvas.style.visibility = 'inherit';
ready
Display none (Dhashvir Lalla)
testCanvas.style.display = 'none';
testCanvas.offsetHeight;
testCanvas.style.display = 'inherit';
ready

Revisions

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

  • Revision 1: published by Denis Radin on