canvas_memory_test.html 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <!--This file executes some benchmarks with HTML Canvas and VexFlow rendering-->
  2. <!DOCTYPE html><html><head><meta charset="UTF-8"><script defer="defer">(function(){
  3. //----------------------------------------------------------------------------->
  4. window.onload = function() {
  5. window.title = "[OSMD] Canvas Memory Test"
  6. window.setTimeout(test2, 1);
  7. }
  8. var test1 = function() {
  9. var canvas = document.createElement("canvas");
  10. canvas.style.border = "1px solid red";
  11. canvas.width = 1920;
  12. canvas.height = 1080 * 30;
  13. document.body.appendChild(canvas);
  14. }
  15. var test2 = function() {
  16. var canvas = document.createElement("canvas");
  17. canvas.style.border = "1px solid red";
  18. canvas.width = 1920;
  19. canvas.height = 1080 * 30;
  20. var ctx = canvas.getContext("2d");
  21. ctx.fillStyle = "red";
  22. ctx.fillRect(0, 0, canvas.width, canvas.height);
  23. document.body.appendChild(canvas);
  24. }
  25. //----------------------------------------------------------------------------->
  26. }());</script><!--------------------------------------------------------------->
  27. </head></html><!--------------------------------------------------------------->