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

Side by Side Diff: conformance/more/performance/jsMatrixMult.html

Issue 8342021: Add webgl conformance tests r15841. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 9 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html><head>
3 <meta charset="utf-8">
4 <link rel="stylesheet" type="text/css" href="../unit.css" />
5 <script type="application/x-javascript" src="../unit.js"></script>
6 <script type="application/x-javascript" src="../util.js"></script>
7 <script type="application/x-javascript">
8
9 Tests.autorun = false;
10 Tests.message = "This might take a second or two (or ten)";
11
12 Tests.testMatrixMultiply = function() {
13 time("testMatrixMultiply", function() {
14 var mat = Matrix.identity;
15 for (var i=0; i<1000000; i++)
16 Matrix.mul4x4(mat, mat);
17 });
18 }
19 Tests.testTransformStack = function() {
20 time("testTransformStack", function() {
21 var j = 0;
22 for (var i=0; i<1000; i++) {
23 var t = new Date().getTime();
24 var pmat = Matrix.perspective(30, 600/400, 1, 100+(t%1000));
25 var look = Matrix.lookAt([4,-1,8], [-0.2,0+(t%1000),0], [0,1,0]);
26 var rot = Matrix.rotate((t/400) % (2*Math.PI), [0, 1+(t%1000), 1]);
27 var trans = Matrix.translate3(0, Math.cos(t/1000)*1, Math.sin(t/1000 )*3);
28 var sca = Matrix.scale1(0.6+(t%1000));
29 var vmat = Matrix.identity;
30 vmat = Matrix.mul4x4(vmat, pmat);
31 vmat = Matrix.mul4x4(vmat, look);
32 vmat = Matrix.mul4x4(vmat, trans);
33 vmat = Matrix.mul4x4(vmat, sca);
34 vmat = Matrix.mul4x4(vmat, rot);
35 j += vmat.length;
36 }
37 Tests.j = j;
38 });
39 }
40
41
42 </script>
43 <style>canvas{ position:absolute; }</style>
44 </head><body>
45 <h3>1000000x JavaScript Matrix.mul4x4</h3>
46 <p id="testMatrixMultiply"></p>
47 <h3>1000x JavaScript transform stack</h3>
48 <p id="testTransformStack"></p>
49 </body></html>
50
OLDNEW
« no previous file with comments | « conformance/more/performance/jsGCPause.html ('k') | conformance/more/performance/jsToGLOverhead.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698