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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/dromaeo/tests/sunspider-3d-morph.html
===================================================================
--- chrome/test/data/dromaeo/tests/sunspider-3d-morph.html (revision 0)
+++ chrome/test/data/dromaeo/tests/sunspider-3d-morph.html (revision 0)
@@ -0,0 +1,44 @@
+<html>
+<head>
+<script src="../htmlrunner.js"></script>
+<script>
+// Test from here:
+// http://webkit.org/misc/morph.html
+
+window.onload = function(){ startTest("sunspider-3d-morph", '');
+
+var loops = 15, nx, nz, a;
+var size = 120;
+
+function morph(a,f) {
+ var PI2nx = Math.PI * 8/nx;
+ var sin = Math.sin;
+ var f30 = -(50 * sin(f*Math.PI*2));
+
+ for (var i = 0; i < nz; ++i) {
+ for (var j = 0; j < nx; ++j) {
+ a[3*(i*nx+j)+1] = sin((j-1) * PI2nx ) * -f30
+ }
+ }
+}
+
+
+prep(function(){
+ nz = nx = size / 3;
+});
+
+test("Mesh Transform", function(){
+ a = Array();
+ for (var i=0; i < nx*nz*3; ++i)
+ a[i] = 0;
+
+ for (var i = 0; i < loops; ++i) {
+ morph(a, i/loops)
+ }
+});
+
+endTest(); };
+</script>
+</head>
+<body></body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698