Chromium Code Reviews| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 var minVelocity = 50; | 64 var minVelocity = 50; |
| 65 var maxVelocity = 500; | 65 var maxVelocity = 500; |
| 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 testRunning = true; | 69 var testRunning = true; |
| 70 var particles = []; | 70 var particles = []; |
| 71 var prevTime; | 71 var prevTime; |
| 72 | 72 |
| 73 window.onload = function () { | 73 window.onload = function () { |
| 74 PerfTestRunner.prepareToMeasureValuesAsync({done: onCompletedRun, unit: 'fps '}); | 74 PerfTestRunner.prepareToMeasureValuesAsync({ |
| 75 description: 'Measures animation performance of javascript to manipulate DOM elements (animating on left and top).', | |
|
rjwright
2014/10/15 03:37:12
Maybe this would be better described as
"Measure
| |
| 76 done: onCompletedRun, | |
| 77 unit: 'fps' | |
| 78 }); | |
| 75 | 79 |
| 76 // Create the particles | 80 // Create the particles |
| 77 for (var i = 0; i < maxParticles; i++) | 81 for (var i = 0; i < maxParticles; i++) |
| 78 particles.push(new Particle()); | 82 particles.push(new Particle()); |
| 79 | 83 |
| 80 // Start the animation | 84 // Start the animation |
| 81 prevTime = PerfTestRunner.now(); | 85 prevTime = PerfTestRunner.now(); |
| 82 animate(); | 86 animate(); |
| 83 startTrackingFrameRate(); | 87 startTrackingFrameRate(); |
| 84 } | 88 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 function onCompletedRun() { | 157 function onCompletedRun() { |
| 154 stopTrackingFrameRate(); | 158 stopTrackingFrameRate(); |
| 155 | 159 |
| 156 for (var i = 0; i < particles.length; i++) | 160 for (var i = 0; i < particles.length; i++) |
| 157 particles[i].destroy(); | 161 particles[i].destroy(); |
| 158 particles = []; | 162 particles = []; |
| 159 } | 163 } |
| 160 </script> | 164 </script> |
| 161 </head> | 165 </head> |
| 162 </html> | 166 </html> |
| OLD | NEW |