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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 var maxParticles = 2500; | 63 var maxParticles = 2500; |
| 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 var animationDuration = 10; | 68 var animationDuration = 10; |
| 69 | 69 |
| 70 var particles = []; | 70 var particles = []; |
| 71 | 71 |
| 72 window.onload = function () { | 72 window.onload = function () { |
| 73 PerfTestRunner.prepareToMeasureValuesAsync({done: onCompletedRun, unit: 'fps '}); | 73 PerfTestRunner.prepareToMeasureValuesAsync({ |
| 74 description: 'Measures performance of CSS keyframes animation (animating on left and top).', | |
|
rjwright
2014/10/15 03:37:12
"Measure performance of CSS Animations animating '
| |
| 75 done: onCompletedRun, | |
| 76 unit: 'fps' | |
| 77 }); | |
| 74 | 78 |
| 75 generateStyleElement(); | 79 generateStyleElement(); |
| 76 | 80 |
| 77 // Create the particles | 81 // Create the particles |
| 78 for (var i = 0; i < maxParticles; i++) { | 82 for (var i = 0; i < maxParticles; i++) { |
| 79 var particle = new Particle(i); | 83 var particle = new Particle(i); |
| 80 particle.start(); | 84 particle.start(); |
| 81 particles.push(particle); | 85 particles.push(particle); |
| 82 } | 86 } |
| 83 | 87 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 stopTrackingFrameRate(); | 187 stopTrackingFrameRate(); |
| 184 | 188 |
| 185 for (var i = 0; i < particles.length; i++) | 189 for (var i = 0; i < particles.length; i++) |
| 186 particles[i].destroy(); | 190 particles[i].destroy(); |
| 187 particles = []; | 191 particles = []; |
| 188 } | 192 } |
| 189 </script> | 193 </script> |
| 190 <style id="keyframes"></style> | 194 <style id="keyframes"></style> |
| 191 </head> | 195 </head> |
| 192 </html> | 196 </html> |
| OLD | NEW |