| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright (c) 2012 Cameron Adams. All rights reserved. | 2 Copyright (c) 2012 Cameron Adams. All rights reserved. |
| 3 Copyright (c) 2012 Code Aurora Forum. All rights reserved. | 3 Copyright (c) 2012 Code Aurora Forum. All rights reserved. |
| 4 Copyright (C) 2013 Google Inc. All rights reserved. | 4 Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 | 5 |
| 6 Redistribution and use in source and binary forms, with or without | 6 Redistribution and use in source and binary forms, with or without |
| 7 modification, are permitted provided that the following conditions are | 7 modification, are permitted provided that the following conditions are |
| 8 met: | 8 met: |
| 9 * Redistributions of source code must retain the above copyright | 9 * Redistributions of source code must retain the above copyright |
| 10 notice, this list of conditions and the following disclaimer. | 10 notice, this list of conditions and the following disclaimer. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 var particleRadius = 6; | 66 var particleRadius = 6; |
| 67 var colors = ["#cc0000", "#ffcc00", "#aaff00", "#0099cc", "#194c99", "#661999"]; | 67 var colors = ["#cc0000", "#ffcc00", "#aaff00", "#0099cc", "#194c99", "#661999"]; |
| 68 | 68 |
| 69 var canvas; | 69 var canvas; |
| 70 var context; | 70 var context; |
| 71 var testRunning = true; | 71 var testRunning = true; |
| 72 var particles = []; | 72 var particles = []; |
| 73 var prevTime; | 73 var prevTime; |
| 74 | 74 |
| 75 window.onload = function () { | 75 window.onload = function () { |
| 76 PerfTestRunner.prepareToMeasureValuesAsync({done: onCompletedRun, unit: 'fps
'}); | 76 PerfTestRunner.prepareToMeasureValuesAsync({ |
| 77 description: 'Measures performance of canvas animation.', |
| 78 done: onCompletedRun, |
| 79 unit: 'fps' |
| 80 }); |
| 77 | 81 |
| 78 // Prepare the canvas. | 82 // Prepare the canvas. |
| 79 canvas = document.querySelector('canvas'); | 83 canvas = document.querySelector('canvas'); |
| 80 canvas.width = stageWidth; | 84 canvas.width = stageWidth; |
| 81 canvas.height = stageHeight; | 85 canvas.height = stageHeight; |
| 82 context = canvas.getContext('2d'); | 86 context = canvas.getContext('2d'); |
| 83 | 87 |
| 84 // Create the particles | 88 // Create the particles |
| 85 for (var i = 0; i < maxParticles; i++) | 89 for (var i = 0; i < maxParticles; i++) |
| 86 particles.push(new Particle()); | 90 particles.push(new Particle()); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 testRunning = false; | 156 testRunning = false; |
| 153 stopTrackingFrameRate(); | 157 stopTrackingFrameRate(); |
| 154 | 158 |
| 155 document.body.removeChild(canvas); | 159 document.body.removeChild(canvas); |
| 156 particles = []; | 160 particles = []; |
| 157 } | 161 } |
| 158 </script> | 162 </script> |
| 159 </head> | 163 </head> |
| 160 <canvas></canvas> | 164 <canvas></canvas> |
| 161 </html> | 165 </html> |
| OLD | NEW |