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