Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: tools/perf/page_sets/tough_animation_cases/compositor_heavy_animation.html

Issue 2530253002: CSS Animations: Reduce usage of webkit prefix in perf tests (Closed)
Patch Set: keyframes Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/perf/page_sets/tough_animation_cases/css_animations_many_keyframes.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style type="text/css"> 4 <style type="text/css">
5 #backdrop { 5 #backdrop {
6 float: left; 6 float: left;
7 width: 512px; 7 width: 512px;
8 height: 512px; 8 height: 512px;
9 isolation: isolate; 9 isolation: isolate;
10 background-image: linear-gradient(to bottom, 10 background-image: linear-gradient(to bottom,
11 rgba(255, 255, 0, 0.9), 11 rgba(255, 255, 0, 0.9),
12 rgba(255, 0, 0, 0.9), 12 rgba(255, 0, 0, 0.9),
13 rgba(0, 255, 0, 0.9), 13 rgba(0, 255, 0, 0.9),
14 rgba(0, 0, 255, 0.9), 14 rgba(0, 0, 255, 0.9),
15 rgba(0, 0, 0, 0.9)); 15 rgba(0, 0, 0, 0.9));
16 position: absolute; 16 position: absolute;
17 top: 100px; 17 top: 100px;
18 left: 100px; 18 left: 100px;
19 } 19 }
20 20
21 #backdrop div { 21 #backdrop div {
22 position: absolute; 22 position: absolute;
23 width: 100%; 23 width: 100%;
24 height: 100%; 24 height: 100%;
25 border-radius: 2px; 25 border-radius: 2px;
26 -webkit-transform-style: preserve-3d; 26 transform-style: preserve-3d;
27 } 27 }
28 </style> 28 </style>
29 <script src="resources/perf_test_helper.js"></script> 29 <script src="resources/perf_test_helper.js"></script>
30 <script type="text/javascript"> 30 <script type="text/javascript">
31 var N = PerfTestHelper.getN(200); 31 var N = PerfTestHelper.getN(200);
32 var duration = 2000; 32 var duration = 2000;
33 function randomColorGenerator() 33 function randomColorGenerator()
34 { 34 {
35 return '#' + Math.floor(Math.random()*16777215).toString(16); 35 return '#' + Math.floor(Math.random()*16777215).toString(16);
36 } 36 }
37 function makeKeyframes() { 37 function makeKeyframes() {
38 var keyframes = []; 38 var keyframes = [];
39 var numKeyframes = 2; 39 var numKeyframes = 2;
40 for (var i = 0; i < numKeyframes + 1; i++) { 40 for (var i = 0; i < numKeyframes + 1; i++) {
41 var fraction = i / numKeyframes; 41 var fraction = i / numKeyframes;
42 var t = (fraction * 0.6) + 0.1; 42 var t = (fraction * 0.6) + 0.1;
43 keyframes.push({opacity: t}); 43 keyframes.push({opacity: t});
44 } 44 }
45 return keyframes; 45 return keyframes;
46 } 46 }
47 function startExperiment() 47 function startExperiment()
48 { 48 {
49 var keyframes = makeKeyframes(); 49 var keyframes = makeKeyframes();
50 for (var i = 0; i < N; i++) { 50 for (var i = 0; i < N; i++) {
51 var elem = document.createElement("div"); 51 var elem = document.createElement("div");
52 elem.style.backgroundColor = randomColorGenerator(); 52 elem.style.backgroundColor = randomColorGenerator();
53 elem.style.webkitTransform = "rotateZ(" + ((i + 1) * 10.1).toString() + "deg)"; 53 elem.style.transform = "rotateZ(" + ((i + 1) * 10.1).toString() + "deg)" ;
54 backdrop.appendChild(elem); 54 backdrop.appendChild(elem);
55 elem.animate(keyframes, {duration: duration, iterations: Infinity, 55 elem.animate(keyframes, {duration: duration, iterations: Infinity,
56 direction: 'alternate', delay: -2 * duration * Math.random()}); 56 direction: 'alternate', delay: -2 * duration * Math.random()});
57 } 57 }
58 PerfTestHelper.signalReady(); 58 PerfTestHelper.signalReady();
59 } 59 }
60 window.addEventListener('load', startExperiment, false); 60 window.addEventListener('load', startExperiment, false);
61 </script> 61 </script>
62 </head> 62 </head>
63 <body> 63 <body>
64 <div id="backdrop"></div> 64 <div id="backdrop"></div>
65 </body> 65 </body>
66 </html> 66 </html>
OLDNEW
« no previous file with comments | « no previous file | tools/perf/page_sets/tough_animation_cases/css_animations_many_keyframes.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698