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

Side by Side Diff: chrome/test/data/dromaeo/tests/sunspider-3d-morph.html

Issue 269054: Importing dromaeo performance tests to src/chrome/test/data.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../htmlrunner.js"></script>
4 <script>
5 // Test from here:
6 // http://webkit.org/misc/morph.html
7
8 window.onload = function(){ startTest("sunspider-3d-morph", '');
9
10 var loops = 15, nx, nz, a;
11 var size = 120;
12
13 function morph(a,f) {
14 var PI2nx = Math.PI * 8/nx;
15 var sin = Math.sin;
16 var f30 = -(50 * sin(f*Math.PI*2));
17
18 for (var i = 0; i < nz; ++i) {
19 for (var j = 0; j < nx; ++j) {
20 a[3*(i*nx+j)+1] = sin((j-1) * PI2nx ) * -f30
21 }
22 }
23 }
24
25
26 prep(function(){
27 nz = nx = size / 3;
28 });
29
30 test("Mesh Transform", function(){
31 a = Array();
32 for (var i=0; i < nx*nz*3; ++i)
33 a[i] = 0;
34
35 for (var i = 0; i < loops; ++i) {
36 morph(a, i/loops)
37 }
38 });
39
40 endTest(); };
41 </script>
42 </head>
43 <body></body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698