-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
280 lines (240 loc) · 13.3 KB
/
index.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Animationtests</title>
<style>
section {
display: none;
}
section.show {
display: block;
}
#stage div {
position: absolute;
}
#stage {
position: relative;
width: 800px;
height: 600px;
overflow: hidden;
}
.blocktransition {
-webkit-transition: none !important;
transition: none !important;
}
#loader {
position: fixed;
background: white;
width: 100%;
height: 100%;
display: block;
top: 0%;
left: 0%;
text-align: center;
}
#loaderinner {
position: absolute;
top: 50%;
left: 50%;
}
.imagefilter, #stage canvas, #stage svg {
float: left;
}
#run {
font-size: 3em;
}
@-webkit-keyframes height
{
from {-webkit-transform: scaleY(0);}
to {-webkit-transform: scaleY(1);}
}
@keyframes height
{
from {transform: scaleY(0);}
to {transform: scaleY(1);}
}
@-webkit-keyframes cube
{
from {-webkit-transform: translate3d(0,0,0);}
to {-webkit-transform: translate3d(800px,0,0);}
}
@keyframes cube
{
from {transform: translate3d(0,0,0);}
to {transform: translate3d(800px,0,0);}
}
@-webkit-keyframes rotate
{
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}
@keyframes rotate
{
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
@-webkit-keyframes sprite
{
from {-webkit-transform: translate3d(0,0,0);}
to {-webkit-transform: translate3d(-100%,0,0);}
}
@keyframes sprite
{
from {transform: translate3d(0,0,0);}
to {transform: translate3d(-100%,0,0);}
}
</style>
</head>
<body>
<section id="start">
<div id="disclaimer">
<h1>Warning!</h1>
<p>This test tries to test the animation performance of your browser. Some tests are very demanding and may cause slowdowns of your browser, especially on mobile devices.</p>
<p>As I am writing this lines, there are some browsers on high end desktop computers which can run the complete testsuite at about 80 to 90 percent of the maximum possible frames per second (60 in each test). Other browsers will skip frames and continue with the next test.</p>
</div>
<div id="testdescription">
<h1>Run the following tests</h1>
<p>Your browser (<span id="browsername"></span> <span id="browserversion"></span> on <span id="osname"></span> <span id="osversion"></span>, device <span id="devicetype"></span>) has support for <span id="supportedfeatures"></span> and can run <span id="supportedtests"></span> of <span id="totaltests"></span> tests.</p>
<p>Select the tests you want to run (some combine techniques so there are more possible combinations than total tests):</p>
<div id="testselection">
<h2>Test Objects</h2>
<div class="testobjects">
<div><input type="checkbox" id="select_object_particle" value="Particle" class="selectobjecttype" checked="true"><label for="select_object_particle">Particle Animation (general animation performance)</label></div>
<div><input type="checkbox" id="select_object_bar" value="Bar" class="selectobjecttype" checked="true"><label for="select_object_bar">Bar Chart (general animation performance)</label></div>
<div><input type="checkbox" id="select_object_pie" value="Pie" class="selectobjecttype" checked="true"><label for="select_object_chart">Pie Chart (drawing performance)</label></div>
<div><input type="checkbox" id="select_object_line" value="Line" class="selectobjecttype" checked="true"><label for="select_object_line">Line Chart (drawing performance)</label></div>
<div><input type="checkbox" id="select_object_spinner" value="Spinner" class="selectobjecttype" checked="true"><label for="select_object_spinner">Spinner (animation performance)</label></div>
<div><input type="checkbox" id="select_object_sprite" value="Sprite" class="selectobjecttype" checked="true"><label for="select_object_sprite">Sprite (bitmap / spriting performance)</label></div>
<div><input type="checkbox" id="select_object_Cube" value="Cube" class="selectobjecttype" checked="true"><label for="select_object_Cube">Cube (animation performance)</label></div>
</div>
<h2>Test Complexity</h2>
<p>Ultra not recommended on mobile / tablet (requires good GPU / CPU), high not recommended on medium class mobile devices, medium not recommend on low end mobile devices.</p>
<div class="testiterations">
<div><input type="checkbox" id="select_iterations_low" value="low" class="selectiterations" checked="true"><label for="select_iterations_low">Low (max. 100 iterations)</label></div>
<div><input type="checkbox" id="select_iterations_medium" value="medium" class="selectiterations" checked="true"><label for="select_iterations_medium">Medium (max. 250 iterations)</label></div>
<div><input type="checkbox" id="select_iterations_high" value="high" class="selectiterations" checked="true"><label for="select_iterations_high">High (max. 1000 iterations)</label></div>
<div><input type="checkbox" id="select_iterations_ultra" value="ultra" class="selectiterations" checked="true"><label for="select_iterations_ultra">Ultra (up to 15000 iterations!)</label></div>
</div>
<h2>Test Methods</h2>
<div class="testgroup">
<h3>Canvas</h3>
<input type="checkbox" id="select_all_canvas" value="canvasall" class="selectsubgroup" checked="false" data-required="canvas,svg" ><label for="select_all_canvas">All Canvas Tests</label>
<div class="subtestgroup">
<input type="checkbox" id="select_canvas" value="canvas" class="selectsingletest" checked="false" data-required="canvas"><label for="select_canvas">Canvas 2D with PNG assets</label>
<input type="checkbox" id="select_canvasbuffer" value="canvasbuffer" class="selectsingletest" checked="false" data-required="canvas"><label for="select_canvasbuffer">Canvas 2D with Buffering</label>
<input type="checkbox" id="select_canvassvg" value="canvassvg" class="selectsingletest" checked="false" data-required="canvas"><label for="select_canvassvg">Canvas 2D with SVG assets</label>
</div>
</div>
<div class="testgroup">
<h3>SVG</h3>
<input type="checkbox" id="select_all_svg" value="svgall" class="selectsubgroup" checked="false" data-required="svg,smil,csstransforms"><label for="select_all_svg">All SVG Tests</label>
<div class="subtestgroup">
<input type="checkbox" id="select_svg" value="svg" class="selectsingletest" checked="false" data-required="svg"><label for="select_svg">SVG with attribute change</label>
<input type="checkbox" id="select_svgrebuild" value="svgrebuild" class="selectsingletest" checked="false" data-required="svg"><label for="select_svgrebuild">SVG with rebuilding SVG Elements</label>
<input type="checkbox" id="select_svgtransforms" value="svgtransforms" class="selectsingletest" checked="false" data-required="svg"><label for="select_svgtransforms">SVG with SVG Transforms</label>
<input type="checkbox" id="select_svgcsstransforms" value="svgcsstransforms" class="selectsingletest" checked="false" data-required="svg,csstransforms"><label for="select_svgcsstransforms">SVG with CSS Transforms</label>
<input type="checkbox" id="select_svganimations" value="svganimations" class="selectsingletest" checked="false" data-required="svg,smil"><label for="select_svganimations">SVG with SMIL Animations</label>
</div>
</div>
<div class="testgroup">
<h3>HTML / CSS</h3>
<input type="checkbox" id="select_all_html" value="htmlall" class="selectsubgroup" checked="false" data-required="cssanimations,csstransforms,csstransitions"><label for="select_all_html">All HTML / CSS Tests</label>
<div class="subtestgroup">
<input type="checkbox" id="select_html" value="html" class="selectsingletest" checked="false" data-required="csstransforms"><label for="select_html">HTML with CSS Transforms (3D)</label>
<input type="checkbox" id="select_htmltransition" value="htmltransition" class="selectsingletest" checked="false" data-required="csstransitions"><label for="select_htmltransition">HTML with CSS Transitions</label>
<input type="checkbox" id="select_htmlanimation" value="htmlanimation" class="selectsingletest" checked="false" data-required="cssanimations"><label for="select_animation">HTML with CSS Animations</label>
<input type="checkbox" id="select_htmlanimationsvg" value="htmlanimationsvg" class="selectsingletest" checked="false" data-required="cssanimations"><label for="select_animationsvg">HTML with CSS Animations and SVG</label>
<input type="checkbox" id="select_backgroundposition" value="backgroundposition" class="selectsingletest" checked="false" data-required="csstransforms"><label for="select_backgroundposition">HTML with background-position</label>
<input type="checkbox" id="select_htmlheight" value="htmlheight" class="selectsingletest" checked="false" data-required="default"><label for="select_htmlheight">HTML with height change</label>
<input type="checkbox" id="select_htmlposition" value="htmlposition" class="selectsingletest" checked="false" data-required="default"><label for="select_htmlposition">HTML with CSS Positioning</label>
<input type="checkbox" id="select_cssfilters" value="cssfilters" class="selectsingletest" checked="false" data-required="cssfilters"><label for="select_cssfilters">HTML with CSS Filters</label>
</div>
</div>
<div class="testgroup">
<h3>WebGL</h3>
<input type="checkbox" id="select_webgl" value="webgl" class="selectsingletest" checked="false" data-required="webgl"/><label for="select_webgl">All WebGL Tests</label>
</div>
</div>
<div id="totalteststorun">Running all tests will take approx. <span id="estimatedtimetorun"></span>.</div>
<p>
<button id="run">Run the tests!</button>
</p>
</div>
</section>
<section id="testrunner">
<div id="stage"></div>
<div id="statistics">
<h1 id="currentTest"></h1>
<p>Test <span id="currentTestNumber"></span> of <span id="totalTests"></span></p>
<p id="fps"></p>
<p>Frames remaining: <span id="remainingFrames"></span> <span id="skippedFrames"></span></p>
<p id="skippedtests"></p>
</div>
</section>
<section id="testsubmission">
</section>
<div id="loader"><div id="loaderinner">0%</div></div>
<script>
(function(){var p=[],w=window,d=document,e=f=0;p.push('ua='+encodeURIComponent(navigator.userAgent));e|=w.ActiveXObject?1:0;e|=w.opera?2:0;e|=w.chrome?4:0;
e|='getBoxObjectFor' in d || 'mozInnerScreenX' in w?8:0;e|=('WebKitCSSMatrix' in w||'WebKitPoint' in w||'webkitStorageInfo' in w||'webkitURL' in w)?16:0;
e|=(e&16&&({}.toString).toString().indexOf("\n")===-1)?32:0;p.push('e='+e);f|='sandbox' in d.createElement('iframe')?1:0;f|='WebSocket' in w?2:0;
f|=w.Worker?4:0;f|=w.applicationCache?8:0;f|=w.history && history.pushState?16:0;f|=d.documentElement.webkitRequestFullScreen?32:0;f|='FileReader' in w?64:0;
p.push('f='+f);p.push('r='+Math.random().toString(36).substring(7));p.push('w='+screen.width);p.push('h='+screen.height);var s=d.createElement('script');
s.src='vendor/whichbrowser/detect.js?' + p.join('&');d.getElementsByTagName('head')[0].appendChild(s);})();
</script>
<script src="vendor/modernizr.min.js"></script>
<script src="vendor/pixi.js"></script>
<script src="utils/polyfills.js"></script>
<script src="utils/utils.js"></script>
<script src="utils/statistics.js"></script>
<script src="utils/stage.js"></script>
<script src="testrunner.js"></script>
<script src="testsequence.js"></script>
<script src="objects/Particle.js"></script>
<script src="objects/Cube.js"></script>
<script src="objects/Bar.js"></script>
<script src="objects/Pie.js"></script>
<script src="objects/Line.js"></script>
<script src="objects/Spinner.js"></script>
<script src="objects/Sprite.js"></script>
<script src="objects/Filter.js"></script>
<script>
var setTimestamp, setTranslate;
var currentTest = 0,
testDuration = 300,
stageWidth = 800,
stageHeight= 600,
stage = document.getElementById('stage'),
statistics, stageObject, runner, breakUnderFPS = 20,
breakImmediatelyFPS = 10, stopAfterBreaks = 1, totalTestCount,
context = null, svg = null, svg_ns = "http://www.w3.org/2000/svg", webglRenderer, loader = document.getElementById('loader'), imageAsset, assets = [], testSequence;
if (Modernizr.performance) {
setTimestamp = function() { return performance.now()};
}
else {
setTimestamp = function() { return +new Date;};
}
if (Modernizr.csstransforms3d) {
setTranslate = function(x,y) {return "translate3d("+x+"px,"+y+"px,0px)";}
}
else {
setTranslate = function(x,y) {return "translate("+x+"px,"+y+"px)";}
}
function updateLoader(percent) {
document.getElementById('loaderinner').innerHTML = percent + "%";
}
function initTest() {
runner = new TestRunner(new TestSequence(),stageObject);
runner.checkSystemCapabilities();
loader.parentNode.removeChild(loader);
runner.bindEvents();
document.getElementById('start').className = "show";
}
function load() {
preloadImages(["assets/images/testimageRGB.png", "assets/sprites/sprite.png", "assets/sprites/sprite.svg", "assets/images/slices/testimageRGB_01.png", "assets/images/slices/testimageRGB_02.png", "assets/images/slices/testimageRGB_03.png", "assets/images/slices/testimageRGB_04.png", "assets/images/slices/testimageRGB_05.png", "assets/images/slices/testimageRGB_06.png"], updateLoader, initTest);
}
window.onload = load;
</script>
</body>
</html>