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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/more/performance/jsToGLOverhead.html

Issue 9373009: Check in webgl conformance tests r16844 from khronos. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 years, 10 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";
11
12 Tests.testGLOverhead = function() {
13 var gl = document.getElementById("gl").getContext(GL_CONTEXT_ID);
14 var fakeGl = {getError: function(){ return 0; }};
15 time("testGLOverhead", function() {
16 for (var i=0; i<1000000; i++)
17 gl.getError();
18 });
19 time("testJSOverhead", function() {
20 for (var i=0; i<1000000; i++)
21 fakeGl.getError();
22 });
23 time("testLoopOverhead", function() {
24 for (var i=0; i<1000000;)
25 i++;
26 });
27 }
28
29 </script>
30 <style>canvas{ position:absolute; }</style>
31 </head><body>
32 <canvas id="gl" width="16" height="16"></canvas>
33 <h3>1000000x gl.getError() (measuring JS->GL call overhead)</h3>
34 <p id="testGLOverhead"></p>
35 <h3>1000000x fakeGl.getError() (measuring JS->JS call overhead)</h3>
36 <p id="testJSOverhead"></p>
37 <h3>1000000x i++ (measuring loop overhead)</h3>
38 <p id="testLoopOverhead"></p>
39 </body></html>
40
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698