Add a content animation test that uses SVG animation.
[WebKit-https.git] / PerformanceTests / ChangeLog
1 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
2
3         Add a content animation test that uses SVG animation.
4         https://bugs.webkit.org/show_bug.cgi?id=156827
5
6         * Animation/svg-animation.html: Added.
7         * Skipped:
8
9 2016-04-22  Simon Fraser  <simon.fraser@apple.com>
10
11         Skip two content animation tests which are only meant for iOS testing.
12
13         * Animation/css-animation.html: Added.
14         * Animation/raf-animation.html: Added.
15
16         * Skipped:
17
18 2016-04-20  Simon Fraser  <simon.fraser@apple.com>
19
20         Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
21         https://bugs.webkit.org/show_bug.cgi?id=156827
22
23         Add two files missing from the previous commit.
24
25         * Animation/css-animation.html: Added.
26         * Animation/raf-animation.html: Added.
27
28 2016-04-20  Simon Fraser  <simon.fraser@apple.com>
29
30         Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
31         https://bugs.webkit.org/show_bug.cgi?id=156827
32
33         Reviewed by Stephanie Lewis.
34
35         Two new files for the content-animation suite.
36
37         After patching for use in the benchmark, these tests are a little different to other benchmarks.
38         The test content itself does not collect performance data; the tests spit out a boilerplate JSON
39         result with a placeholder for framerate, which is collected in native code.
40
41         When run as a benchmark, test completion involves a couple of bounces between the test and MobileSafari.
42         Test completion is initiated by a setTimeout() in the test, at which point location.hash is set to "#done".
43         MobileSafari detects that, and asynchronously dumps performance data. Once this is complete, MobileSafari
44         changes the URL has to "#submit", which triggers the XHR to the test relay that indicates the test is
45         complete.
46
47         * Animation/css-animation.html: Added.
48         * Animation/raf-animation.html: Added.
49
50 2016-04-15  Jon Lee  <jonlee@apple.com>
51
52         Animometer test could report a NaN
53         https://bugs.webkit.org/show_bug.cgi?id=156646
54
55         Reviewed by Darin Adler.
56         Provisionally reviewed by Said Abou-Hallawa.
57
58         * Animometer/tests/resources/main.js:
59         (didFinishInterval): The ramp controller has a first phase where it ramps up the complexity and
60         reacts based on how well the system handles the load. The assumption was that it would handle at least
61         1 particle easily. That is not always the case. As a result, an interpolation calculation could
62         end up setting an upper bound of NaN.
63
64         This occurs because we never get out of the first tier, so this._lastTierComplexity is undefined.
65         Now that we guarantee a minimum complexity of 1, modify the conditional to check for this._lastTierComplexity
66         before interpolating the upper bound of the first ramp. In the case where the system struggles with
67         1 particle, set it to currentComplexity.
68
69 2016-04-09  Jon Lee  <jonlee@apple.com>
70
71         Update Animometer to accommodate different screens
72         https://bugs.webkit.org/show_bug.cgi?id=156449
73
74         Reviewed by Darin Adler.
75         Provisionally reviewed by Said Abou-Hallawa.
76
77         * Animometer/index.html: Wrap button in a container to add padding at the bottom.
78         * Animometer/resources/debug-runner/animometer.css:
79         (@media screen and (min-device-width: 1800px)): Deleted.
80         (@media screen and (min-width: 1800px)): Cannot use min-device-width since it may match incorrectly.
81         (screen and (max-device-height: 414px) and (orientation: landscape)): Some devices swap device width
82         and height with orientation change.
83         * Animometer/resources/runner/animometer.css: Similar.
84         (screen and (min-device-width: 1024px) and (orientation: landscape)):
85         (screen and (max-device-height: 414px) and (orientation: landscape)):
86         (.frame-container): On smaller iPhones, adding 1px prevents the navigation bars from appearing.
87         (@media screen and (min-device-width: 768px) and (max-device-width: 1024px)): Deleted.
88         (@media (min-device-height: 768px) and (max-device-height: 1024px)): Target iPad Airs and similar.
89         (@media screen and (min-device-width: 1024px) and (max-device-width: 1366px)): Deleted.
90         (@media screen and (max-device-width: 1024px) and (min-device-height: 1366px)): Target iPad Pro.
91         (#results footer): Add padding below the button for testing again.
92         * Animometer/tests/master/multiply.html: Remove the center text.
93         * Animometer/tests/master/resources/text.js: Update the test so that in every frame the text moves.
94         * Animometer/tests/master/text.html: Update the text sizing depending on the size of the device.
95
96 2016-04-08  Jon Lee  <jonlee@apple.com>
97
98         Have Animometer benchmark always start with complexity of 1
99         https://bugs.webkit.org/show_bug.cgi?id=156432
100
101         Reviewed by Ryosuke Niwa.
102
103         * Animometer/tests/resources/main.js: Update the default Controller and RampController to
104         set its minimum complexities to 1 instead of 0.
105
106 2016-04-08  Jon Lee  <jonlee@apple.com>
107
108         Fix SVG benchmark test
109         https://bugs.webkit.org/show_bug.cgi?id=156410
110
111         Reviewed by Dean Jackson.
112
113         * Animometer/resources/extensions.js: Update Point.zero to be a static Point.
114         * Animometer/tests/simple/resources/tiled-canvas-image.js:
115         (Stage.call._setupTiles): Refactor.
116         * Animometer/tests/master/resources/particles.js:
117         (Particle.prototype.reset): Use Point.center.
118         (complexity): We are not using a gradient background anymore, so remove the +1.
119         * Animometer/tests/master/resources/svg-particles.js: Update to use SVG transform
120         instead of CSS transform.
121
122 2016-04-06  Jon Lee  <jonlee@apple.com>
123
124         Update master benchmark with SVG test
125         https://bugs.webkit.org/show_bug.cgi?id=156273
126
127         Reviewed by Dean Jackson.
128         Provisionally reviewed by Said Abou-Hallawa.
129
130         Switch masks tests for SVG path test.
131
132         * Animometer/resources/debug-runner/tests.js: Move mask test here.
133         * Animometer/resources/runner/tests.js: Add SVG test here.
134         * Animometer/tests/dom/particles.html: Renamed from PerformanceTests/Animometer/tests/master/particles.html.
135         * Animometer/tests/dom/resources/dom-particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/dom-particles.js.
136
137         * Animometer/tests/master/resources/particles.js: Add minPosition for bounds checking. Prevents particle from being
138         partially obscured.
139         * Animometer/tests/master/resources/svg-particles.js: Added.
140         (Particle): The particle is either a path object or a rect using a path as a clip. The
141         same path is used either way. For each particle create a linear gradient with a random
142         rotation.
143         (SVGParticlesStage): Look in #shapes to see how many different kinds of paths are available.
144         This makes the test more generic in case other shapes need to be tested.
145         * Animometer/tests/master/svg-particles.html: Added. Have two defs, one that houses each
146         particle's gradient, and one that holds the shape templates.
147
148 2016-03-27  Hunseop Jeong  <hs85.jeong@samsung.com>
149
150         [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
151         https://bugs.webkit.org/show_bug.cgi?id=148470 
152
153         Reviewed by Darin Adler.
154
155         * Skipped: Unskip the Bindings/event-target-wrapper test.
156
157 2016-03-23  Jon Lee  <jonlee@apple.com>
158
159         Update focus and leaves tests
160         https://bugs.webkit.org/show_bug.cgi?id=155825
161
162         Reviewed by Simon Fraser.
163
164         Particles would improperly disappear, before they were fully off stage. Update the calculation.
165         * Animometer/tests/dom/resources/leaves.js:
166         * Animometer/tests/master/resources/leaves.js:
167
168         * Animometer/tests/master/focus.html: Update the center element styling.
169         * Animometer/tests/master/resources/focus.js:
170         (FocusElement.Utilities.createClass): Give enough space in the container for each particle for the blur
171         to spread. It should be about 3x more space than the blur radius on each side.
172         (Stage.call.initialize): Ditto for the center element.
173
174 2016-03-23  Jon Lee  <jonlee@apple.com>
175
176         Update support for other platforms
177         https://bugs.webkit.org/show_bug.cgi?id=155824
178
179         Reviewed by Simon Fraser.
180
181         * Animometer/resources/debug-runner/animometer.css: Remove extraneous media query. All of it should
182         be handled in the release stylesheet.
183         * Animometer/resources/debug-runner/animometer.js: Add support for browsers that return an HTMLCollection
184         when retrieving radio elements with a name, instead of the selected value.
185         * Animometer/resources/runner/animometer.css: Adjust the queries for devices of varying widths.
186         (.frame-container): Move overflow:hidden to #stage.
187         * Animometer/tests/master/resources/stage.css: Consolidate into tests/resources/stage.css.
188         * Animometer/tests/resources/stage.css:
189         (body): Remove overflow:hidden.
190         (#stage): Set overflow:hidden here.
191         (#center-text): Moved from master/resources/stage.css.
192
193         Update stylesheet hrefs.
194         * Animometer/tests/master/canvas-stage.html:
195         * Animometer/tests/master/focus.html:
196         * Animometer/tests/master/leaves.html:
197         * Animometer/tests/master/multiply.html:
198         * Animometer/tests/master/particles.html:
199         * Animometer/tests/master/text.html: Adjust text size to fit in the device screen.
200
201 2016-03-23  Jon Lee  <jonlee@apple.com>
202
203         Make the benchmark require device to be in landscape orientation
204         https://bugs.webkit.org/show_bug.cgi?id=155822
205         rdar://problem/25258650
206
207         Reviewed by Ryosuke Niwa.
208
209         Check that the device is in landscape orientation. If not, disable the button to start it,
210         and show a warning message.
211
212         * Animometer/developer.html: Add a message about how the browser should be set up. Include a
213         warning message that appears if the orientation is incorrect on mobile devices.
214         * Animometer/index.html: Ditto.
215
216         * Animometer/resources/debug-runner/animometer.css: Migrate the .hidden rule into the release
217         stylesheet. Update the style to accommodate the new UI.
218         * Animometer/resources/runner/animometer.css:
219
220         * Animometer/resources/runner/animometer.js:
221         (window.benchmarkController.initialize): Add the orientation listener is needed.
222         (window.benchmarkController.addOrientationListenerIfNecessary): Only mobile devices need this. Check
223         to see for support of window.orientation.
224         (window.benchmarkController._orientationChanged): Toggle the warning based on whether we match the
225         landscape query. Set a state variable, which is needed for the debug harness. Call updateStartButtonState.
226         (window.benchmarkController.updateStartButtonState):
227         * Animometer/resources/debug-runner/animometer.js: Change _updateStartButtonState to return
228         a boolean about whether at least one test is selected. That will be used in
229         benchmarkController.updateStartButtonState(). Move the load event listener to the release version.
230         (window.benchmarkController.updateStartButtonState): Override the release version, and also check
231         that at least one test is selected.
232
233 2016-03-22  Geoffrey Garen  <ggaren@apple.com>
234
235         MallocBench: consolidate regression testing for aligned allocation
236         https://bugs.webkit.org/show_bug.cgi?id=155762
237
238         Reviewed by Michael Saboff.
239
240         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
241         * MallocBench/MallocBench/Benchmark.cpp:
242         * MallocBench/MallocBench/memalign.cpp: Removed.
243         * MallocBench/MallocBench/memalign.h: Removed. The stress_aligned test
244         covers this and much more.
245
246         * MallocBench/MallocBench/stress_aligned.cpp:
247         (benchmark_stress_aligned): Include specific tests for extreme sizes
248         and alignments.
249
250 2016-03-21  Jon Lee  <jonlee@apple.com>
251
252         Update benchmark tests
253         https://bugs.webkit.org/show_bug.cgi?id=155723
254
255         Reviewed by Darin Adler.
256         Provisionally reviewed by Said Abou-Hallawa.
257
258         Add quadratic and bezier segments to the canvas path test.
259
260         * Animometer/resources/runner/tests.js: Some of the query strings are unnecessary.
261         Rename the test.
262         * Animometer/tests/master/resources/canvas-stage.js:
263         (tune): Update to be able to take an array of possible constructors. Choose one randomly.
264         * Animometer/tests/master/resources/canvas-tests.js:
265         (CanvasLinePoint.Utilities.createClass): Move the point selection out to a separate
266         function called randomPoint() for reuse. Move X_LOOPS, Y_LOOPS, and offsets into the
267         class definition.
268         (randomPoint): Scale the grid down a little bit so that the lines along the edge of the
269         canvas are not cut off when the stroke size is thick.
270         (CanvasQuadraticSegment): Added.
271         (CanvasBezierSegment): Added.
272         (SimpleCanvasStage): Pass in an array of the different segment types. Since line segments
273         are short compared to the curved ones, make it twice as likely to render a line segment.
274         (SimpleCanvasStage.animate): Update the drawing code so that we render all line segments.
275
276         Add a helper method that selects a random element from an array.
277
278         * Animometer/tests/resources/main.js:
279         (Stage.randomElementInArray): Select a random element from the provided array.
280
281         * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Refactor.
282         * Animometer/tests/dom/resources/leaves.js: Ditto.
283         * Animometer/tests/master/resources/dom-particles.js: Ditto.
284         * Animometer/tests/master/resources/image-data.js: Ditto.
285         * Animometer/tests/master/resources/leaves.js: Ditto.
286         * Animometer/tests/simple/resources/simple-canvas-paths.js: Ditto.
287
288         Add canvas tests that includes all stroke and fill paths. This makes it possible to avoid having to
289         include the full simple canvas suite for perf testing.
290
291         * Animometer/resources/debug-runner/tests.js: Add new tests. Move the canvas test into the Canvas
292         suite.
293         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add a CanvasStroke and CanvasFill particle
294         that random selects an object to render.
295
296         * Animometer/resources/debug-runner/tests.js: Move 3D suite before basic canvas suite.
297         When updating the perf bot script, we will include the suites up to this one, but exclude
298         the basic canvas suite.
299
300         Move compositing transforms test to HTML suite and remove the empty Miscellaneous suite.
301
302         * Animometer/resources/debug-runner/tests.js:
303         * Animometer/tests/dom/compositing-transforms.html: Renamed from PerformanceTests/Animometer/tests/misc/compositing-transforms.html.
304         * Animometer/tests/dom/resources/compositing-transforms.js: Renamed from PerformanceTests/Animometer/tests/misc/resources/compositing-transforms.js.
305
306         Clean up miscellaneous test suite. Add a canvas ellipse test, and remove the other
307         canvas tests.
308
309         * Animometer/resources/debug-runner/tests.js: Add ellipse tests to the simple suite.
310         * Animometer/tests/misc/canvas-electrons.html: Removed.
311         * Animometer/tests/misc/canvas-stars.html: Removed.
312         * Animometer/tests/misc/resources/canvas-electrons.js: Removed.
313         * Animometer/tests/misc/resources/canvas-stars.js: Removed.
314         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add ellipse primitives.
315
316         Merge text tests together into one.
317
318         * Animometer/resources/runner/tests.js: Remove international.html.
319         * Animometer/tests/master/international.html: Removed.
320         * Animometer/tests/master/resources/text.js:
321         (animate): Update styling. Manually calculate gradients for the shadow particles.
322         Reduce the step size for y direction to avoid cutting text off at the margins. Increase
323         step for x since there will be a little more room.
324         * Animometer/tests/master/text.html: Add more translations and lay it out in a table.
325
326 2016-03-20  Jon Lee  <jonlee@apple.com>
327
328         Add a link to show debug data
329         https://bugs.webkit.org/show_bug.cgi?id=155724
330
331         Reviewed by Simon Fraser.
332
333         * Animometer/developer.html: Attach the onclick handler to the score.
334         * Animometer/index.html: Ditto.
335
336 2016-03-18  Dean Jackson  <dino@apple.com>
337
338         Add a basic WebGL test to Animometer
339         https://bugs.webkit.org/show_bug.cgi?id=155475
340         <rdar://problem/25156860>
341
342         Reviewed by Simon Fraser and Jon Lee.
343
344         Add a pretty simple WebGL test to Animometer
345         which tries to draw a number of animated triangles.
346         The result still needs a bit of tuning.
347
348         * Animometer/resources/debug-runner/tests.js: Add a new
349         Suite for "3D" tests.
350         * Animometer/tests/3d/resources/webgl.js: Added.
351         * Animometer/tests/3d/webgl.html: Added.
352
353 2016-03-18  Jon Lee  <jonlee@apple.com>
354
355         Add support for statically linking to a specific test
356         https://bugs.webkit.org/show_bug.cgi?id=155631
357
358         Rubber-stamped by Darin Adler.
359
360         * Animometer/developer.html: Update to call restartBenchmark instead so that it works for
361         both the preset and the manually set test sessions.
362         * Animometer/resources/debug-runner/animometer.css:
363         (.tree .link): Style the "link" UI.
364         * Animometer/resources/debug-runner/animometer.js: Move updateDisplay from suitesManager
365         to optionsManager since this is a visual option and has nothing to do with the suites
366         settings. Update the construction of the test UI by including a "link" after each test.
367         Clicking on that link brings up a JS prompt with a URL and a query string with the current
368         parameters of the controller, and selected test. Pasting this URL into the location bar will
369         automatically start running the selected test.
370         (suitesManager.suitesFromQueryString): Iterate through the Suites and tests and find the one
371         that matches the provided parameters. Returns an object similar to the form in
372         suitesManager.updateLocalStorageFromUI.
373         (benchmarkController.initialize): After settings up the events and options, try parsing the
374         query string and running the benchmark immediately. Otherwise, fall back to the form.
375         (benchmarkController.startBenchmark): Store the options and suites into member variables for
376         reuse in restartBenchmark.
377         (benchmarkController.startBenchmarkImmediatelyIfEncoded): Convert the query string to an object.
378         If that's successful, find the suite and test referenced in the query string. Start the benchmark if
379         the search for the test succeeded.
380         * Animometer/resources/extensions.js:
381         (Utilities.stripNonASCIICharacters): Helper method to convert the name of the suite and test
382         into a query-string-friendly version.
383         (Utilities.convertObjectToQueryString): Helper method to convert an object to query string
384         format.
385         (Utilities.convertQueryStringToObject): Helper method to convert query string into an object
386         with properties and values.
387
388 2016-03-16  Jon Lee  <jonlee@apple.com>
389
390         Add a new benchmark test
391         https://bugs.webkit.org/show_bug.cgi?id=155570
392
393         Reviewed by Simon Fraser.
394
395         New Leaves test includes various image sizes and opacity.
396
397         * Animometer/resources/debug-runner/tests.js: Add it to the HTML test suite.
398         * Animometer/tests/dom/leaves.html: Added.
399         * Animometer/tests/dom/resources/leaves.js: Added. Override the
400         (Particle.call.reset): Uses a range of sizes, and opacity.
401         (Particle.call.animate): Opacity goes up then down. When it hits 0, reset the particle.
402         (Particle.call.move): Set transform and opacity.
403         * Animometer/tests/master/resources/leaves.js: Get rid of the closure so that it
404         can be used in this test. Update the relative path so that it works in both the master
405         and dom test suite.
406
407 2016-03-15  Simon Fraser  <simon.fraser@apple.com>
408
409         Add developer Animometer test that bounces P3-tagged images
410         https://bugs.webkit.org/show_bug.cgi?id=155511
411
412         Reviewed by Tim Horton.
413         
414         Add a test for rendering performance of tagged images. The 5 images are tagged
415         with the Display P3 colorspace.
416
417         * Animometer/resources/debug-runner/tests.js:
418         * Animometer/tests/bouncing-particles/bouncing-tagged-images.html: Added.
419         * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Added.
420         * Animometer/tests/bouncing-particles/resources/image1.jpg: Added.
421         * Animometer/tests/bouncing-particles/resources/image2.jpg: Added.
422         * Animometer/tests/bouncing-particles/resources/image3.jpg: Added.
423         * Animometer/tests/bouncing-particles/resources/image4.jpg: Added.
424         * Animometer/tests/bouncing-particles/resources/image5.jpg: Added.
425
426 2016-03-09  Jon Lee  <jonlee@apple.com>
427
428         Enhance existing Animometer tests
429         https://bugs.webkit.org/show_bug.cgi?id=155261
430
431         Reviewed by Simon Fraser.
432
433         * Animometer/tests/master/resources/canvas-tests.js: Add a gradient to
434         the filled circles. To expose more of the gradient, add another circle.
435         (SimpleCanvasStage.call.animate): For each frame, create a gradient with
436         undulating stop points and colors. Fill the circles twice; once with
437         the solid color, and once with the gradient.
438
439         * Animometer/tests/master/resources/dom-particles.js: Refactor the
440         emission variables into a separate stage for this test. Add a colorOffset
441         variable to make the colors of each particle slightly different, since
442         the ramp controller can add large numbers of particles all at once, which
443         would otherwise get all the same color.
444         * Animometer/tests/master/resources/particles.js:
445         (initialize): Remove the code specific to the SVG mask test.
446
447         * Animometer/tests/master/resources/image-data.js:
448         (initialize): Remove unused local variable.
449         * Animometer/tests/master/resources/multiply.js:
450         (initialize): Make the test harder by adding more total particles.
451
452 2016-03-09  Jon Lee  <jonlee@apple.com>
453
454         Add text tests
455         https://bugs.webkit.org/show_bug.cgi?id=155257
456
457         Reviewed by Simon Fraser.
458
459         * Animometer/resources/extensions.js:
460         (UnitBezier.Utilities.createClass): Add a class that computes Bezier points
461         assuming that two of the control points are at (0,0) and (1,1). Taken from
462         WebCore/platform/graphics/UnitBezier.h
463         * Animometer/resources/runner/tests.js: Add a test for English text and one
464         for international text.
465         * Animometer/tests/master/international.html: Added.
466         * Animometer/tests/master/resources/text.js: Added. The test assumes there is
467         #template div which it will copy. The copies are placed behind the template, and
468         are set with different colors each frame. They are moved around with CSS transform.
469         * Animometer/tests/master/text.html: Added.
470
471         Remove the other text tests, since these ones cover the same techniques.
472         * Animometer/tests/text/layering-text.html: Removed.
473         * Animometer/tests/text/resources/layering-text.js: Removed.
474         * Animometer/tests/text/resources/text-boxes.js: Removed.
475         * Animometer/tests/text/text-boxes.html: Removed.
476         * Animometer/resources/debug-runner/tests.js:
477
478 2016-03-09  Jon Lee  <jonlee@apple.com>
479
480         Add a new image test
481         https://bugs.webkit.org/show_bug.cgi?id=155232
482
483         Reviewed by Dean Jackson.
484         Provisionally reviewed by Said Abou-Hallawa.
485
486         The image test renders PNGs and moves them with translate and rotate
487         transforms. Each particle has a lifetime, and when the lifetime ends or
488         the particle goes offscreen, it resets itself somewhere on the stage.
489
490         * Animometer/resources/debug-runner/tests.js: Remove the CSS bouncing PNG
491         images test, because this one tests the same technique.
492         * Animometer/resources/runner/tests.js: Added here as "Leaves".
493         * Animometer/tests/master/leaves.html: Added.
494         * Animometer/tests/master/resources/particles.js: Refactor out the parts
495         specific to the DOM particles test. Consequently make velocity a public
496         member.
497         (initialize): The options parameter is never used, so remove it.
498         (animate): Remove unused local variable.
499         * Animometer/tests/master/resources/leaves.js: Maintains a focal point that
500         moves back and forth across the canvas. That point affects the velocity
501         of the particles. When the focal point is on the leftmost side, it is
502         between [-6, -2], and set in reset(). When the focal point is on the rightmost
503         side, it will be from [2, 6].
504         * Animometer/tests/master/resources/dom-particles.js: Move JS specific to
505         this test here from particles.js.
506
507         New images.
508         * Animometer/tests/master/resources/compass100.png: Added.
509         * Animometer/tests/master/resources/console100.png: Added.
510         * Animometer/tests/master/resources/contribute100.png: Added.
511         * Animometer/tests/master/resources/debugger100.png: Added.
512         * Animometer/tests/master/resources/inspector100.png: Added.
513         * Animometer/tests/master/resources/layout100.png: Added.
514         * Animometer/tests/master/resources/performance100.png: Added.
515         * Animometer/tests/master/resources/script100.png: Added.
516         * Animometer/tests/master/resources/shortcuts100.png: Added.
517         * Animometer/tests/master/resources/standards100.png: Added.
518         * Animometer/tests/master/resources/storage100.png: Added.
519         * Animometer/tests/master/resources/styles100.png: Added.
520         * Animometer/tests/master/resources/timeline100.png: Added.
521
522 2016-03-03  Jon Lee  <jonlee@apple.com>
523
524         Add ability to retrieve raw data from release harness
525         https://bugs.webkit.org/show_bug.cgi?id=155026
526
527         Reviewed by Simon Fraser.
528
529         * Animometer/developer.html: Remove the special UI in the debug
530         harness.
531         * Animometer/resources/runner/animometer.css: Add styles for the
532         overlay.
533         * Animometer/resources/runner/animometer.js: Let 'j' show the JSON
534         results, but only if the overlay doesn't exist. Add 'esc' key to dismiss
535         the overlay.
536         (window.benchmarkController.selectResults): Cycle the cases around
537         so that the first 's' press selects both the benchmark score and
538         the individual test scores.
539         * Animometer/resources/debug-runner/animometer.css: Remove
540         unneeded rules.
541         * Animometer/resources/debug-runner/animometer.js: Make the same
542         call to handleKeyPress.
543
544 2016-03-03  Jon Lee  <jonlee@apple.com>
545
546         Make sure multiply test particles have at least some opacity
547         https://bugs.webkit.org/show_bug.cgi?id=155027
548
549         Reviewed by Simon Fraser.
550
551         * Animometer/tests/master/resources/multiply.js:
552         (initialize): Have the elements spin a little faster to make it
553         more obvious when the system is being stressed.
554         (_addTile):
555         (animate): Make sure each element being animated has at least 1%
556         opacity.
557
558 2016-03-03  Jon Lee  <jonlee@apple.com>
559
560         Update image test
561         https://bugs.webkit.org/show_bug.cgi?id=154962
562
563         Rubber-stamped by Darin Adler.
564
565         * Animometer/tests/master/image-data.html: Make each canvas have a compositing layer.
566         * Animometer/tests/master/resources/image-data.js:
567         (initialize): Update to load multiple images serially.
568         (_loadImage):
569         (tune): Use display instead of visibility. When showing an element anew, move it somewhere else.
570         (_createTestElement): Set up the element, refactor out placement of element to _refreshElement.
571         (_refreshElement): Place element in a tile grid.
572         (animate):
573         (_getRandomNeighboringPixelIndex): Use a more conservative distribution to make the effect last a little longer.
574         * Animometer/tests/master/resources/compass.svg: Added.
575         * Animometer/tests/master/resources/console.svg: Added.
576         * Animometer/tests/master/resources/contribute.svg: Added.
577         * Animometer/tests/master/resources/debugger.svg: Added.
578         * Animometer/tests/master/resources/inspector.svg: Added.
579         * Animometer/tests/master/resources/layout.svg: Added.
580         * Animometer/tests/master/resources/performance.svg: Added.
581         * Animometer/tests/master/resources/script.svg: Added.
582         * Animometer/tests/master/resources/shortcuts.svg: Added.
583         * Animometer/tests/master/resources/standards.svg: Added.
584         * Animometer/tests/master/resources/storage.svg: Added.
585         * Animometer/tests/master/resources/styles.svg: Added.
586         * Animometer/tests/master/resources/timeline.svg: Added.
587
588 2016-03-02  Jon Lee  <jonlee@apple.com>
589
590         Add some new controllers, and refine tests
591         https://bugs.webkit.org/show_bug.cgi?id=154914
592
593         Reviewed by Simon Fraser.
594
595         Improve tests.
596
597         * Animometer/tests/master/focus.html: Move each particle into a layer. Put the particle
598         in a container element. Expand the container element by the max blur radius, and clip
599         overflow. This way, when the blur is applied, it avoids causing layer resizes.
600         * Animometer/tests/master/resources/focus.js:
601         (FocusElement.Utilities.createClass): Create a container element, and put the particle
602         inside.
603         (hide): Set display:none.
604         (show): Set display:block.
605         (animate): Apply filters to the container element.
606         (FocusStage.call.initialize): Instead of inserting and removing elements from the DOM,
607         keep them in the stage, but set the display style instead. Use this._offsetIndex to
608         keep track of which elements are displayed.
609         (FocusStage.call.animate): Move some calculations around to avoid doing unneeded math.
610         (FocusStage.call.getBlurValue): Make sure elements are always blurred.
611         (FocusStage.call.getOpacityValue): Make sure elements have some opacity.
612         * Animometer/tests/master/resources/multiply.js: Have the particles on the edge of the
613         stage appear less black when the complexity gets large enough.
614         (tune): Have this._distanceFactor calculate the factor. Avoid calculating square root each
615         frame.
616
617 2016-03-02  Jon Lee  <jonlee@apple.com>
618
619         Add some new controllers, and refine tests
620         https://bugs.webkit.org/show_bug.cgi?id=154914
621
622         Reviewed by Simon Fraser.
623
624         Add a controller that centers around 30 fps instead of 60 fps.
625
626         * Animometer/developer.html: Add a new option.
627         * Animometer/resources/debug-runner/animometer.js:
628         * Animometer/resources/runner/animometer.js:
629         (this._processData.findRegression): When calculating the complexity-frameLength regression,
630         check the controller, and use a 30 fps baseline if needed.
631         * Animometer/resources/statistics.js:
632         (Regression.Utilities.createClass): Update to allow clients to specify the baseline
633         frame length.
634         * Animometer/tests/resources/main.js:
635         (tune): Override some of the constants in RampController. Move those constants out for
636         easier reading.
637
638         Add a fixed controller, with no step.
639
640         * Animometer/developer.html: Add a controller that takes no step.
641         * Animometer/resources/debug-runner/animometer.js:
642         * Animometer/tests/resources/main.js:
643         (Rotater.Utilities.createClass):
644
645         Switch to ramp controller as default.
646
647         * Animometer/developer.html: Increase the test length to 20 seconds.
648         * Animometer/resources/debug-runner/animometer.js: Rename the "adjustment" field to "controller"
649         since that is a more accurate description.
650         * Animometer/resources/debug-runner/graph.js:
651         * Animometer/resources/runner/animometer.js: Update preferences for release suite.
652
653 2016-02-26  Jon Lee  <jonlee@apple.com>
654
655         Address Dean's comments in 154673.
656
657         * Animometer/developer.html:
658         * Animometer/resources/debug-runner/animometer.js:
659         * Animometer/resources/debug-runner/graph.js:
660
661 2016-02-25  Jon Lee  <jonlee@apple.com>
662
663         Update animation benchmark and tests
664         https://bugs.webkit.org/show_bug.cgi?id=154673
665
666         Reviewed by Dean Jackson.
667
668         Update test visuals.
669
670         * Animometer/tests/master/resources/canvas-tests.js:
671         (CanvasLineSegment.Utilities.createClass): Line segments near the edge of the stage get clipped.
672         Update circle position and radius to minimize impact.
673         * Animometer/tests/master/resources/particles.js: Get rid of rotating gradient background, and
674         have 3 locations for emitting particles.
675         * Animometer/tests/master/resources/multiply.js: Update distance metric so that fringe tiles get
676         more color.
677         (initialize): Fix some of the math for laying out the tiles.
678         (animate): When a tile isn't used, set visibility: hidden.
679
680 2016-02-24  Jon Lee  <jonlee@apple.com>
681
682         Update animation benchmark and tests
683         https://bugs.webkit.org/show_bug.cgi?id=154673
684
685         Reviewed by Dean Jackson.
686
687         Update the ramp controller.
688
689         The controller refines the complexity interval to test across.
690
691         * Animometer/resources/statistics.js: Add functions that estimate cumulative distribution function.
692         (Regression): For the flat regression, force the first segment to be at 60 fps.
693         (valueAt): Add convenience function to return interpolated value based on the regression used.
694         (_calculateRegression): Include the number of points included for both segments, and the piecewise
695         errors.
696         * Animometer/tests/resources/math.js: Make the Kalman estimator subclass Experiment, and allow it
697         to be reset.
698
699         * Animometer/tests/resources/main.js: Initialize the tier such that it starts at 10^0 = 1.
700         Increase the number of ramps. Maintain three FPS thresholds-- the frame rate of interest, a limit
701         on the lowest FPS we care to go for later interpolation, and a minimum FPS threshold we want to
702         aim for each ramp. Also keep three estimators: a running average of the change point, a minimum
703         boundary for each ramp, and an estimator for all the frames within an interval. The first two
704         are used to determine the parameters of the next ramp, and the latter allows us to refine the
705         parameters.
706         (update): During the tier phase, it is possible that the highest complexity possible for a test
707         won't stress the system enough to trigger stopping the tier phase and transitioning to the ramps.
708         If the complexity doesn't change when going to the next tier, we've maxed the test out, and move
709         on. When the tier phase completed, turn off Controller.frameLengthEstimator, which estimates the
710         FPS at each tier.
711         (tune): At each interval, look at the confidence distribution of being on the 60 FPS side or the
712         slow side. If the slowest FPS we achieve at the ramp's maximum complexity is not at least
713         _fpsRampSlowThreshold, then increase the maximum complexity. If we ever achieve 60 FPS, increase
714         the ramp's minimum complexity to that level. If, at an even lower complexity, a glitch causes the
715         FPS to drop, we reset the minimum complexity.
716
717         Have the bootstrap calculation occur between tests. Clean up harness.
718
719         * Animometer/resources/debug-runner/animometer.js: Run bootstrap after a test has
720         completed to avoid doing all of it at the end before showing the results. Clean up
721         parameters being passed around.
722         * Animometer/resources/debug-runner/tests.js:
723         (text):
724         * Animometer/resources/runner/animometer.js:
725         (this._processData.calculateScore): Save the results to the same object holding the data.
726         (this._processData._processData): In the case where a file is dragged, calculate the score
727         serially. Grab the results object and move it to the results variable and remove it from
728         the data object. This avoids serializing the results into the JSON.
729         (this._processData.findRegression): Include the samples used for bootstrapping. Reduce the
730         resample size to shorten the wait.
731         * Animometer/resources/runner/benchmark-runner.js:
732         * Animometer/resources/statistics.js:
733         (bootstrap): Update how bootstrapData is sorted. In some regression results the mix of
734         floats and integers causes an alphabetical sort to occur.
735         * Animometer/resources/strings.js:
736
737         Add meta charset so that encodings between harness and test match.
738
739         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
740         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
741         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
742         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
743         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
744         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
745         * Animometer/tests/master/canvas-stage.html:
746         * Animometer/tests/master/focus.html:
747         * Animometer/tests/master/image-data.html:
748         * Animometer/tests/master/multiply.html:
749         * Animometer/tests/master/particles.html:
750         * Animometer/tests/misc/canvas-electrons.html:
751         * Animometer/tests/misc/canvas-stars.html:
752         * Animometer/tests/misc/compositing-transforms.html:
753         * Animometer/tests/simple/simple-canvas-paths.html:
754         * Animometer/tests/simple/tiled-canvas-image.html:
755         * Animometer/tests/template/template-canvas.html:
756         * Animometer/tests/template/template-css.html:
757         * Animometer/tests/template/template-svg.html:
758         * Animometer/tests/text/layering-text.html:
759         * Animometer/tests/text/text-boxes.html:
760
761         Update test harness reporting.
762
763         * Animometer/developer.html: Add missing meta charset.
764         * Animometer/index.html: Remove unnecessary utf-8 declaration.
765         * Animometer/resources/debug-runner/animometer.css: Add convenience classes for
766         formatting the results table.
767         * Animometer/resources/debug-runner/animometer.js: Adjust which stats are shown.
768         * Animometer/resources/debug-runner/tests.js: Display bootstrapping statistics.
769         * Animometer/resources/strings.js: Move strings not used by the release harness.
770
771         Switch to a pseudo-random number generator.
772
773         * Animometer/resources/statistics.js: Add a Pseudo class, with a simple
774         pseudo-random number generator.
775         (_calculateRegression): Reset the generator before running bootstrap.
776         (bootstrap): Deleted.
777
778         Replace Math.random with Pseudo.random.
779         * Animometer/tests/master/resources/canvas-tests.js:
780         * Animometer/tests/master/resources/focus.js:
781         * Animometer/tests/master/resources/particles.js:
782         * Animometer/tests/resources/main.js:
783
784         Use bootstrapping to get confidence interval in the breakpoint.
785
786         For the ramp controller, calculate the piecewise regression, and then use
787         bootstrapping in order to find the 95% confidence interval. Use the raw data.
788
789         * Animometer/developer.html: Default to the complexity graph. Add a legend
790         checkbox to toggle visibility of the bootstrap score and histogram.
791         * Animometer/resources/debug-runner/animometer.css: Make some more space to show
792         the old raw and average scores in the legend. Add new styles for the data.
793         * Animometer/resources/debug-runner/graph.js:
794         (_addRegressionLine): Allow passing an array for the variance bar tied to the
795         regression line. Now |stdev| is |range|.
796         (createComplexityGraph): Add bootstrap median, and overlay a histogram of
797         the bootstrap samples. Switch raw samples from circles to X's.
798         (onComplexityGraphOptionsChanged): Allow toggling of the bootstrap data.
799         (onGraphTypeChanged): Move the regressions for the raw and average samples to the
800         legend. In the subtitle use the bootstrap median, and include the 95% confidence
801         interval.
802         * Animometer/resources/runner/animometer.js:
803         (this._processData.findRegression): Factor out the code that determines which
804         samples to include when calculating the piecewise regression. For series that have
805         many samples, or a wider range of recorded complexities, throw away the 2.5%
806         lowest and highest samples before calculating the regression. Keep all samples
807         if the number of samples to regress is small or the range of complexities is
808         narrow.
809         (this._processData._calculateScore): Factor out regression calculation to
810         findRegression(). Bootstrap the change point of the regression. The score is the
811         median.
812         * Animometer/resources/statistics.js:
813         (_calculateRegression): Correct an issue in the calculation of the regression, where
814         the denominator can be 0.
815         (bootstrap): Template for bootstrapping. Create a bootstrap sample array, Create
816         re-samples by random selection with replacement. Return the 95% confidence samples,
817         the bootstrap median, mean, and the data itself.
818         * Animometer/resources/strings.js: Add bootstrap.
819         * Animometer/tests/resources/main.js:
820         (processSamples): Don't prematurely cut the sample data.
821
822         Fix graph drawing.
823
824         * Animometer/resources/debug-runner/animometer.js: Add spacing in the JSON output.
825         Multiple tests output a lot of JSON and can hang when selecting JSON with no whitespace.
826         * Animometer/resources/debug-runner/animometer.css:
827         (#complexity-graph .series.raw circle): Update the color.
828         * Animometer/resources/debug-runner/graph.js: Use the FPS axis instead of the
829         complexity axis, which can vary in domain. For determining the complexity domain,
830         only use samples after samplingTimeOffset.
831
832         Allow dropping results JSON.
833
834         * Animometer/developer.html: Add a button.
835         * Animometer/resources/debug-runner/animometer.css:
836         * Animometer/resources/debug-runner/animometer.js: Read the data and go straight
837         to the dashboard. With JSON output, write out only the options and the raw data.
838
839         Teach the harness to evaluate the samples and determine the test score.
840
841         This will allow us to update how the score is calculated separately from the samples recorded.
842         This also prepares the harness to be able to accept JSON of prior runs.
843
844         * Animometer/resources/strings.js: Clean up and remove unneeded strings and reduce some of the
845         hierarchy.
846         * Animometer/resources/debug-runner/tests.js: Update to use the new strings.
847
848         * Animometer/tests/resources/main.js: Allow all controllers to show a complexity-FPS graph.
849         (_processComplexitySamples): Factor out some of the sample processing done in the ramp
850         controller for the benefit of the other controllers. |complexitySamples| contains a list of
851         samples. Sort the samples by complexity. Optionally remove the top x% of samples.
852         Group them, and calculate distribution of samples within the same complexity, and add those as
853         new entries into |complexityAverageSamples|.
854         (Controller.processSamples): Move the code responsible for determining the complexity and FPS
855         scores out to ResultsDashboard. The structure of the data returned by the controller is:
856
857         {
858             controller: [time-regression, time-regression, ...], // optional, data specific to controller
859             marks: [...],
860             samples: {                    // all of the sample data
861                 controller: [...],
862                 complexity: [...],        // processed from controller samples
863                 complexityAverage: [...], // processed from complexity samples
864             }
865         }
866
867         (AdaptiveController.processSamples): Adding the target frame length is no longer necessary; we
868         now pass the test options to the graph.
869         (Regression): Move to statistics.js.
870         * Animometer/resources/statistics.js: Move Regression to here. Add a check if the sampling range
871         only contains one sample, since we cannot calculate a regression from one sample point.
872
873         Teach the test harness to evaluate the data.
874         * Animometer/resources/runner/animometer.js:
875         (ResultsDashboard): Store the options used to run the test and the computed results/score separately
876         from the data. The results are stored as:
877
878         {
879             score: /* geomean of iteration score */,
880             iterationsResults: [
881                 {
882                     score: /* geomean of tests */,
883                     testsResults: {
884                         suiteName: {
885                             testName: {
886                                 controller: {
887                                     average:
888                                     concern:
889                                     stdev:
890                                     percent:
891                                 },
892                                 frameLength: { ... },
893                                 complexity: {
894                                     complexity:
895                                     stdev:
896                                     segment1:
897                                     segment2:
898                                 },
899                                 complexityAverage: { ... }
900                             },
901                             testName: { ... },
902                         },
903                         ... next suite ...
904                     }
905                 },
906                 { ...next iteration... }
907             ]
908         }
909
910         * Animometer/resources/debug-runner/animometer.js: Pass options around instead of relying
911         on what was selected in the form. This will later allow for dropping previous results, and
912         using those runs' options when calculating scores.
913         (ResultsTable._addGraphButton): Simplify button action by using attached test data.
914         * Animometer/resources/debug-runner/graph.js: Refactor to use the data.
915
916         Consolidate JS files, and move statistics out to a separate JS.
917
918         Preparation for having the Controller only handle recording and storage of the samples,
919         and leave the evaluation of the test score out to the harness. Move Experiment to
920         a new statistics.js, where Regression will also eventually go. Get rid of algorithm.js
921         and move it to utilities.js since the Heap is used only for Experiments.
922
923         * Animometer/tests/resources/algorithm.js: Removed. Heap is in utilities.js.
924         * Animometer/tests/resources/sampler.js: Removed. Experiment is in statistics.js,
925         Sampler in main.js.
926         * Animometer/tests/resources/main.js: Move Sampler here.
927         * Animometer/resources/statistics.js: Added. Move Statistics and Experiment here.
928         * Animometer/resources/extensions.js: Move Heap here. Attach static method to create
929         a max or min heap to Heap, instead of a new Algorithm object.
930
931         Update JS files.
932         * Animometer/developer.html:
933         * Animometer/index.html:
934         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
935         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
936         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
937         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
938         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
939         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
940         * Animometer/tests/master/canvas-stage.html:
941         * Animometer/tests/master/focus.html:
942         * Animometer/tests/master/image-data.html:
943         * Animometer/tests/master/multiply.html:
944         * Animometer/tests/master/particles.html:
945         * Animometer/tests/misc/canvas-electrons.html:
946         * Animometer/tests/misc/canvas-stars.html:
947         * Animometer/tests/misc/compositing-transforms.html:
948         * Animometer/tests/simple/simple-canvas-paths.html:
949         * Animometer/tests/simple/tiled-canvas-image.html:
950         * Animometer/tests/template/template-canvas.html:
951         * Animometer/tests/template/template-css.html:
952         * Animometer/tests/template/template-svg.html:
953         * Animometer/tests/text/layering-text.html:
954         * Animometer/tests/text/text-boxes.html:
955
956         Fix the cursor in the graph analysis when the min
957         complexity is not 0.
958
959         * Animometer/resources/debug-runner/graph.js:
960         (_addRegression):
961         (createComplexityGraph):
962
963 2016-02-23  Geoffrey Garen  <ggaren@apple.com>
964
965         Fix some issues in MallocBench
966         https://bugs.webkit.org/show_bug.cgi?id=154600
967
968         Reviewed by Oliver Hunt.
969
970         * MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops
971         a part of the build so that it copies to the right place for execution.
972
973         * MallocBench/MallocBench/Interpreter.cpp:
974         (Interpreter::Interpreter): Don't try to open .ops files for writing
975         because we're only going to read and we might need extra permissions to
976         write.
977
978         (Interpreter::~Interpreter): Give more context when opening a file fails
979         to help with debugging.
980
981         * MallocBench/MallocBench/stress.cpp:
982         (benchmark_stress): Reduce iterations to complete in less than 10 seconds.
983
984 2016-02-23  Michael Saboff  <msaboff@apple.com>
985
986         Unreviewed change to revert extraneous changes made part of change set 196955.
987
988         * MallocBench/MallocBench/Interpreter.cpp:
989         (Interpreter::doMallocOp):
990         (Interpreter::Thread::switchTo):
991         (writeData): Deleted.
992
993 2016-02-19  Michael Saboff  <msaboff@apple.com>
994
995         MallocBench: Added recording for nimlang website, new recording details and added new options
996         https://bugs.webkit.org/show_bug.cgi?id=154485
997
998         Reviewed by Geoff Garen.
999
1000         Added new capabilities to MallocBench.  These include:
1001             Added a recording of http://nim-lang.org/docs/lib.html.
1002             Added thread id to the recording and the ability to playback switching threads in MallocBench
1003             Added aligned allocations to recordings and the ability to playback
1004             Added --use-thread-id option to honor recorded thread ids
1005             Added --detailed-report to output remaining allocations by size after playback
1006             Added --no-warmup to not run the warm up iteration
1007
1008         Changed the way that options are passed down to the benchmarks.  Instead of passing individual
1009         boolean or numeric option values, just pass a reference the CommandLine itself.  Each benchmark
1010         can access the options that are appropriate.  The Benchmark class also uses the options for
1011         is parallel, run counts and warm up.
1012
1013         Added thread id and aligned malloc to the Op by noticing that structure padding and Opcode allowed
1014         for another 32 bits of data.  Breaking that unused 32 bits into a 16 bit thread id value and a
1015         16 bit log base 2 of the alignment for aligned malloc allowed for existing recordings to playback
1016         without any incompatibilities.
1017
1018         Threaded operation is simulated by creating threads as needed.  As long as the next Op's thread id
1019         is the same as the last, operation continues as normal.  When the next Op has a different thread id,
1020         we switch to that thread using the shared Op stream to continue playing back.  There is a mutex to
1021         assure that only one thread is really running at a time and a condition variable used to wait
1022         that the current thread id matches each block thread's thread id.  This doesn't simulate true
1023         concurrent threading, but is instead plays back Ops recorded for multiple thread faithfully.
1024
1025         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
1026         * MallocBench/MallocBench/Benchmark.cpp:
1027         (deallocateHeap):
1028         (Benchmark::Benchmark):
1029         (Benchmark::runOnce):
1030         (Benchmark::run):
1031         * MallocBench/MallocBench/Benchmark.h:
1032         (Benchmark::isValid):
1033         * MallocBench/MallocBench/CommandLine.cpp:
1034         (CommandLine::printUsage):
1035         * MallocBench/MallocBench/CommandLine.h:
1036         (CommandLine::isValid):
1037         (CommandLine::benchmarkName):
1038         (CommandLine::isParallel):
1039         (CommandLine::useThreadID):
1040         (CommandLine::detailedReport):
1041         (CommandLine::warmUp):
1042         (CommandLine::heapSize):
1043         (CommandLine::runs):
1044         * MallocBench/MallocBench/Interpreter.cpp:
1045         (Interpreter::Interpreter):
1046         (Interpreter::run):
1047         (Interpreter::readOps):
1048         (Interpreter::doOnSameThread):
1049         (Interpreter::switchToThread):
1050         (Interpreter::detailedReport):
1051         (compute2toPower):
1052         (writeData):
1053         (Interpreter::doMallocOp):
1054         (Interpreter::Thread::Thread):
1055         (Interpreter::Thread::stop):
1056         (Interpreter::Thread::~Thread):
1057         (Interpreter::Thread::runThread):
1058         (Interpreter::Thread::waitToRun):
1059         (Interpreter::Thread::switchTo):
1060         * MallocBench/MallocBench/Interpreter.h:
1061         (Interpreter::Thread::isMainThread):
1062         * MallocBench/MallocBench/alloc_free.cpp: Added.
1063         (benchmark_alloc_free):
1064         * MallocBench/MallocBench/alloc_free.h: Added.
1065         * MallocBench/MallocBench/balloon.cpp:
1066         (benchmark_balloon):
1067         * MallocBench/MallocBench/balloon.h:
1068         * MallocBench/MallocBench/big.cpp:
1069         (benchmark_big):
1070         * MallocBench/MallocBench/big.h:
1071         * MallocBench/MallocBench/churn.cpp:
1072         (benchmark_churn):
1073         * MallocBench/MallocBench/churn.h:
1074         * MallocBench/MallocBench/facebook.cpp:
1075         (benchmark_facebook):
1076         * MallocBench/MallocBench/facebook.h:
1077         * MallocBench/MallocBench/flickr.cpp:
1078         (benchmark_flickr):
1079         (benchmark_flickr_memory_warning):
1080         * MallocBench/MallocBench/flickr.h:
1081         * MallocBench/MallocBench/fragment.cpp:
1082         (validate):
1083         (benchmark_fragment):
1084         (benchmark_fragment_iterate):
1085         * MallocBench/MallocBench/fragment.h:
1086         * MallocBench/MallocBench/list.cpp:
1087         (benchmark_list_allocate):
1088         (benchmark_list_traverse):
1089         * MallocBench/MallocBench/list.h:
1090         * MallocBench/MallocBench/main.cpp:
1091         (main):
1092         * MallocBench/MallocBench/medium.cpp:
1093         (benchmark_medium):
1094         * MallocBench/MallocBench/medium.h:
1095         * MallocBench/MallocBench/memalign.cpp:
1096         (test):
1097         (benchmark_memalign):
1098         * MallocBench/MallocBench/memalign.h:
1099         * MallocBench/MallocBench/message.cpp:
1100         (benchmark_message_one):
1101         (benchmark_message_many):
1102         * MallocBench/MallocBench/message.h:
1103         * MallocBench/MallocBench/nimlang.cpp: Added.
1104         (benchmark_nimlang):
1105         * MallocBench/MallocBench/nimlang.h: Added.
1106         * MallocBench/MallocBench/nimlang.ops: Added.
1107         * MallocBench/MallocBench/realloc.cpp:
1108         (benchmark_realloc):
1109         * MallocBench/MallocBench/realloc.h:
1110         * MallocBench/MallocBench/reddit.cpp:
1111         (benchmark_reddit):
1112         (benchmark_reddit_memory_warning):
1113         * MallocBench/MallocBench/reddit.h:
1114         * MallocBench/MallocBench/stress.cpp:
1115         (deallocate):
1116         (benchmark_stress):
1117         * MallocBench/MallocBench/stress.h:
1118         * MallocBench/MallocBench/stress_aligned.cpp:
1119         (benchmark_stress_aligned):
1120         * MallocBench/MallocBench/stress_aligned.h:
1121         * MallocBench/MallocBench/theverge.cpp:
1122         (benchmark_theverge):
1123         (benchmark_theverge_memory_warning):
1124         * MallocBench/MallocBench/theverge.h:
1125         * MallocBench/MallocBench/tree.cpp:
1126         (benchmark_tree_allocate):
1127         (benchmark_tree_traverse):
1128         (benchmark_tree_churn):
1129         * MallocBench/MallocBench/tree.h:
1130         * MallocBench/run-malloc-benchmarks:
1131
1132 2016-02-11  Jon Lee  <jonlee@apple.com>
1133
1134         Fix a missing refactoring.
1135
1136         * Animometer/tests/master/resources/multiply.js:
1137         (animate): Move to Utilities.lerp.
1138         (_lerp): Deleted.
1139
1140 2016-02-10  Jon Lee  <jonlee@apple.com>
1141
1142         Add new benchmark tests.
1143         https://bugs.webkit.org/show_bug.cgi?id=154063
1144
1145         Provisionally reviewed by Said Abou-Hallawa.
1146
1147         Add tests for get/put image data, filters, opacity, and css transforms.
1148
1149         * Animometer/resources/runner/benchmark-runner.js:
1150         (_runBenchmarkAndRecordResults): Update the body background color to match that of
1151         the stage.
1152         (this._runNextIteration): Clear the background color style for the results page.
1153         * Animometer/resources/runner/tests.js:
1154         * Animometer/tests/master/focus.html: Added.
1155         * Animometer/tests/master/image-data.html: Added.
1156         * Animometer/tests/master/multiply.html: Added.
1157         * Animometer/tests/master/resources/focus.js: Added.
1158         * Animometer/tests/master/resources/image-data.js: Added.
1159         * Animometer/tests/master/resources/multiply.js: Added.
1160         * Animometer/tests/master/resources/stage.css: Move common styles out.
1161         * Animometer/tests/resources/main.js: Update Stage.randomBool to use Math.random.
1162         Add Stage.randomSign for randomly setting a direction. Add the notion of the
1163         current timestamp of the test to Benchmark, since some animations cycle through
1164         colors and rely on an incremental counter like the time.
1165
1166 2016-02-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1167
1168         Add internal benchmark tests for CSS mix-blend-modes and filters
1169         https://bugs.webkit.org/show_bug.cgi?id=154058
1170
1171         Provisionally reviewed by Jon Lee.
1172
1173         * Animometer/resources/debug-runner/tests.js: Include the new tests in the
1174         "HTML suite" of the debug runner.
1175
1176         * Animometer/resources/extensions.js:
1177         (Utilities.browserPrefix):
1178         (Utilities.setElementPrefixedProperty): Utility functions to allow setting
1179         prefixed style properties.
1180
1181         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1182         Set the mix-blend-mode and the filter to some random values if the options
1183         of the test requested that.
1184
1185         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1186         (parseShapeParameters): Parse the url options "blend" and "filter" and set
1187         the corresponding flags.
1188
1189         * Animometer/tests/resources/main.js:
1190         (randomStyleMixBlendMode):
1191         (randomStyleFilter): Return random mix-blend-mode and filter.
1192
1193 2016-02-08  Jon Lee  <jonlee@apple.com>
1194
1195         Add a ramp controller
1196         https://bugs.webkit.org/show_bug.cgi?id=154028
1197
1198         Provisionally reviewed by Said Abou-Hallawa.
1199
1200         Enhance the graph to include a complexity-fps graph, in addition
1201         to the time graph.
1202
1203         * Animometer/developer.html: Add a ramp option.
1204         * Animometer/resources/debug-runner/animometer.css: Update the style.
1205         * Animometer/resources/strings.js: Flatten the Strings.text constants.
1206         * Animometer/resources/debug-runner/animometer.js:
1207         (ResultsTable.call._addGraphButton): Refactor.
1208         (ResultsTable.call._addTest): Add regression data.
1209         (benchmarkController): Add a form that allows the user to switch between the two forms,
1210         Add a form that allows the user to toggle different data. Hide certain header columns
1211         depending on the selected controller.
1212         * Animometer/resources/debug-runner/graph.js: Add the complexity regressions.
1213         * Animometer/resources/debug-runner/tests.js: Add headers for the ramp results.
1214         * Animometer/resources/runner/animometer.js:
1215         (ResultsTable): If a header is disabled don't include them in _flattenedHeaders.
1216         * Animometer/tests/resources/main.js:
1217         (Controller): Allow options to specify the capacity for sample arrays.
1218         (Regression): A piecewise regression that tries to fit a slope and a flat profile.
1219         (_calculateRegression): Options can fix the slope and bias when calculating the minimal
1220         error. Sweep across the samples in time (which could be backward depending on the controller)
1221         and calculate the intersection point.
1222         (RampController): This controller assumes that the target frame rate is below
1223         58 FPS. It runs in two stages. The first stage quickly determines the order of
1224         magnitude of objects needed to stress the system by the setting the complexity
1225         to increasingly difficult tiers. Perform a series of ramps descending from a
1226         high-water mark of complexity. The complexity needed to reach the target frame
1227         length is done by performing a piecewise regression on each ramp, and track a
1228         running average of these values. For the next ramp, make that running average
1229         the center of the ramp. With a minimum complexity of 0, the high-water mark is
1230         twice that average. The score is based on the highest complexity that can
1231         reach 60 fps.
1232
1233 2016-02-08  Jon Lee  <jonlee@apple.com>
1234
1235         Address Said's comments on the benchmark, and do some clean up.
1236
1237         * Animometer/developer.html:
1238         * Animometer/resources/debug-runner/animometer.css: Add styles for averages.
1239         * Animometer/resources/debug-runner/animometer.js: Use the right
1240         Strings constants.
1241         * Animometer/resources/debug-runner/graph.js:
1242         (_addRegressionLine): Add missing code to draw the line and standard
1243         deviation highlight.
1244         (onGraphTypeChanged): Remove unneeded variables
1245         (onTimeGraphOptionsChanged):
1246         * Animometer/resources/runner/benchmark-runner.js:
1247         (_runBenchmarkAndRecordResults): Rename samplers to suiteResults and
1248         _suitesSamplers to _suitesResults.
1249         * Animometer/tests/resources/main.js:
1250         (results): Call processSamples().
1251         (update): Change sampling timestamp comparison.
1252         (_animateLoop): Move shouldStop call to before the update.
1253         * Animometer/tests/resources/sampler.js:
1254         (process): Rename to processSamples().
1255
1256 2016-02-07  Jon Lee  <jonlee@apple.com>
1257
1258         Teach Controller to measure intervals, and turn off the frame length estimator.
1259
1260         * Animometer/tests/resources/main.js: Default interval length is 100 ms.
1261         (start): Set the first interval.
1262         (_measureAndResetInterval): Reports the average frame length of the interval that just
1263         completed, and sets up the next interval.
1264         (update): If there is no length, then just use the estimator per frame, otherwise the
1265         estimator measures per interval. Add a didFinishInterval for subclasses to process
1266         prior to recording the sample. Update tune() to include whether an interval had
1267         finished.
1268         (StepController): Step controllers don't measure on an interval basis.
1269
1270 2016-02-07  Jon Lee  <jonlee@apple.com>
1271
1272         Minor refactoring. Rename Controller._estimator to Controller._frameLengthEstimator
1273         and switch the parameters for start(), update(), and tune(), so that the timestamp
1274         is first and stage is second.
1275
1276         * Animometer/tests/resources/main.js:
1277
1278 2016-02-07  Jon Lee  <jonlee@apple.com>
1279
1280         Move ResultsTable functionality not needed for release tests out.
1281         Move reporting of score and mean to selection of the time-based graph.
1282
1283         * Animometer/developer.html: Rename graph-options to time-graph-options.
1284         * Animometer/resources/debug-runner/animometer.js:
1285         (DeveloperResultsTable): Moved from runner/animometer.js. Switch from mean
1286         values to "average" objects which can hold stdev. Move graph button and
1287         calculation of noisy measurements here. Sophisticated header processing
1288         is not needed in release suite.
1289         (populateTable): Use DeveloperResultsTable.
1290         * Animometer/resources/debug-runner/graph.js: Pull time graph creation to
1291         its own function, and add a new onGraphTypeChanged handler in preparation
1292         of a complexity graph to be added later.
1293         * Animometer/resources/runner/animometer.js:
1294         (ResultsTable): Simplify to just handle test names and scores.
1295
1296 2016-02-07  Jon Lee  <jonlee@apple.com>
1297
1298         Tests: reuse objects already made.
1299
1300         Avoid thrash of object creation and removal by maintaining an index that
1301         moves along the array as the adjust values change. If the tune value
1302         requires more objects than the maximum size of the object array, then create
1303         new objects. This means that the object array size never decreases.
1304
1305         * Animometer/tests/master/resources/canvas-stage.js: Maintain a separate
1306         offsetIndex. For these tests, we want to avoid drawing the oldest objects,
1307         so the scene will draw the object at offsetIndex to the end of the array.
1308         (tune): Reverse the logic since "removal" of objects is much simpler and
1309         involves simply changing the offsetIndex.
1310         (animate): Update the for loop to draw from offsetIndex to the end.
1311         (complexity): Update the definition.
1312         * Animometer/tests/master/resources/canvas-tests.js: Maintain a separate
1313         offsetIndex. For these tests, we want to avoid drawing the newest objects,
1314         so the scene will draw the object at index 0 to the object at offsetIndex.
1315         (SimpleCanvasStage.animate): Fly-by removal of local stage variable,
1316         which is unneeded. Update the for loop to draw from offsetIndex to the end.
1317         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1318         (SimpleCanvasStage.animate): Update the for loop to draw from 0 to
1319         offsetIndex.
1320         * Animometer/tests/simple/resources/simple-canvas.js:
1321         (tune): Update logic. Here, offsetIndex represents the boundary of the last
1322         index to render.
1323         (animate): Update the for loop to draw from 0 to offsetIndex.
1324         (complexity): Update the definition.
1325
1326 2016-02-07  Jon Lee  <jonlee@apple.com>
1327
1328         Tests: refactor and update styles.
1329
1330         * Animometer/tests/resources/main.js: Add helper methods that return
1331         a color that hue rotates based on the date, and a counter value that
1332         increases based on the date. Fix randomInt() to not bias against the min and
1333         max values.
1334
1335         * Animometer/tests/master/resources/canvas-tests.js: Use new helper methods.
1336         * Animometer/tests/master/resources/dom-particles.js: Ditto.
1337         * Animometer/tests/master/resources/particles.js: Ditto.
1338         * Animometer/tests/simple/resources/simple-canvas-paths.js: Refactor to
1339         use a rotating color instead of a random color. The fast switching of color
1340         is too vivid to watch.
1341
1342         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1343         (BouncingSvgParticlesStage.call.createGradient): Fix the gradient so
1344         that the last stop is located at the end.
1345
1346 2016-02-07  Jon Lee  <jonlee@apple.com>
1347
1348         Refactor tune() to not return the complexity of the scene.
1349
1350         We have stage.complexity() now, so returning the complexity through tune
1351         is unnecessary.
1352
1353         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1354         * Animometer/tests/master/resources/canvas-stage.js:
1355         * Animometer/tests/master/resources/particles.js:
1356         * Animometer/tests/misc/resources/canvas-electrons.js:
1357         * Animometer/tests/misc/resources/canvas-stars.js:
1358         * Animometer/tests/resources/main.js:
1359         * Animometer/tests/simple/resources/simple-canvas.js:
1360         * Animometer/tests/simple/resources/tiled-canvas-image.js:
1361         * Animometer/tests/template/resources/template-canvas.js:
1362         * Animometer/tests/template/resources/template-css.js:
1363         * Animometer/tests/template/resources/template-svg.js:
1364         * Animometer/tests/text/resources/layering-text.js:
1365
1366 2016-02-07  Jon Lee  <jonlee@apple.com>
1367
1368         Make the fixed controller a step controller instead. Halfway through the test
1369         it will bump up the complexity 4-fold. Calculate the step timestamp using options
1370         instead of a separate parameter to the Controller constructor.
1371
1372         * Animometer/developer.html: Change value to "step"
1373         * Animometer/resources/debug-runner/animometer.js:
1374         (window.suitesManager.updateEditsElementsState): Show number inputs when set to "step".
1375         * Animometer/tests/resources/main.js:
1376         (update): Provide a hook for subclasses to tune.
1377         (StepController): Maintain a flag determining whether we've stepped, and the time
1378         we should step.
1379         (Benchmark): Use the new StepController.
1380
1381 2016-02-07  Jon Lee  <jonlee@apple.com>
1382
1383         Adjust the FPS graph scale.
1384
1385         Instead of making the FPS graph linearly scale, scale it based on the frame length,
1386         but show the data in terms of FPS. Because it is inversely proportional, and most
1387         of the data never gets below 20, concentrate the axis from 20-60 FPS, since otherwise
1388         over half of the available graph space ends up blank.
1389
1390         This means we should convert all of the FPS data to frame length data.
1391
1392         * Animometer/resources/debug-runner/graph.js: Update the domain to be based on
1393         frame length in milliseconds instead of FPS. Update the cursor to consider all of the
1394         values being shown, and then pick the min and max values to represent the length of the
1395         cursor.
1396         * Animometer/resources/runner/animometer.js:
1397         * Animometer/resources/strings.js:
1398         * Animometer/tests/resources/main.js:
1399         (processSamples): Add the ability to only sample a range of the data instead of everything
1400         after an offset index. Update sampler to record the frame lengths instead of the frame
1401         rate.
1402
1403 2016-02-07  Jon Lee  <jonlee@apple.com>
1404
1405         Add option to use different methods for retrieving a timestamp.
1406
1407         * Animometer/developer.html: Add performance.now and Date.now options.
1408         * Animometer/resources/runner/animometer.js: Default to performance.now.
1409         (window.benchmarkController.startBenchmark):
1410         * Animometer/tests/resources/main.js: Tie the desired method to _getTimestamp.
1411         (run): Use _getTimestamp.
1412         (_animateLoop): Ditto.
1413
1414 2016-02-07  Jon Lee  <jonlee@apple.com>
1415
1416         Allow adding any number of markers to the graph. The markers can be labeled
1417         and contain timestamp and sample index data. Make it a part of the controller
1418         rather than keeping it in the sampler.
1419
1420         * Animometer/resources/debug-runner/animometer.css: Add styles for markers
1421         * Animometer/resources/debug-runner/graph.js: Create the markers and add
1422         text labels.
1423         * Animometer/resources/runner/animometer.js: Assume the samplingTimeOffset
1424         is just one of the marks provided.
1425         * Animometer/resources/strings.js: Add Strings.json.marks.
1426         * Animometer/tests/resources/main.js:
1427         (Controller): Keep marks here. They are keyed by the marker name, so no two
1428         markers should have the same name.
1429         (recordFirstSample): Refactor to use mark.
1430         (mark): Allows for arbitrary data if needed later. The timestamp maintained
1431         is relative to the absolute start timestamp.
1432         (containsMark): Checks whether a mark with a specific comment exists.
1433         (processSamples): Removes the _startTimestamp offset from the marks before
1434         setting it in results.
1435         * Animometer/tests/resources/sampler.js: Remove marks.
1436
1437 2016-02-07  Jon Lee  <jonlee@apple.com>
1438
1439         Get rid of options member variable in Benchmark.
1440
1441         Options are only needed when initializing the stage or benchmark, so there's no
1442         need to also keep a reference to it.
1443
1444         * Animometer/tests/resources/main.js: Get rid of options variable in Benchmark.
1445         Pass options to Controllers and Stages.
1446         (Controller.Utilities.createClass):
1447         (Benchmark.Utilities.createClass):
1448         (get options): Deleted.
1449
1450         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1451         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1452         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1453         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1454         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1455         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1456         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1457         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1458         * Animometer/tests/master/resources/canvas-stage.js:
1459         * Animometer/tests/master/resources/canvas-tests.js:
1460         * Animometer/tests/master/resources/particles.js:
1461         * Animometer/tests/misc/resources/canvas-electrons.js:
1462         * Animometer/tests/misc/resources/canvas-stars.js:
1463         * Animometer/tests/misc/resources/compositing-transforms.js:
1464         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1465         * Animometer/tests/simple/resources/tiled-canvas-image.js:
1466         * Animometer/tests/template/resources/template-canvas.js:
1467         * Animometer/tests/template/resources/template-css.js:
1468         * Animometer/tests/template/resources/template-svg.js:
1469         * Animometer/tests/text/resources/layering-text.js:
1470
1471 2016-02-07  Jon Lee  <jonlee@apple.com>
1472
1473         Update how the benchmark is run
1474         https://bugs.webkit.org/show_bug.cgi?id=153960
1475
1476         Provisionally reviewed by Said Abou-Hallawa.
1477
1478         Introduce the notion of a Controller. It is responsible for recording, updating,
1479         and processing the statistics and complexity of the benchmark. This allows
1480         plugging in different Controllers.
1481
1482         This strips most of the functionality from Animator and BenchmarkState, so fold
1483         what's left into Benchmark. Now, Benchmarks only own a stage and a controller, but
1484         are responsible for driving the animation loop.
1485
1486         Rewrite Animator._shouldRequestAnotherFrame into two different Controllers. One
1487         maintains a fixed complexity, and the other adapts the complexity to meet a
1488         fixed FPS.
1489
1490         Fix the Kalman estimator to be modeled on a scalar variable with no model.
1491
1492         * Animometer/tests/resources/main.js: Remove BenchmarkState and Animator, and
1493         replace it with a Controller. Add a FixedController and refactor the previous controller
1494         to an AdaptiveController.
1495
1496         (Controller): Controllers own the estimator and the sampler. When a new frame is
1497         displayed, the animation loop calls update(). The estimator and sampler record
1498         stats, then tune. Samplers can track multiple series of data. The basic controller
1499         tracks timestamp, complexity, and estimated frame rate.
1500                 The Kalman estimation is based on the frame length rather than the frame
1501         rate. Because FPS is inverse proportional to frame length, in the case where the measured
1502         frame length is very small, the FPS ends up being a wildly large number (in the order of
1503         600-1000 "FPS"), and it pulls the estimator up drastically enough that it takes a while
1504         for it to settle back down. Using frame length reduces the impact of these spikes.
1505                 Converging the estimation takes enough time to avoid initializing it immediately
1506         when the benchmark starts. Instead, the benchmark runs for a brief period of time (100ms)
1507         before running it in earnest. Allow controllers an opportunity to set the complexity
1508         before starting recording.
1509                 When the benchmark is complete, the controller has an opportunity to process
1510         the samples. The default implementation calculates the raw FPS based on the time
1511         difference of the samples, and calculates the complexity score. This is moved from
1512         Benchmark.processSamples.
1513
1514         (Controller): Initialize timestamps. These are at first relative to the start of the
1515         benchmark, but are offset by the absolute start time during start(). By default maintain
1516         3 data series, but subclasses can override.
1517         (start): Calls recordFirstSample() for subclasses to override if needed.
1518         (recordFirstSample): For basic controller, start sampling at the beginning.
1519         (update): Update the frame length estimator and sample.
1520         (shouldStop): Checks that the time is before _endTimestamp.
1521         (results): Returns the processed samples.
1522         (processSamples): Iterate through the sample data and collate them. Include scores.
1523
1524         (FixedComplexityController): Controller that tunes the stage to the desired complexity
1525         prior to starting, and keeps it at that complexity.
1526
1527         (AdaptiveController): Have the estimator estimate the interval frame rate instead of the
1528         raw frame rate.
1529                 The previous version of this controller ignored the frame that came after the
1530         adjustment. The raw FPS show that whatever noise the scene change adds is negligible
1531         compared to the noise of the system overall. Stop ignoring that frame and include all
1532         frames in the measurements.
1533
1534         (Benchmark): Remove dependency on animator, and instantiate a runner based on what is
1535         selected. Most of the loop's functionality is in Controller, so remove here.
1536         (Benchmark.run): Remove start() since it is only called from run(), and fold it in here.
1537         (Benchmark._animateLoop): Fold in from Animator.animateLoop. Let the benchmark run for
1538         a brief period before calling Controller.start().
1539
1540         * Animometer/tests/resources/math.js: Fix the Kalman estimator. The filter estimates
1541         a scalar variable, and makes basic assumptions regarding the model. As a result
1542         none of the linear algebra classes are needed, so remove Matrix, Vector3, and Matrix3.
1543         (SimpleKalmanEstimator): Calculate the gain based on the provided process and
1544         measurement errors.
1545         (KalmanEstimator): Deleted.
1546         (IdentityEstimator): Deleted.
1547         (PIDController): Refactor to use the Utilities.createClass() helper.
1548
1549         The Kalman filter algorithm is explained here http://greg.czerniak.info/guides/kalman1/.
1550         The state, represented by a scalar, is the estimated frame length. There is no user
1551         transition of the state, and the state is the same as the measurement. With this model,
1552         the estimation error converges, so calculate the gain ahead of time.
1553
1554         * Animometer/developer.html: Remove fixed-after-warmup since it is not useful.
1555         Replace the option to toggle the estimator, and make it possible to customize the
1556         estimator's error parameters. Show raw FPS by default, and remove interval FPS,
1557         which will be shown instead of the filtered raw FPS.
1558         * Animometer/resources/debug-runner/animometer.css: Put the header behind the graph.
1559         Remove #intervalFPS rules; move the color to #filteredFPS.
1560         * Animometer/resources/debug-runner/graph.js:
1561         (updateGraphData): Update the hr style to force the layout to be calculated
1562         correctly. Change the tick format to be in terms of seconds, since the timestamps
1563         are in milliseconds. Remove interval data.
1564         * Animometer/resources/runner/animometer.js:
1565         (window.benchmarkController.startBenchmark): Set Kalman parameters.
1566         * Animometer/resources/runner/benchmark-runner.js:
1567         (_runBenchmarkAndRecordResults): When a benchmark completes, expect it to return
1568         the final data, rather than passing a sampler from the controller. This avoids
1569         needing to expose the sampler variable in the benchmark.
1570         * Animometer/tests/resources/sampler.js:
1571         (process): Move the setting of the target frame rate to AdaptiveController.
1572
1573 2016-02-06  Jon Lee  <jonlee@apple.com>
1574
1575         Code clean up: Move Rotater function closer to Stage static methods.
1576         The Rotater is used together with those methods; keep them close.
1577
1578         * Animometer/tests/resources/main.js:
1579
1580 2016-02-06  Jon Lee  <jonlee@apple.com>
1581
1582         Update the JS includes due to ResultsTable move.
1583
1584         * Animometer/developer.html:
1585         * Animometer/index.html:
1586
1587 2016-02-06  Jon Lee  <jonlee@apple.com>
1588
1589         Move createElement and createSVGElement to Utilities.
1590
1591         * Animometer/resources/extensions.js:
1592         (Utilities.createElement): Added.
1593         (Utilities.createSVGElement): Added.
1594         (DocumentExtension.createElement): Deleted.
1595         (DocumentExtension.createSvgElement): Deleted.
1596
1597         * Animometer/resources/debug-runner/animometer.js:
1598         * Animometer/resources/runner/animometer.js:
1599         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1600         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
1601         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1602
1603 2016-02-06  Jon Lee  <jonlee@apple.com>
1604
1605         Add a convenience function for creating a class.
1606
1607         The pattern for creating a class is common enough to add as a Utilities
1608         helper function. It also makes it easy to collapse class definitions when
1609         editing.
1610
1611         * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition,
1612         since it is only used here.
1613         * Animometer/resources/runner/animometer.js: Move ResultsDashboard and
1614         ResultsTable definition, since it is only used here.
1615         * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert
1616         Point, Insets, SimplePromise.
1617         (ProgressBar): Moved to animometer.js.
1618         (ResultsDashboard): Moved to animometer.js.
1619         (ResultsTable): Moved to animometer.js.
1620         * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState,
1621         BenchmarkRunner.
1622         * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark.
1623         * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler.
1624
1625         Convert test primitives.
1626         * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment,
1627         CanvasArc, CanvasLinePoint.
1628         * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment,
1629         CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment,
1630         CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment,
1631         CanvasArcSegmentFill, CanvasRect, CanvasRectFill.
1632         * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile.
1633
1634 2016-02-06  Jon Lee  <jonlee@apple.com>
1635
1636         Minor improvements to debug harness.
1637
1638         * Animometer/developer.html:
1639         * Animometer/resources/debug-runner/animometer.css:
1640         (#suites): Put the complexity text boxes closer to the test names.
1641         (#options):
1642         (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line.
1643         (#intervalFPS path):
1644         (#intervalFPS circle):
1645         * Animometer/resources/debug-runner/animometer.js:
1646         (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text.
1647         (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox.
1648         (window.suitesManager._createTestElement): Enhance such that typing into the complexity
1649         input will automatically select that test for running.
1650         (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private
1651         browsing.
1652         * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show
1653         more accuracy in timestamps.
1654
1655 2016-02-06  Jon Lee  <jonlee@apple.com>
1656
1657         Refactor helper methods for getting random values for a stage.
1658
1659         Instead of requiring a Stage instance, just attach it to the Stage object.
1660
1661         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1662         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1663         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1664         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1665         * Animometer/tests/master/resources/canvas-tests.js:
1666         * Animometer/tests/master/resources/particles.js:
1667         * Animometer/tests/misc/resources/canvas-electrons.js:
1668         * Animometer/tests/misc/resources/canvas-stars.js:
1669         * Animometer/tests/misc/resources/compositing-transforms.js:
1670         * Animometer/tests/resources/main.js:
1671         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1672
1673 2016-02-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1674
1675         Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData
1676         https://bugs.webkit.org/show_bug.cgi?id=151716
1677
1678         Reviewed by Darin Adler.
1679
1680         The purpose of this test is to measure the performance of getImageData
1681         and putImageData functions. This test draws a background on the canvas
1682         and then gets some random tiles from this background and draw them in
1683         destinations different from their original sources.
1684
1685         * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite.
1686
1687         * Animometer/resources/extensions.js:
1688         (Array.prototype.shuffle): Shuffles the elements of an array.
1689
1690         (Point.zero): Returns a new Point object whose x and y are equal zero.
1691         (Point.prototype.str): Used for debugging the Point object.
1692
1693         * Animometer/tests/simple/resources/tiled-canvas-image.js: Added.
1694         (CanvasImageTile):
1695         (CanvasImageTile.prototype.getImageData):
1696         (CanvasImageTile.prototype.putImageData):
1697         (Stage.call.initialize):
1698         (Stage.call._createTiles):
1699         (Stage.call._nextTilePosition):
1700         (Stage.call.tune):
1701         (Stage.call._drawBackground):
1702         (Stage.call.animate):
1703         (Stage.call.complexity):
1704         (Stage.call):
1705         * Animometer/tests/simple/tiled-canvas-image.html: Added.
1706
1707 2016-01-07  Jon Lee  <jonlee@apple.com>
1708
1709         Fix new test.
1710
1711         * Animometer/resources/runner/tests.js: Wrong URL from an
1712         old patch.
1713         * Animometer/tests/master/particles.html:
1714         * Animometer/tests/master/resources/dom-particles.js:
1715         (Particle.call.reset): Figured out a simpler way to set up
1716         the particles.
1717         (this.move.reset): Deleted.
1718         (this.move._applyAttributes): Deleted.
1719         * Animometer/tests/master/resources/particles.js:
1720         (Particle): Call move() after reset().
1721
1722 2016-01-07  Jon Lee  <jonlee@apple.com>
1723
1724         Update benchmark test suite
1725         https://bugs.webkit.org/show_bug.cgi?id=152679
1726
1727         Reviewed by Simon Fraser.
1728
1729         Add a new test. The test has a rotating background
1730         gradient, and does a better job physically simulating
1731         particles.
1732
1733         * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points.
1734         (Point.prototype.length): Added.
1735         (Point.prototype.normalize): Added.
1736         * Animometer/resources/runner/tests.js: Add the test to the master suite.
1737         * Animometer/tests/master/particles.html: Added.
1738         * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles.
1739         (Particle):
1740         (Particle.prototype.reset): If the particle starts slowing down in terms of its animation,
1741         reset it.
1742         (Particle.prototype.animate): Bounce off the walls elastically, and include gravity.
1743         (Particle.prototype.move): Subclasses should override.
1744         (ParticlesStage): Stage includes a rotating gradient background.
1745         * Animometer/tests/master/resources/dom-particles.js: Added. Creates a <div> and adds it to
1746         the stage.
1747         * Animometer/tests/resources/star.svg: Added.
1748
1749 2016-01-03  Jon Lee  <jonlee@apple.com>
1750
1751         Update benchmark test suite
1752         https://bugs.webkit.org/show_bug.cgi?id=152679
1753
1754         Reviewed by Simon Fraser.
1755
1756         Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
1757
1758         Needed by both harnesses.
1759         * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
1760         * Animometer/developer.html:
1761         * Animometer/index.html:
1762
1763         Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
1764         into extensions.js.
1765         * Animometer/resources/extensions.js:
1766         * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
1767         * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
1768         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1769         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1770         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1771         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1772         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1773         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1774         * Animometer/tests/master/canvas-stage.html:
1775         * Animometer/tests/misc/canvas-electrons.html:
1776         * Animometer/tests/misc/canvas-stars.html:
1777         * Animometer/tests/misc/compositing-transforms.html:
1778         * Animometer/tests/simple/simple-canvas-paths.html:
1779         * Animometer/tests/template/template-canvas.html:
1780         * Animometer/tests/template/template-css.html:
1781         * Animometer/tests/template/template-svg.html:
1782         * Animometer/tests/text/layering-text.html:
1783         * Animometer/tests/text/text-boxes.html:
1784
1785 2016-01-07  Jon Lee  <jonlee@apple.com>
1786
1787         Update benchmark test suite
1788         https://bugs.webkit.org/show_bug.cgi?id=152679
1789
1790         Reviewed by Simon Fraser.
1791
1792         Fix tests for other browsers.
1793
1794         * Animometer/resources/extensions.js:
1795         (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
1796         Use getBoundingClientRect() instead.
1797         * Animometer/tests/misc/resources/canvas-electrons.js:
1798         (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
1799
1800 2016-01-07  Jon Lee  <jonlee@apple.com>
1801
1802         Add a waitUntilReady() step
1803         https://bugs.webkit.org/show_bug.cgi?id=152862
1804
1805         Reviewed by Simon Fraser.
1806
1807         Add a waitUntilReady() callback that lets the benchmark complete
1808         its setup before running the benchmark.
1809
1810         * Animometer/tests/resources/main.js:
1811         (Benchmark.prototype.run): First call waitUntilReady, which returns
1812         a promise. When the promise resolves, run everything that was in this
1813         function.
1814         (Benchmark.prototype.waitUntilReady): Default implementation returns
1815         a resolved promise.
1816         (Benchmark.prototype.resolveWhenFinished): Deleted.
1817         * Animometer/tests/template/resources/template-canvas.js:
1818         (new.TemplateCanvasStage.waitUntilReady): Example on how to override.
1819
1820 2016-01-03  Jon Lee  <jonlee@apple.com>
1821
1822         Update data reporting and analysis
1823         https://bugs.webkit.org/show_bug.cgi?id=152670
1824
1825         Reviewed by Simon Fraser.
1826
1827         Show new graph data. Provide controls to show different series data. Provide an
1828         interactive cursor that shows the data at a given sample.
1829
1830         * Animometer/developer.html: Add a nav section in #results. Each part of the graph
1831         has a checkbox for visual toggling, as well as companion spans to contain the data.
1832                 The numbers will always be shown even if the SVG isn't.
1833         * Animometer/resources/debug-runner/animometer.css:
1834         (#suites): Adjust spacing when doing fixed complexity.
1835         (#test-graph nav): Place the nav in the upper right corner.
1836         (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past
1837         that scale. Allow it to show.
1838         (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS.
1839         (#cursor line): The cursor contains a line and highlight circles for the data being shown.
1840         (#cursor circle):
1841         (#complexity path): This and rules afterward are named by series type.
1842         (#complexity circle):
1843         (#filteredFPS path):
1844         (#filteredFPS circle):
1845         (#rawFPS path):
1846         (#intervalFPS circle):
1847         (.left-samples): Deleted.
1848         (.right-samples): Deleted.
1849         * Animometer/resources/debug-runner/animometer.js:
1850         (initialize): Add a "changed" listener when the checkboxes change in the nav.
1851         (onBenchmarkOptionsChanged): Renamed.
1852         (showTestGraph): All graph data is passed in as graphData instead of as arguments.
1853         * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing
1854         a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged()
1855         toggles the data on and off.
1856         (updateGraphData): Add the axes. Add the average lines and markers for sample time and
1857         target FPS. Add the cursor group. Use helper function addData() to add the data. On top of
1858         everything add a transparent area which will catch all of the mouse events. When the mouse
1859         moves in the graph, find the closest data point, show the data in the nav area, and highlight
1860         the data points.
1861         (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a
1862         size a little larger than the circle radius for the data points.
1863         (onGraphOptionsChanged): Called when data is visually toggled.
1864         (showOrHideNodes): Helper function to toggle the .hidden class.
1865         * Animometer/resources/extensions.js:
1866         (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData.
1867         (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object.
1868
1869         Producing the JSON can take a while with all of the data. Make it on-demand with a
1870         button.
1871
1872         * Animometer/resources/debug-runner/animometer.js:
1873         (showResults): When showing the results, don't serialize the JSON data. Move that to...
1874         (showJSONResults): ...here. Remove the button.
1875
1876         * Animometer/developer.html: Add a button. The button will remove itself and populate
1877         the textarea with the JSON data.
1878         * Animometer/resources/debug-runner/animometer.css:
1879         (.hidden): Add a universal hidden class.
1880         (#results button.small-button): Promote the small-button styles to the whole results
1881         section for use in the JSON button.
1882         (#results button.small-button:active):
1883         (#results-data button.small-button): Deleted.
1884         (#results-data button.small-button:active): Deleted.
1885
1886         Refactor how Animator does its recording.
1887
1888         * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns
1889         the same interval frame rate for adjustment.
1890         * Animometer/tests/resources/main.js:
1891         (Animator): Remove _dropFrameCount, and make variables more accurate described.
1892         (Animator.prototype.initialize): Use the identity estimator instead of using a bool.
1893         (Animator.prototype._intervalTimeDelta): Rename, only used internally.
1894         (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment
1895         of the scene. If we are within the number of frames to measure for the interval, just
1896         record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record
1897         the interval frame rate and the estimator's frame rate.
1898
1899         Avoid processing the data through the Experiment while the test is running. Reconfigure
1900         the sampler to just record the raw samples. After the test is done, run the samples through
1901         the Experiment to get the score.
1902
1903         * Animometer/resources/sampler.js:
1904         (Experiment): Fold _init() into the constructor since nobody else will call it. This is not
1905         needed until the test concludes, so remove startSampling(). Clients should just call sample().
1906         (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity
1907         of how many samples will be used. The processor is a called when it's time to process the data
1908         since that is the client also telling the Sampler what to record.
1909                 Introduce the notion of marks as well, which allows the client to mark when an
1910         event occurs. When we mark sample start, we can attach the timestamp there, instead of storing
1911         it separately.
1912         (Sampler.prototype.startSampling): Deleted. Clients should just call record().
1913         (Sampler.prototype.record): The data to record is passed in as variable arguments.
1914         (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and
1915         can provide extra data object for later retrieval.
1916         (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used.
1917         Call the processor to process the samples.
1918         * Animometer/resources/debug-runner/benchmark-runner.js:
1919         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process().
1920
1921         * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are
1922         not used.
1923         * Animometer/tests/resources/main.js:
1924         (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the
1925         number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all
1926         of the data being added to the Sampler. It is added through record(), and processed through
1927         processSamples().
1928         (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include
1929         the timestamp in the custom data for the mark. This avoids the need to store is separately in
1930         the Sampler. Fold what was in record() here, since nothing else needs this functionality.
1931         record() now just relays the information to the sampler.
1932         (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler.
1933         Animator's calls to this is part of a later patch. Requires each stage to return its complexity.
1934         (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results.
1935                 Go through all of the samples. All samples contain a timestamp and complexity. We
1936         calculate "raw FPS" which is the time differential from the previous sample. At regular intervals
1937         the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two
1938         experiments, to get the scores for the complexity and smoothed FPS, and add those samples to
1939         the experiments. Grab those scores and add them into results also.
1940
1941         Add complexity() to the tests for Benchmark.record().
1942         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1943         * Animometer/tests/misc/resources/canvas-electrons.js:
1944         * Animometer/tests/misc/resources/canvas-stars.js:
1945         * Animometer/tests/text/resources/layering-text.js:
1946
1947 2015-12-27  Jon Lee  <jonlee@apple.com>
1948
1949         Simplify the test harness
1950         https://bugs.webkit.org/show_bug.cgi?id=152562
1951
1952         Reviewed by Simon Fraser.
1953
1954         Update the simple canvas tests. For the paths, start from the center instead of the
1955         top-left corner. Instead of using a coordinate limit, use a canonized factor, and
1956         use that along both the x and y axes, so that more capable tests use more of the
1957         canvas.
1958
1959         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1960         (CanvasLinePoint): Rewrite to use the coordinate maximum factor.
1961         (CanvasQuadraticPoint): Ditto.
1962         (CanvasBezierPoint): Ditto.
1963         * Animometer/tests/simple/resources/simple-canvas.js:
1964         (tune): Calculate a factor instead of a maximum coordinate.
1965
1966 2015-12-27  Jon Lee  <jonlee@apple.com>
1967
1968         Simplify the test harness
1969         https://bugs.webkit.org/show_bug.cgi?id=152562
1970
1971         Reviewed by Simon Fraser.
1972
1973         All of the benchmarks use the default Animator(). Don't require new tests
1974         to pass a new instance, and instead just make one in the Benchmark constructor.
1975
1976         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1977         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1978         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1979         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1980         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1981         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1982         * Animometer/tests/master/resources/canvas-tests.js:
1983         * Animometer/tests/misc/resources/canvas-electrons.js:
1984         * Animometer/tests/misc/resources/canvas-stars.js:
1985         * Animometer/tests/misc/resources/compositing-transforms.js:
1986         * Animometer/tests/resources/main.js:
1987         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1988         * Animometer/tests/template/resources/template-canvas.js:
1989         * Animometer/tests/template/resources/template-css.js:
1990         * Animometer/tests/template/resources/template-svg.js:
1991         * Animometer/tests/text/resources/layering-text.js:
1992         * Animometer/tests/text/resources/text-boxes.js:
1993
1994         Refactor the template.
1995
1996         * Animometer/tests/template/resources/template-canvas.js:
1997         * Animometer/tests/template/resources/template-css.js:
1998         * Animometer/tests/template/resources/template-svg.js:
1999         * Animometer/tests/template/template-canvas.html:
2000         * Animometer/tests/template/template-css.html:
2001         * Animometer/tests/template/template-svg.html:
2002
2003         Refactor the SVG suite.
2004
2005         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end.
2006         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
2007
2008         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes
2009         to stage.js.
2010         * Animometer/tests/text/text-boxes.html: Ditto.
2011
2012         BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing.
2013         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove
2014         BouncingCanvasParticlesBenchmark.
2015         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark.
2016         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto.
2017
2018         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape
2019         in the constructor instead of having subclasses set the private variable.
2020
2021         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor.
2022         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2023
2024         Refactor the HTML suite.
2025
2026         Move scripts to the end.
2027         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
2028         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
2029         * Animometer/tests/text/layering-text.html:
2030         * Animometer/tests/text/text-boxes.html:
2031
2032         Refactor to use the new variables.
2033         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2034         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2035         * Animometer/tests/text/resources/layering-text.js:
2036         * Animometer/tests/text/resources/text-boxes.js:
2037
2038         Refactor the bouncing canvas tests.
2039
2040         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end.
2041         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end.
2042
2043         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few
2044         properties to "public" since they are used by subclasses.
2045         (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles
2046         "public" for subclasses.
2047         (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed.
2048         * Animometer/tests/misc/resources/compositing-transforms.js: Refactor.
2049
2050         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2051         BouncingCanvasParticlesAnimator is no longer needed.
2052         (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of
2053         having subclasses set the variable.
2054
2055         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor.
2056         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor.
2057
2058         Move example/ files into misc/.
2059
2060         * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html.
2061         * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html.
2062         * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js.
2063         * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js.
2064
2065         * Animometer/resources/debug-runner/tests.js: Update test URLs.
2066
2067         Refactor miscellaneous suite.
2068
2069         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2070         Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are
2071         not needed.
2072         (tune): Remove console assert.
2073         * Animometer/tests/resources/main.js: Add Rotater back in from stage.js.
2074
2075         * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator.
2076         * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator.
2077         * Animometer/tests/misc/resources/compositing-transforms.js:
2078         * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end.
2079         * Animometer/tests/examples/canvas-stars.html: Ditto.
2080         * Animometer/tests/misc/compositing-transforms.html: Ditto.
2081
2082         Refactor the simple suite.
2083
2084         * Animometer/tests/master/resources/canvas-stage.js:
2085         (tune): Remove coordinateMaximum since it is not needed in any
2086         of the master tests.
2087         * Animometer/tests/simple/resources/simple-canvas.js:
2088         SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer
2089         needed.
2090         (tune): Manage the objects differently, but instead of duplicating
2091         all of SimpleCanvasStage here, just replace tune(). Include
2092         coordinateMaximum, and remove items from the end of the list
2093         instead of the beginning.
2094         (StageBenchmark.call.createAnimator): Deleted.
2095         (StageBenchmark.call): Deleted.
2096         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2097         * Animometer/tests/simple/simple-canvas-paths.html: Move
2098         scripts to the end.
2099
2100         Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test.
2101
2102         * Animometer/resources/debug-runner/animometer.js:
2103         (initialize): Move the setting of testsCount to the debug runner.
2104         (didRunTest): Nicer name.
2105         * Animometer/resources/debug-runner/benchmark-runner.js:
2106         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks.
2107         * Animometer/resources/extensions.js:
2108         (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating.
2109         (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes.
2110         * Animometer/resources/runner/animometer.js:
2111         (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount.
2112         * Animometer/resources/strings.js: These are no longer needed.
2113         * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow.
2114         * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark.
2115         * Animometer/tests/resources/main.js: Messages are no longer needed
2116         (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean
2117         indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop.
2118         (BenchmarkState.prototype.currentStage): Deleted.
2119         (BenchmarkState.prototype.currentMessage): Deleted.
2120         (BenchmarkState.prototype.currentProgress): Deleted.
2121         (Animator.prototype.animate): Deleted.
2122         (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw.
2123         (Benchmark.prototype.record): No need to update the progress bar.
2124         * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js.
2125
2126         * Animometer/resources/debug-runner/benchmark-runner.js:
2127         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark.
2128         Remove the call to runBenchmark by merging the options here, and calling benchmark.run()
2129         directly.
2130
2131         Make the class relationships more easily understandable. The benchmark owns the stage,
2132         animator, and options. Make the stage and animator no longer have their own references to
2133         the options. Make Stage a first-class citizen by promoting it to main.js. Later patches
2134         will try to get rid of stage.js altogether.
2135         * Animometer/tests/resources/main.js:
2136         (Stage): Moved from stage.js.
2137         (Animator): Don't pass in benchmark and options in its constructor. It will get initialized
2138         by benchmark-related parameters in initialize().
2139         (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option.
2140         (Animator.prototype.get benchmark):
2141         (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on
2142         the options dictionary.
2143         (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize
2144         them.
2145         (Benchmark.prototype.get options):
2146         (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion.
2147         (Benchmark.prototype.get animator):
2148         (Benchmark.prototype.start):
2149         (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another
2150         level of indirection.
2151         (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone
2152         path, since tests can be individually selected, and remove the need for runBenchmark since that is
2153         handled in BenchmarkRunner._runBenchmarkAndRecordResults.
2154         * Animometer/tests/resources/stage.js:
2155         (Stage): Deleted. Moved to main.js.
2156         (StageBenchmark): What's left is updating the progress bar; to be removed.
2157         (StageAnimator): What's left can be folded in Animator.
2158
2159         Refactor master suite.
2160         * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage.
2161         (animate): Push the clearRect() into each stage.
2162         (complexity):
2163         (StageBenchmark.call.createAnimator): Deleted.
2164         (StageBenchmark.call): Deleted.
2165         * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed.
2166         (CanvasLineSegment.prototype.draw):
2167         (CanvasArc):
2168         (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo
2169         or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the
2170         function call. Do all of the drawing through the stage.
2171
2172         Refactor the subclass pattern. Introduce Utilities.createSubclass().
2173
2174         * Animometer/resources/debug-runner/benchmark-runner.js:
2175         * Animometer/resources/extensions.js:
2176         (window.Utilities.createSubclass): Takes the super class, a function representing
2177         the class's constructor, and additional methods to attach to the new class's
2178         prototype object.
2179         * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js.
2180
2181         Refactor tests.
2182         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
2183         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2184         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2185         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2186         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2187         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2188         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2189         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
2190         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2191         * Animometer/tests/examples/resources/canvas-electrons.js:
2192         * Animometer/tests/examples/resources/canvas-stars.js:
2193         * Animometer/tests/master/resources/canvas-stage.js:
2194         * Animometer/tests/master/resources/canvas-tests.js:
2195         * Animometer/tests/misc/resources/compositing-transforms.js:
2196         * Animometer/tests/resources/stage.js:
2197         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2198         * Animometer/tests/simple/resources/simple-canvas.js:
2199         * Animometer/tests/template/resources/template-canvas.js:
2200         * Animometer/tests/template/resources/template-css.js:
2201         * Animometer/tests/template/resources/template-svg.js:
2202         * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods
2203         and properties since they rely on each other.
2204         * Animometer/tests/text/resources/text-boxes.js:
2205
2206         * Animometer/resources/debug-runner/animometer.js: Arrange calls
2207         in the order they are evoked.
2208         * Animometer/resources/debug-runner/benchmark-runner.js:
2209         (BenchmarkRunnerState.prototype.next): Get rid of return value since
2210         no caller to next() uses it.
2211         (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the
2212         promise to resolve simply when onload() is called instead of
2213         looking for #stage.
2214         (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run
2215         simply calls runBenchmark(). Call it directly rather than through
2216         the Suite.
2217         (BenchmarkRunner.prototype.step): Remove unused parameter in
2218         resolve callback.
2219         (BenchmarkRunner.prototype.runMultipleIterations): Use this instead
2220         of self since it is outside of the closure which needed the self
2221         variable.
2222         (resolveIfReady): Deleted.
2223         (BenchmarkRunner.prototype.waitForElement): Deleted.
2224         * Animometer/resources/runner/tests.js: prepare() and run() are
2225         no longer needed.
2226         (Suite.prototype.prepare): Deleted.
2227         (Suite.prototype.run): Deleted.
2228         * Animometer/tests/master/canvas-stage.html: Move all scripts to
2229         the end of the page.
2230
2231 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
2232
2233         Add an Animometer developer test which animates text-rich boxes
2234         https://bugs.webkit.org/show_bug.cgi?id=152544
2235
2236         Reviewed by Zalan Bujtas.
2237
2238         Add a test that draws lots of international text. This is a particle test,
2239         moving the boxes around with absolution positioning.
2240
2241         * Animometer/resources/debug-runner/tests.js:
2242         * Animometer/tests/text/resources/text-boxes.js: Added.
2243         (BouncingTextBox):
2244         (BouncingTextBox.prototype._move):
2245         (BouncingTextBox.prototype.animate):
2246         (BouncingTextBoxStage):
2247         (BouncingTextBoxStage.prototype.createParticle):
2248         (BouncingTextBoxStage.prototype.particleWillBeRemoved):
2249         (BouncingTextBoxsBenchmark):
2250         (BouncingTextBoxsBenchmark.prototype.createStage):
2251         (window.benchmarkClient.create):
2252         * Animometer/tests/text/text-boxes.html: Added.
2253
2254 2015-12-23  Jon Lee  <jonlee@apple.com>
2255
2256         Split benchmark into two different pages
2257         https://bugs.webkit.org/show_bug.cgi?id=152458
2258
2259         Reviewed by Simon Fraser.
2260
2261         Add tests to 'animometer' suite.
2262
2263         * Animometer/resources/runner/tests.js:
2264         * Animometer/tests/master/canvas-stage.html: Added.
2265         * Animometer/tests/master/resources/canvas-stage.js: Added.
2266         * Animometer/tests/master/resources/canvas-tests.js: Added.
2267         * Animometer/tests/master/resources/stage.css: Added.
2268
2269 2015-12-23  Jon Lee  <jonlee@apple.com>
2270
2271         Split benchmark into two different pages
2272         https://bugs.webkit.org/show_bug.cgi?id=152458
2273
2274         Reviewed by Simon Fraser.
2275
2276         Address comments.
2277
2278         * Animometer/resources/debug-runner/benchmark-runner.js:
2279         (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the
2280         sampler goes away, and a later call to get the JSON data is no longer available. Process the data
2281         right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData.
2282         * Animometer/resources/extensions.js:
2283         (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause.
2284         (Array.prototype.find.Array.prototype.find): Update the null check.
2285         (ResultsDashboard.prototype._processData): Use the already-processed data.
2286         * Animometer/resources/runner/animometer.css:
2287         (.frame-container > iframe): Remove calc().
2288
2289         Move Array functions to extensions.js since that is included by the harness.
2290         Add ES6 Array polyfills.
2291
2292         * Animometer/resources/algorithm.js:
2293         (Array.prototype.swap): Moved to extensions.js.
2294         * Animometer/resources/extensions.js:
2295         (Array.prototype.swap):
2296         (Array.prototype.fill): Added.
2297         (Array.prototype.find): Added.
2298
2299         Adjust styles for iPad.
2300
2301         * Animometer/resources/runner/animometer.css:
2302         (@media screen and (min-device-width: 768px)): Apply to iPad as well.
2303         (@media screen and (max-device-width: 1024px)): Update width for iPads.
2304
2305         Adjustment styles for iOS.
2306
2307         * Animometer/developer.html: Different divs contain the iframe, so use a class instead and
2308         update the style rules.
2309         * Animometer/index.html:
2310         * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules.
2311         (@media screen and (min-device-width: 1800px)): Move this up.
2312         * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS.
2313
2314         Get rid of prefixed flex properties for now.
2315
2316         * Animometer/resources/debug-runner/animometer.css:
2317         * Animometer/resources/runner/animometer.css:
2318
2319         Update the structure of the harness. Remove the JSON-per-test but keep
2320         the JSON of the whole test run. Use the full page in order to display
2321         the graph.
2322
2323         * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score,
2324         average, and worst 5% statistics.
2325         * Animometer/index.html: Make structure similar to developer.html.
2326         * Animometer/resources/debug-runner/animometer.css: Remove most of the
2327         button rules since they are superfluous. Move the progress bar to the
2328         top, fixed. Update the results page rules.
2329         * Animometer/resources/debug-runner/animometer.js: Remove most of the
2330         additions to sectionsManager since they are no longer needed.
2331         (setSectionHeader): Updates header of the section.
2332         (window.suitesManager._updateStartButtonState): Update selector.
2333         (showResults): Add keypress event for selecting different data for
2334         copy/paste. Update how the results are populated. Include full test
2335         JSON in a textarea, rather than requiring a button press.
2336         (showTestGraph):
2337         * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their
2338         title, and the text used as the cell contents, including class name.
2339         * Animometer/resources/extensions.js:
2340         (ResultsTable): Update to include a flattened version of the headers,
2341         used while populating table contents. Remove unneeded helper functions
2342         for creating the table. Rename "show" to "add".
2343         * Animometer/resources/runner/animometer.css: Update rules to
2344         accommodate the new structure.
2345         * Animometer/resources/runner/animometer.js:
2346         (window.sectionsManager.setSectionScore): Helper function to set the
2347         score and mean for a section.
2348         (window.sectionsManager.populateTable): Helper function to set the table.
2349         (window.benchmarkController.showResults): Refactor.
2350         (window.benchmarkController.selectResults): Update selectors.
2351         * Animometer/resources/runner/tests.js: Set Headers. Debug harness
2352         extends it.
2353
2354         Update debug runner to have similar names to the basic runner. Include
2355         that page's CSS and remove extraneous CSS rules.
2356
2357         Get rid of the statistics table #record.
2358
2359         * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr.
2360         * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected.
2361         * Animometer/resources/debug-runner/animometer.js: Remove recordTable.
2362         (window.suitesManager._updateStartButtonState): Update selector to #intro.
2363         (setupRunningSectionStyle): Deleted.
2364
2365         * Animometer/resources/runner/animometer.css:
2366         (#test-container.selected): Change to flex-box only when visible.
2367
2368         Remove recordTable.
2369         * Animometer/resources/debug-runner/benchmark-runner.js:
2370         (BenchmarkRunner.prototype._runTestAndRecordResults):
2371         * Animometer/resources/runner/tests.js:
2372         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
2373         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2374         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2375         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2376         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2377         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2378         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2379         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2380         * Animometer/tests/examples/resources/canvas-electrons.js:
2381         * Animometer/tests/examples/resources/canvas-stars.js:
2382         * Animometer/tests/misc/resources/compositing-transforms.js:
2383         * Animometer/tests/resources/main.js:
2384         * Animometer/tests/resources/stage.js:
2385         (StageBenchmark): Remove _recordTable.
2386         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2387         * Animometer/tests/simple/resources/simple-canvas.js:
2388         * Animometer/tests/template/resources/template-canvas.js:
2389         * Animometer/tests/template/resources/template-css.js:
2390         * Animometer/tests/template/resources/template-svg.js:
2391         * Animometer/tests/text/resources/layering-text.js:
2392
2393         * Animometer/resources/debug-runner/animometer.js:
2394         (willStartFirstIteration): Fix selector, since results-table is used
2395         in multiple places, so it cannot be an id.
2396
2397         Make it possible to select the scores, or the whole table data,
2398         by cycling through different selections through key press of 's'.
2399
2400         * Animometer/resources/runner/animometer.js:
2401         (window.benchmarkController.showResults): Attach a keypress handler
2402         if it hasn't been added already.
2403         (window.benchmarkController.selectResults):
2404         * Animometer/resources/runner/tests.js: Cycle through different
2405         ranges.
2406
2407         Fix a few fly-by errors.
2408
2409         * Animometer/resources/debug-runner/benchmark-runner.js:
2410         (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path
2411         since the files are now in the top directory instead of inside runner/.
2412         (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function.
2413         (BenchmarkRunner.prototype.step): Member variable is never used.
2414
2415         A little stylistic cleanup.
2416
2417         * Animometer/resources/debug-runner/benchmark-runner.js:
2418         * Animometer/resources/extensions.js:
2419         (window.DocumentExtension.createElement):
2420         * Animometer/tests/resources/main.js:
2421         (Benchmark.prototype.record):
2422         * Animometer/tests/resources/stage.js:
2423         (StageBenchmark.prototype.showResults): Reverse progress and message.
2424         The message appears less frequently than the progress.
2425         * Animometer/tests/simple/resources/simple-canvas.js:
2426         (SimpleCanvasBenchmark): Remove unused options.
2427
2428         Add newer version of harness in a new page. Consolidate differences between the two
2429         pages.
2430
2431         * Animometer/developer.html: Include runner/animometer.js. Rename the JS function
2432         to run the benchmark to startBenchmark() instead of startTest(). Rename #running to
2433         #test-container.
2434         * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container.
2435         * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px)
2436         instead of 4:3.
2437
2438         Split out benchmarkRunnerClient and benchmarkController.
2439
2440         * Animometer/resources/debug-runner/animometer.js: Move needed functions out of
2441         benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable
2442         and move populating the results table into benchmarkController. Rename _resultsDashboard
2443         to results and make it accessible for other objects to use.
2444         (willAddTestFrame): This is unnecessary. Remove.
2445
2446         (window.sectionsManager.showScore): Grab it from the results object instead of
2447         benchmarkRunnerClient.
2448         (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js.
2449
2450         (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark.
2451         (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark.
2452         (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration()
2453         here.
2454
2455         * Animometer/resources/debug-runner/benchmark-runner.js:
2456         (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame.
2457         * Animometer/resources/extensions.js:
2458         (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data
2459         for later referencing.
2460         (ResultsDashboard.prototype.toJSON): Deleted.
2461         (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really
2462         outputting JSON. Store the processed data into a member variable that can be referenced later.
2463         (ResultsDashboard.prototype.get data): Process the data if it hasn't already.
2464         (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the
2465         aggregate score.
2466         (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the
2467         need for an empty children array. This was to allow for a header row in the table that spanned
2468         multiple columns. In the simpler harness, this is not needed.
2469         (ResultsTable.prototype._showEmptyCells):
2470         (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score,
2471         which is the bare minimum needed for the simpler harness, key off of the header name provided.
2472         * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are
2473         split into the data and the headers, and are also displayed RTL so that a later patch allows a
2474         user to copy-paste the data easily.
2475         * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient.
2476         The debug harness will extend these classes.
2477         (window.benchmarkController._startBenchmark): Used by both harnesses.
2478         (window.benchmarkController.startBenchmark): Set hard-coded options.
2479         (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration()
2480         here.
2481
2482         Get rid of utilities.js. Move it all into extensions.js.
2483
2484         * Animometer/resources/extensions.js:
2485         * Animometer/tests/resources/utilities.js: Removed.
2486
2487         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link.
2488         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto.
2489         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto.
2490         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto.
2491         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto.
2492         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
2493         * Animometer/tests/examples/canvas-electrons.html: Ditto.
2494         * Animometer/tests/examples/canvas-stars.html: Ditto.
2495         * Animometer/tests/misc/compositing-transforms.html: Ditto.
2496         * Animometer/tests/simple/simple-canvas-paths.html: Ditto.
2497         * Animometer/tests/template/template-canvas.html: Ditto.
2498         * Animometer/tests/template/template-css.html: Ditto.
2499         * Animometer/tests/template/template-svg.html: Ditto.
2500         * Animometer/tests/text/layering-text.html: Ditto.
2501
2502         Split tests.js into two. Add a new suite to runner/tests.js.
2503
2504         * Animometer/developer.html: Update the script order. Scripts from
2505         debug-runner/ will always build on those from runner/, and have the
2506         same name.
2507         * Animometer/resources/debug-runner/tests.js: Move "complex examples"
2508         suite into "miscellaneous tests".
2509         (Suite): Deleted.
2510         (Suite.prototype.prepare): Deleted.
2511         (Suite.prototype.run): Deleted.
2512         (suiteFromName): Deleted.
2513         * Animometer/resources/runner/tests.js: Added. Take definitions and
2514         functions needed by the test harness. Leave the test suites behind.
2515         (Suite): Moved from debug script.
2516         (Suite.prototype.prepare): Ditto.
2517         (Suite.prototype.run): Ditto.
2518         (suiteFromName): Ditto.
2519         (testFromName): Ditto.
2520
2521         Move benchmark resources out into resources/debug-runner, and update URLs.
2522
2523         * Animometer/developer.html: Renamed from PerformanceTests/Animometer/runner/animometer.html.
2524         * Animometer/resources/debug-runner/animometer.css: Renamed from PerformanceTests/Animometer/runner/resources/animometer.css.
2525         * Animometer/resources/debug-runner/animometer.js: Renamed from PerformanceTests/Animometer/runner/resources/animometer.js.
2526         * Animometer/resources/debug-runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/runner/resources/benchmark-runner.js.
2527         * Animometer/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/runner/resources/d3.min.js.
2528         * Animometer/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/runner/resources/graph.js.
2529         * Animometer/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/runner/resources/tests.js.
2530
2531 2015-12-11  Jon Lee  <jonlee@apple.com>
2532
2533         Improve Animometer on iOS
2534         https://bugs.webkit.org/show_bug.cgi?id=152180
2535
2536         Reviewed by Simon Fraser.
2537
2538         Improve experience on phones. Make the canvas take
2539         up the whole screen.
2540
2541         * Animometer/runner/animometer.html: Add meta viewport.
2542         Remove the container div.
2543         * Animometer/runner/resources/animometer.css: Have buttons lay
2544         out vertically. Update detail arrow glyph. Make the suites and
2545         options section lay out vertically. Remove the top spacers since
2546         we want the canvas to take over the whole screen. Minimal display
2547         is recommended for use.
2548
2549 2015-12-07  Jon Lee  <jonlee@apple.com>
2550
2551         Update suites for benchmark
2552         https://bugs.webkit.org/show_bug.cgi?id=151957
2553
2554         Reviewed by Simon Fraser.
2555
2556         * Animometer/runner/animometer.html: Use spacers instead of relying on
2557         justify-content center to center the content. That allows the opening screen
2558         to grow downward when expanding the list of choices, otherwise it expands
2559         from the center, and off the top edge of the screen.
2560         * Animometer/runner/resources/animometer.css:
2561         (.tree): Don't overflow scroll.
2562         (.tree > li > label.tree-label:before): Use better glyphs.
2563         (.tree > li > :checked ~ label.tree-label:before):
2564         (main): Using flex-start for justify-content so that if the section grows too
2565         big it gets pinned to the top edge of the document instead of growing past it.
2566         (.spacer): Make the spacers have a minimum 20px and grow evenly.
2567         (section#home): Add a min-height so that the border will expand if the suite
2568         tests shown make the section grow past the height.
2569         * Animometer/runner/resources/animometer.js: Update the selectors.
2570         (window.suitesManager._treeElement):
2571         (window.suitesManager._suitesElements):
2572         (window.suitesManager._editsElements):
2573
2574 2015-12-07  Jon Lee  <jonlee@apple.com>
2575
2576         Update options for benchmark
2577         https://bugs.webkit.org/show_bug.cgi?id=151956
2578
2579         Reviewed by Simon Fraser.
2580
2581         Move "Fix test complexity" and "Adaptive" checkboxes into a radio group.
2582
2583         Move "Show running results" into a radio group, and add options to remove the HUD.
2584
2585         * Animometer/runner/animometer.html: Get rid of the preamble. Wrap the options
2586         in a form for easier referencing in JS.
2587         * Animometer/runner/resources/animometer.css: Show the surrounding border if the
2588         body's display-minimal class name is set.
2589         * Animometer/runner/resources/animometer.js:
2590
2591         Update the way optionsManager gets and sets default values. Include support for
2592         radio groups.
2593         (window.optionsManager.valueForOption):
2594         (window.optionsManager.updateUIFromLocalStorage):
2595         (window.optionsManager.updateLocalStorageFromUI):
2596
2597         (window.benchmarkRunnerClient.willStartFirstIteration):
2598         (window.sectionsManager.setupRunningSectionStyle):
2599         (window.suitesManager._treeElement): Fly-by whitespace fix.
2600         (window.suitesManager._suitesElements): Ditto.
2601         (window.suitesManager.updateEditsElementsState): Update options check.
2602         (window.suitesManager.updateDisplay): Add a new update function for the HUD.
2603         Attach a class to the body depending on the user's choice.
2604         (window.benchmarkController.initialize): Add an event listener when the form
2605         radio buttons update.
2606         (window.benchmarkController.onFormChanged):
2607         (window.optionsManager._optionsElements): Deleted.
2608         (window.optionsManager._adaptiveTestElement): Deleted.
2609         (window.benchmarkController.onChangeAdaptiveTestCheckbox): Deleted.
2610         * Animometer/tests/resources/main.js:
2611         (Benchmark.prototype.update): Update options checks.
2612         * Animometer/tests/resources/stage.js: Update option check.
2613         (StageBenchmark.prototype.showResults):
2614
2615 2015-12-01  Simon Fraser  <simon.fraser@apple.com>
2616
2617         Add a basic compositing Animometer test
2618         https://bugs.webkit.org/show_bug.cgi?id=151724
2619
2620         Reviewed by Dean Jackson.
2621
2622         Add a "bouncing particles" test that moves composited layers around, optionally with a filter.
2623
2624         This is added under a new "Miscellaneous" category.
2625
2626         Remove the test templates category from the UI.
2627
2628         * Animometer/runner/resources/tests.js:
2629         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2630         (BouncingCssShape.prototype.animate):
2631         * Animometer/tests/misc/compositing-transforms.html: Added.
2632         * Animometer/tests/misc/resources/compositing-transforms.js: Added.
2633         (BouncingCompositedImage):
2634         (BouncingCompositedImage.prototype._move):
2635         (BouncingCompositedImage.prototype.animate):
2636         (CompositingTransformsStage):
2637         (CompositingTransformsStage.prototype.createParticle):
2638         (CompositingTransformsStage.prototype.particleWillBeRemoved):
2639         (CompositedTransformsBenchmark):
2640         (CompositedTransformsBenchmark.prototype.createStage):
2641         (window.benchmarkClient.create):
2642
2643 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2644
2645         Fix the graphics benchmark complexity bounds adjustment
2646         https://bugs.webkit.org/show_bug.cgi?id=151670
2647
2648         Reviewed by Simon Fraser.
2649
2650         Make sure the graphics benchmark complexity bounds adjustment is applied
2651         to the absolute lower bound.
2652
2653         * Animometer/tests/resources/math.js:
2654         (PIDController.prototype._saturate):
2655
2656 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2657
2658         Add an option to select the results form the graphics benchmark
2659         https://bugs.webkit.org/show_bug.cgi?id=151666
2660
2661         Reviewed by Ryosuke Niwa.
2662
2663         We need an easy way to select the graphics benchmark results table such
2664         that when it is copied to the clipboard, rich text format is set to the
2665         clipboard.
2666
2667         * Animometer/runner/animometer.html: Add a new button to select the results table or JSON.
2668
2669         * Animometer/runner/resources/animometer.js:
2670         (window.sectionsManager._sectionDataElement): Selects the container <data> element.
2671         (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
2672         (window.sectionsManager.showTestName): Replace a literal string with a string table entry.
2673         (window.sectionsManager.selectData): Selects the container <data> element in a selection.
2674         (window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
2675         (window.benchmarkController.selectResults): Selects the results table.
2676         (window.benchmarkController.showJSON): Function rename.
2677         (window.benchmarkController.selectJSON): Selects the contents of the results JSON.
2678         (window.benchmarkController.showJson): Deleted.
2679
2680 2015-11-20  Simon Fraser  <simon.fraser@apple.com>
2681
2682         Animometer: graphs should not do interpolation
2683         https://bugs.webkit.org/show_bug.cgi?id=151526
2684
2685         Reviewed by Simon Fraser.
2686
2687         Having the graphs do interpolation is misleading, because you can't see the actual data.
2688
2689         Also remove "shape-rendering: crispEdges;" so the lines get antialiased.
2690
2691         * Animometer/runner/resources/animometer.css:
2692         (section#test-graph > data > svg): Deleted.
2693         * Animometer/runner/resources/graph.js:
2694         (graph): Deleted.
2695
2696 2015-11-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2697
2698         Calculate the graphics benchmark test gain adaptively
2699         https://bugs.webkit.org/show_bug.cgi?id=151208
2700
2701         Reviewed by Darin Adler.
2702
2703         We need to calculate the gain of the graphics benchmark tests adaptively
2704         and get rid of the gain and limits parameters we have to choose manually
2705         for every test. We are going to use the classic Ziegler–Nichols method for
2706         calculating the gain and integral and derivative times. We are going to
2707         try moving on a cubic curve during the manual stage from y0 to reach ysp.
2708         We also going to use a saturation actuator to ensure the system does not
2709         fluctuate.
2710
2711         * Animometer/resources/extensions.js:
2712         (ResultsTable.prototype._isNoisyMeasurement): Fix a parameter name.
2713         (ResultsTable.prototype._isNoisyTest): Since score is a member of testResults, we need to limit our search to frame rate and complexity.
2714         (ResultsTable.prototype._showTest): Pass the correct parameter to _isNoisyMeasurement().
2715
2716         * Animometer/resources/strings.js: Fix the indentation and name and value of a string.
2717
2718         * Animometer/runner/resources/tests.js: Remove all the manual gains and limits parameters which had to be passed to every test.
2719
2720         * Animometer/tests/resources/main.js:
2721         (BenchmarkState.prototype.currentStage): Fix an enum name.
2722         (Benchmark): Get rid of manual gain and limits.
2723         (Benchmark.prototype.update): Simplify the calculation by having all the times in ms.
2724
2725         * Animometer/tests/resources/math.js:
2726         (PIDController): Get rid of the manual gain and limits and the magic numbers for Ti and Td.
2727         (PIDController.prototype._yPosition): Tells whether the test current output is moving towards the set-point or away from it.
2728         (PIDController.prototype._distanceUltimate): Calculates the ultimate distance from y0 after time t using a cubic formula.
2729         (PIDController.prototype._distance): Calculates the distance of y relative to y0.
2730         (PIDController.prototype._gainIncrement): Decides how much the proportional gain should be increased during the manual gain stage.
2731         (PIDController.prototype._updateStage): Updates the stage of the controller based on its current stage and the system output.
2732         (PIDController.prototype._tuneP): Tunes the system before calculating the PID controller gains.
2733         (PIDController.prototype._tunePID): PID tuning function.
2734         (PIDController.prototype._tune):
2735         (PIDController.prototype._saturate):
2736         (PIDController.prototype.tune): Manages calculating the controller parameters. It then returns a PID tuning value.
2737         (PIDController.prototype._sat): Deleted. We may need to return it back but the limits have to be calculated adaptively not manually.
2738
2739 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2740
2741         Reorganize the graphics benchmark string table
2742         https://bugs.webkit.org/show_bug.cgi?id=151334
2743
2744         Reviewed by Simon Fraser.
2745
2746         Make the graphics benchmark string table be an object of sub-objects. Each
2747         sub-object represents an associative array, the key is the string name and
2748         the value is the string data.
2749
2750         * Animometer/resources/extensions.js:
2751         (ResultsDashboard.prototype.toJSON):
2752         (ResultsTable.prototype._showGraph):
2753         (ResultsTable.prototype._showJSON):
2754         (ResultsTable.prototype._isNoisyMeasurement):
2755         (ResultsTable.prototype._isNoisyTest):
2756         (ResultsTable.prototype._showTest):
2757         (ResultsTable.prototype._showSuite):
2758         (ResultsTable.prototype._showIteration):
2759         * Animometer/resources/sampler.js:
2760         (Sampler.prototype.toJSON):
2761         * Animometer/resources/strings.js:
2762         * Animometer/runner/resources/animometer.js:
2763         (window.benchmarkRunnerClient.didFinishLastIteration):
2764         (window.suitesManager.updateLocalStorageFromJSON):
2765         (window.benchmarkController.showResults):
2766         (window.benchmarkController.showJson):
2767         (window.benchmarkController.showTestGraph):
2768         (window.benchmarkController.showTestJSON):
2769         * Animometer/runner/resources/tests.js:
2770         * Animometer/tests/resources/main.js:
2771
2772 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2773
2774         Disable flattening the stage iframe of the graphics benchmark when running on iOS
2775         https://bugs.webkit.org/show_bug.cgi?id=151361
2776
2777         Reviewed by Simon Fraser.
2778
2779         Use fixed size for stage iframe of the graphics benchmark to disable
2780         flattening the iframe while animating the particles. Also ensure the
2781         bouncing particles do not go outside the iframe's boundaries.
2782
2783         * Animometer/runner/resources/animometer.css:
2784         (section#running > #running-test > iframe):
2785         (@media screen and (min-device-width: 1800px)):
2786         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2787         (BouncingParticle.prototype.animate):
2788
2789 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2790
2791         Use the media queries to dynamically set the stage for the graphics benchmark
2792         https://bugs.webkit.org/show_bug.cgi?id=151327
2793
2794         Reviewed by Simon Fraser.
2795
2796         Clean setting the benchmark css rules by using the media queries. Accessing
2797         document.stylesheets.cssRules seems to be unreliable. Fix the test harness
2798         load event listener invocation. And also remove the options for normalizing
2799         the stage resolution for retina display.
2800
2801         * Animometer/resources/extensions.js:
2802         (window.DocumentExtension.insertCssRuleAfter): Deleted.
2803         * Animometer/runner/animometer.html:
2804         * Animometer/runner/resources/animometer.css:
2805         (@media screen and (min-device-width: 1800px)):
2806         * Animometer/runner/resources/animometer.js:
2807         (window.sectionsManager.setupRunningSectionStyle):
2808         (window.benchmarkController.initialize):
2809         (window.sectionsManager.setupSectionStyle): Deleted.
2810         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2811         (BouncingParticlesStage):
2812         * Animometer/tests/text/layering-text.html:
2813         * Animometer/tests/text/resources/layering-text.js:
2814         (LayeringTextStage):
2815         (LayeringTextStage.prototype._setFontSize): Deleted.
2816
2817 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2818
2819         Remove the option for animating using setInterval from the graphics benchmark
2820         https://bugs.webkit.org/show_bug.cgi?id=151283
2821
2822         Reviewed by Darin Adler.
2823
2824         Get rid of the option to run animation using setInterval().
2825
2826         * Animometer/tests/resources/main.js:
2827         (Animator.prototype.animate):
2828         (Benchmark):
2829         (Benchmark.prototype.start):
2830         (Animator.prototype.start): Deleted.
2831
2832 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2833
2834         Highlight the alarming test results in the graphics benchmark results page
2835         https://bugs.webkit.org/show_bug.cgi?id=151286
2836
2837         Reviewed by Simon Fraser.
2838
2839         When showing the results of a test in the graphics benchmark the following
2840         criteria is going to be applied:
2841
2842         1. If the standard deviation of the test complexity or the frame rate is
2843            equal to or more than 10%, the standard deviation and the test name
2844            will be displayed in red.
2845         2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
2846            .. (desired_frame_rate + 2)], the average frame rate and the test name will
2847            be displayed in red.
2848
2849         * Animometer/resources/extensions.js:
2850         (ResultsTable.prototype._showHeaderRow):
2851         (ResultsTable.prototype._showHeader):
2852         (ResultsTable.prototype._showEmptyCell):
2853         (ResultsTable.prototype._showText):
2854         (ResultsTable.prototype._showFixedNumber):
2855         (ResultsTable.prototype.):
2856         (ResultsTable.prototype._showGraph):
2857         (ResultsTable.prototype._showJSON):
2858         (ResultsTable.prototype._isAlarmingMeasurement):
2859         (ResultsTable.prototype._isAlarmingTestResults):
2860         (ResultsTable.prototype._showEmptyCells):
2861         (ResultsTable.prototype._showEmptyRow):
2862         (ResultsTable.prototype._showTest):
2863         (ResultsTable.prototype._showSuite):
2864         (ResultsTable.prototype._showIteration):
2865         (ResultsTable.prototype.showRecord):
2866         (ResultsTable.prototype.showIterations):
2867         (ResultsTable.prototype._showEmpty): Deleted.
2868         * Animometer/runner/resources/animometer.js:
2869         (window.benchmarkRunnerClient.didFinishLastIteration):
2870         * Animometer/tests/resources/stage.js:
2871         (StageBenchmark.prototype.showResults):
2872
2873 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2874
2875         Clean referencing the options object in the graphics benchmark
2876         https://bugs.webkit.org/show_bug.cgi?id=151284
2877
2878         Reviewed by Simon Fraser.
2879
2880         Get rid of the Benchmark.options member and rely only on the private member
2881         Benchmark._options. The animator need to have its own options member instead
2882         of accessing it from its reference to Benchmark object.
2883
2884         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2885         (BouncingCanvasParticlesAnimator):
2886         (BouncingCanvasParticlesBenchmark.prototype.createAnimator):
2887         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2888         (BouncingParticle.prototype.animate):
2889         (BouncingParticlesAnimator):
2890         (BouncingParticlesBenchmark.prototype.createAnimator):
2891         * Animometer/tests/examples/resources/canvas-electrons.js:
2892         (CanvasElectronsStage.prototype.animate):
2893         (CanvasElectronsAnimator):
2894         (CanvasElectronsBenchmark.prototype.createAnimator):
2895         (window.benchmarkClient.create):
2896         * Animometer/tests/examples/resources/canvas-stars.js:
2897         (CanvasStarsStage.prototype.animate):
2898         (CanvasStarsAnimator):
2899         (CanvasStarsBenchmark.prototype.createAnimator):
2900         (window.benchmarkClient.create):
2901         * Animometer/tests/resources/main.js:
2902         (BenchmarkState.prototype.currentProgress):
2903         (Animator):
2904         (Animator.prototype.animate):
2905         (Benchmark):
2906         (Benchmark.prototype.update):
2907         * Animometer/tests/resources/stage.js:
2908         (Stage.prototype.clear):
2909         (StageAnimator):
2910         (StageBenchmark.prototype.createAnimator):
2911         (StageBenchmark.prototype.tune):
2912         (StageBenchmark.prototype.showResults):
2913         * Animometer/tests/simple/resources/simple-canvas.js:
2914         (SimpleCanvasStage.prototype.animate):
2915         (SimpleCanvasAnimator):
2916         (SimpleCanvasAnimator.prototype.animate):
2917         (SimpleCanvasBenchmark.prototype.createAnimator):
2918         * Animometer/tests/template/resources/template-canvas.js:
2919         (TemplateCanvasStage.prototype.animate):
2920         (TemplateCanvasBenchmark.prototype.createAnimator):
2921         (window.benchmarkClient.create):
2922
2923 2015-11-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2924
2925         Eliminate a request for layout every time an item is added to the stage of the graphics benchmark
2926         https://bugs.webkit.org/show_bug.cgi?id=151289
2927
2928         Reviewed by Simon Fraser.
2929
2930         Cache the stage size when it is created instead of requesting every time
2931         an object is added via clientWidth and clientHeight.
2932
2933         * Animometer/resources/extensions.js:
2934         (Insets.elementPadding):
2935         * Animometer/tests/resources/stage.js:
2936         (Stage):
2937         (Stage.prototype.get size):
2938
2939 2015-11-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2940
2941         Initialize the graphics benchmark's Kalman filter with estimated 60 FPS
2942         https://bugs.webkit.org/show_bug.cgi?id=150965
2943
2944         Reviewed by Darin Adler.
2945
2946         This should give the benchmark more accurate reading at warmup time. And
2947         hence we can safely reduce the test running time to be 10 seconds.
2948
2949         * Animometer/runner/animometer.html:
2950         Add "defer" back when loading resources/animometer.js since this script
2951         depends on many other scripts and we need to wait till the page is parsed.
2952         Also change the default test interval to be 10 seconds.
2953
2954         * Animometer/runner/resources/graph.js:
2955         (graph): Make the test results curves smoother.
2956
2957         * Animometer/tests/resources/main.js:
2958         (Animator): Initialize the Kalman filter with 60 FPS which should be true
2959         if the test page is empty.
2960
2961         (Animator.prototype.animate):
2962         * Animometer/tests/resources/math.js:
2963         (KalmanEstimator): Fix the initial value of _vecX_est.
2964             _vecX_est[0] = current FPS (= 60FPS when the test page is empty)
2965             _vecX_est[1] = first time derivative of FPS (=0; FPS has been constant).
2966             _vecX_est[2] = second time derivative of FPS (=0; since _vecX_est[1]=0).
2967         (KalmanEstimator.prototype.estimate): Add some comments.
2968
2969 2015-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2970
2971         Remove "defer" from the scripts' references in the graphics benchmark home page
2972         https://bugs.webkit.org/show_bug.cgi?id=150915
2973
2974         Reviewed by Simon Fraser.
2975
2976         It causes the benchmark to be very flakey.
2977
2978         * Animometer/runner/animometer.html:
2979
2980 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
2981
2982         Add an option to make the graphics benchmark runs a specific test with fixed complexity
2983         https://bugs.webkit.org/show_bug.cgi?id=150529
2984
2985         Reviewed by Darin Adler.
2986
2987         Beside each test in the suites tree, we are going to show the complexity
2988         arithmetic mean of the of the last run in an edit control. Based on a
2989         new option these edit controls will all be visible or hidden. If they are
2990         visible their values can be changed. The benchmark runner if it run in
2991         the non-adaptive mode will set the complexity of the test to the passed
2992         value and will not change it ever. The animator will animate the test and
2993         frame rate will also be measured.
2994
2995         * Animometer/runner/animometer.html: Add a new option for the non-adaptive mode.
2996
2997         * Animometer/runner/resources/animometer.css:
2998         (section#home input[type="number"]): Define the width of all the edit control in the <home> section.
2999         (section#home > suites input[type="number"]): The edit controls in the <suites> box will be right aligned and hidden by default.
3000         (section#home > suites input[type="number"].selected): When the class "selected" is added, the edit controls will be visible.
3001         (section#home > options > label > input[type="number"]): Deleted.
3002
3003         * Animometer/runner/resources/animometer.js:
3004         (window.benchmarkRunnerClient.didFinishLastIteration): Update the local storage with the results of each test.
3005         (window.optionsManager._adaptiveTestElement): Returns the checkbox for setting the adaptive test option.
3006         (window.suitesManager._editElement):  Returns the edit element associated with each test element in the suites tree.
3007         (window.suitesManager._editsElements): Returns a list of all the elements in the <suites> box.
3008         (window.suitesManager._localStorageNameForTest): Change this function to take strings.
3009         (window.suitesManager._createTestElement): Adds an edit control beside each test.
3010         (window.suitesManager.updateEditsElementsState): Adds/Removes the 'selected' class to/from all the tests edit elements.
3011         (window.suitesManager.updateUIFromLocalStorage): Reads the edit control value from the local storage.
3012         (window.suitesManager.updateLocalStorageFromUI): Saves the edit control value to the local storage.
3013         (window.suitesManager.updateLocalStorageFromJSON): Saves the last run results to the local storage.
3014         (window.benchmarkController.initialize): Shows/Hides the test edit controls based on the adaptive test option.
3015         (window.benchmarkController.onChangeAdaptiveTestCheckbox): An onchange event handler for the adaptive test checkbox.
3016
3017         * Animometer/tests/resources/main.js:
3018         (Benchmark.prototype.update): Fix the complexity of the test if the running mode is non-adaptive test and desired complexity is not zero.
3019         (window.runBenchmark): Add the test complexity as a new benchmark option.
3020
3021 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
3022
3023         Make the size of the benchmark canvas adaptive to the screen size and screen resolution
3024         https://bugs.webkit.org/show_bug.cgi?id=150530
3025
3026         Reviewed by Darin Adler.
3027
3028         We want to set the size of the benchmark stage dynamically such that it
3029         depends on the screen resolution and the device scale factor. This patch
3030         does more than that because the home page css was not done properly. To
3031         use the flex box layout, the animometer.css has to be rewritten almost from
3032         scratch. The suites tree has to be rewritten also because it was not collapsing
3033         and with the flex box layout it was going outside of the window area. The
3034         options handling and the local storage handling had to be rewritten to
3035         allow more flexibility with this patch and the future patches. The code
3036         in animometer.js was reorganized into objects to allow distributing the code
3037         nicely among separate entities.
3038
3039         * Animometer/resources/extensions.js:
3040         (Point.elementClientSize): Returns the client size of an HTMLElement as a Point object.
3041         (Insets.prototype.get width): Follow the function opening brace style guidelines.
3042         (Insets.prototype.get height):
3043         (Insets.prototype.get size): Returns the size of an Insets as a Point object.
3044
3045         (window.DocumentExtension): Provides document helper functions. It should be assailable from the runner and the tests.
3046         (window.DocumentExtension.createElement): Creates an HTMLElement given its name, attributes and parentElement.
3047         (window.DocumentExtension.createSvgElement): Creates an SVGElement given its name, attributes and parentElement (moved from utilities.js).
3048         (window.DocumentExtension.insertCssRuleAfter): Inserts a CSS rule after an exiting rule given its text.
3049
3050         (ResultsTable.prototype._showHeader): Use DocumentExtension functions.
3051         (ResultsTable.prototype._showGraph): Use DocumentExtension functions and create a real button for "Graph..." option.
3052         (ResultsTable.prototype._showJSON): Use DocumentExtension functions and create a real button for "JSON..." option.
3053         (Options): Deleted.
3054
3055         * Animometer/runner/animometer.html: Restructure the page to use the flex box layout.
3056
3057         * Animometer/runner/resources/animometer.css:
3058         (html,body):
3059         (button):
3060
3061         (button.large-button):The large button appears in the animometer.html.
3062         (button.large-button:active):
3063         (button.large-button:disabled):
3064
3065         (button.small-button): The small button appears in the results table.
3066         (button.small-button:active):
3067
3068         (.tree): The tree class is used to list the suites and their tests.
3069         (.tree .expand-button): This button expands a tree element.
3070         (.tree .expand-button ~ ul): Hide the children (<ul>...</ul>) of a parent node by default.
3071         (.tree .expand-button:checked ~ ul): Show the children of a parent node only when checked.
3072         (.tree ul): Hide the list bullets.
3073         (.tree li): Indent every node in the tree relative to its parent.
3074         (.tree ul li): Indent all the non top level nodes only (the tests nodes in our case).
3075         (.tree > li:last-child): Do not indent the bottom of the last child node.
3076         (.tree-label): Style for all the labels in the tree.
3077         (label.tree-label): Style for the labels in the top level only (the suites nodes in our case).
3078         (label.tree-label:before): Style the unchecked case of the expand-button.
3079         (:checked ~ label.tree-label:before): Style the checked case of the expand-button.
3080
3081         (table.results-table): The results table appears while running the test and at the end.
3082         (.results-table td):
3083         (.results-table th):
3084
3085         (div.results-json): The JSON div appears per test or for the whole run.
3086
3087         (main): This is the flex box container.
3088
3089         (section): A section is displayed exclusively inside the <main>. It is hidden by default.
3090         (section.selected): When it is selected, its layout is flex layout.
3091         (section > footer): The header or the footer of a section should not take more than 15% of the container.
3092
3093         (section#home): The home section has <suites> and <options> parts to be laid out in the middle.
3094         (section#home > options):
3095         (section#home > suites): The <suites> should not take more than 40% of the width.
3096         (section#home > options > label): The benchmark title.
3097         (section#home > header > h2): The benchmark title.
3098         (section#home > options > label > input[type="number"]): Sets the width of the option edit control.
3099
3100         (section#running): The running section contain the runner <iframe> which takes the whole area of the <main>.
3101         (section#running > #running-test): This is the <iframe> container.
3102         (section#running > #running-test > iframe): The <iframe> is created by the runner for each test.
3103         (section#running > #progress): This is the progress bar.
3104         (section#running > #progress > #progress-completed): This is another element which grows while the runner is progressing.
3105         (section#running > #record): This the container of the record results table which is shown while running a test.
3106
3107         (section#results):
3108         (section#json):
3109         (section#test-json):
3110         (section#test-graph): All these sections have the same layout. A <data> element is laid out between <header> and <footer>.
3111
3112         (section#results > data):
3113         (section#json > data):
3114         (section#test-json > data):
3115         (section#test-graph > data): The <data> element should take 70% of the <section>.
3116
3117         (section#test-graph > data > svg):
3118         (.axis line):
3119         (.left-samples): These styles are for the d3 graph.
3120
3121         (section#test-json > data): This is the style of the JSON <data> element.
3122
3123         (iframe): Deleted.
3124         (label, p): Deleted.
3125         (section > p): Deleted.
3126         (section#home > p): Deleted.
3127         (section#home > p:first-child): Deleted.
3128         (#testContainer): Deleted.
3129         (section#running #progress-completed): Deleted.
3130         (section#results > table): Deleted.
3131         (section#results > table td, th): Deleted.
3132         (section#results > table tr.alt, td): Deleted.
3133         (section#results > table th): Deleted.
3134         (section#json > textarea): Deleted.
3135         (.options): Deleted.
3136         (.options p): Deleted.
3137         (#suites ul): Deleted.
3138         (#suites ul ul): Deleted.
3139         (#suites ul ul input, #suites ul ul label): Deleted.
3140         (#suites.showTests ul ul): Deleted.
3141         (.column): Deleted.
3142         (input[type="number"]): Deleted.
3143         (.buttons): Deleted.
3144         (.small-button): Deleted.
3145         (#graphContainer): Deleted.
3146         (.right-samples): Deleted.
3147         (.sample-time): Deleted.
3148         (.left-mean): Deleted.
3149         (.right-mean): Deleted.
3150
3151         * Animometer/runner/resources/animometer.js:
3152         (window.benchmarkRunnerClient.initialize): Initialize the client object with the options and the suites.
3153         (window.benchmarkRunnerClient.willStartFirstIteration): Use new css selectors for results and the record table.
3154         (window.benchmarkRunnerClient.didFinishLastIteration): Move the code which sets the JSON text to sectionsManager.showJSON().
3155
3156         (window.sectionsManager): Responsible of managing the <section>s elements inside animometer.html.
3157         (window.sectionsManager._sectionHeaderH1Element): Return the <h1> inside the <header> of a given section.
3158         (window.sectionsManager._sectionDataDivElement): Return the <div> inside the <data> of a given section.
3159         (window.sectionsManager.showScore): Show the score of the last benchmark run.
3160         (window.sectionsManager.showTestName): Show the test name for detailed results <section>.
3161         (window.sectionsManager.showJSON): Shows the JSON text of the last benchmark or for a specific test.
3162         (window.sectionsManager.showSection): Shows a specific <section> in the <main> container.
3163         (window.sectionsManager.setupSectionStyle): Sets css attributes for all the <section>s.
3164         (window.sectionsManager.setupRunningSectionStyle): Sets the css attributes for the running <section> only.
3165
3166         (window.optionsManager): Responsible of managing the user options and streaming them to/form the localStorage.
3167         (window.optionsManager._optionsElements): Returns the children <input> elements of the <options>.
3168         (window.optionsManager.updateUIFromLocalStorage): Restore the values of the <options> UI elements from the local storage.
3169         (window.optionsManager.updateLocalStorageFromUI): Saves the values of the <options> UI elements to the local storage.
3170
3171         (window.suitesManager): Responsible of managing the user suites and streaming them to/form the localStorage.
3172         (window.suitesManager._treeElement): Returns the suites tree container element.
3173         (window.suitesManager._suitesElements): Returns a list of the suites elements.
3174         (window.suitesManager._checkboxElement): Returns the checkbox element of a given suite.
3175         (window.suitesManager._localStorageNameForTest): Generates a string for the tuple <suite, test> to be saved in the localStorage.
3176         (window.suitesManager._updateSuiteCheckboxState): Updates the state of a suite checkbox from the state of its tests' checkboxes.
3177         (window.suitesManager._updateStartButtonState): Updates the state of the start button from the state of the suites' checkboxes.
3178         (window.suitesManager._onChangeSuiteCheckbox): Called when a suite checkbox is clicked.
3179         (window.suitesManager._onChangeTestCheckbox): Called when a test checkbox is clicked.
3180         (window.suitesManager._createSuiteElement): Creates suite node in the suites tree.
3181         (window.suitesManager._createTestElement): Creates test node in the suites tree.
3182         (window.suitesManager.createElements): Creates the suites tree dynamically from the array Suites.
3183         (window.suitesManager.updateUIFromLocalStorage): Restore the values of the <suites> UI elements from the local storage.
3184         (window.suitesManager.updateLocalStorageFromUI): aves the values of the <suites> UI elements to the local storage.
3185
3186         (window.benchmarkController): This is the UI controller of the animometer.html page.
3187         (window.benchmarkController.initialize): Called when the animometer.html page is loaded.
3188         (window.benchmarkController._runBenchmark): Starts a benchmark run.
3189         (window.benchmarkController.startTest): Called when the "Start Test" button is clicked.
3190         (window.benchmarkController.showResults): Called at the end of the test to show the final results.
3191         (window.benchmarkController.showJson): Called from the results page to show the JSON of the last benchmark run.
3192         (window.benchmarkController.showTestGraph): Called from the results the table to show a graph for the samples of a specific test.
3193         (window.benchmarkController.showTestJSON): Called from the results the table to show a JSON for the samples of a specific test.
3194
3195         (showSection): Deleted.
3196         (startTest): Deleted.
3197         (showResults): Deleted.
3198         (showJson): Deleted.
3199         (showTestGraph): Deleted.
3200         (showTestJSON): Deleted.
3201         (initialize.toggleTestsCheckbox.onchange): Deleted.
3202         (initialize): Deleted.
3203         (updateSuiteSelection): Deleted.
3204         (updateTestSelection): Deleted.
3205         (updateSuiteCheckbox): Deleted.
3206         (localStorageNameForTest): Deleted.
3207         (populateSettings.): Deleted.
3208         (populateSettings): Deleted.
3209
3210         * Animometer/runner/resources/benchmark-runner.js:
3211         (BenchmarkRunner): Pass the frameContainer element to the BenchmarkRunner.
3212         (BenchmarkRunner.prototype._appendFrame): Remove unused parameter unwanted styling code.
3213         (BenchmarkRunner.prototype.runMultipleIterations):  Use the this._client.iterationCount instead of passing it as a parameter also.
3214
3215         * Animometer/runner/resources/graph.js:
3216         (graph): Calculate the size of the chart from the container element.
3217
3218         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
3219         (BouncingSvgImage):
3220         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
3221         (BouncingSvgParticlesStage.prototype._createDefs):
3222         (BouncingSvgParticlesStage.prototype._createClipStar):
3223         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
3224         (BouncingSvgShape.prototype._createShape):
3225         (BouncingSvgShapesStage.prototype.createGradient):
3226         Call DocumentExtension.createSvgElement() instead of calling Utilities.createSvgElement().
3227