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

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

Issue 41503006: Add ToT WebGL conformance tests : part 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 7 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
## -0,0 +1 ##
+LF
\ No newline at end of property
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <!--
6
7 /*
8 ** Copyright (c) 2012 The Khronos Group Inc.
9 **
10 ** Permission is hereby granted, free of charge, to any person obtaining a
11 ** copy of this software and/or associated documentation files (the
12 ** "Materials"), to deal in the Materials without restriction, including
13 ** without limitation the rights to use, copy, modify, merge, publish,
14 ** distribute, sublicense, and/or sell copies of the Materials, and to
15 ** permit persons to whom the Materials are furnished to do so, subject to
16 ** the following conditions:
17 **
18 ** The above copyright notice and this permission notice shall be included
19 ** in all copies or substantial portions of the Materials.
20 **
21 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
28 */
29
30 -->
31 <link rel="stylesheet" type="text/css" href="../unit.css" />
32 <script type="application/x-javascript" src="../unit.js"></script>
33 <script type="application/x-javascript" src="../util.js"></script>
34 <script type="application/x-javascript">
35
36 Tests.autorun = false;
37
38 Tests.testInterval = function() {
39 document.getElementById('dtMax').textContent = "Running, please wait...";
40 setTimeout(function() {
41 var t0 = new Date().getTime();
42 var t = t0;
43 var dtMax = 0;
44 var frames = [];
45 var iv;
46 iv = setInterval(function() {
47 if (t > t0 + 10000) {
48 var hist = [];
49 var dtMed = 0, maxi = [0, 0];
50 for (var i=0; i<dtMax; i++) hist[i] = 0;
51 for (var i=0; i<frames.length; i++)
52 hist[frames[i]]++;
53 for (var i=0; i<hist.length; i++)
54 if (hist[i] > maxi[1]) maxi = [i, hist[i]];
55 dtMed = maxi[0];
56 var dtAvg = frames.reduce(function(s,i){return s + i;})/frames.l ength;
57 document.getElementById('dtMax').textContent = "Longest frame: " + dtMax + " ms. Average frame: " + Math.floor(dtAvg*100)*0.01 + " ms. Median fr ame: " + dtMed + " ms.";
58 clearInterval(iv);
59 var c = document.getElementById('dtCanvas');
60 c.width = frames.length;
61 c.height = dtMax;
62 var ctx = c.getContext('2d');
63 for (var i=0; i<frames.length; i++)
64 ctx.fillRect(i,0,1,frames[i]);
65 }
66 var t1 = new Date().getTime();
67 if (t1-t > dtMax) dtMax = t1-t;
68 frames.push(t1-t);
69 t = t1;
70 var rot = Matrix.rotate((t/400) % (2*Math.PI), [0, 1+(t%1000), 1]);
71 var trans = Matrix.translate3(0, Math.cos(t/1000)*1, Math.sin(t/1000 )*3);
72 for (var i=0; i<200; i++)
73 var mat = Matrix.mul4x4(rot, trans);
74 }, 16);
75 }, 0);
76 }
77
78 </script>
79 <style>canvas{ position:absolute; }</style>
80 </head><body>
81 <h3>10 seconds of 60fps 200x mul4x4, frame time statistics</h3>
82 <p id="dtMax"></p>
83 <canvas id="dtCanvas"></canvas>
84 </body></html>
85
OLDNEW
« no previous file with comments | « conformance/more/performance/bandwidth.html ('k') | conformance/more/performance/jsMatrixMult.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698