Changeset 190575 in webkit


Ignore:
Timestamp:
Oct 5, 2015 1:38:52 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Add a graphics benchmark
https://bugs.webkit.org/show_bug.cgi?id=149053
<rdar://problem/18984169>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-10-05
Reviewed by Dean Jackson.

Instead of measuring the FPS of the animation, this benchmark measures the
test complexity when rendering at a set-point FPS which should be lower
than 60 FPS. This benchmark tries to stay at the set-point FPS by using
a closed loop control system PID function. The gain of the system is passed
as a parameter when running the test. Measuring the FPS faithfully results
very fluctuating values. A Kalman filter is used to give a better estimate
for the current FPS.

The animation of the tests is done manually. requestAnimationFrame() is
called with a callback. Inside this callback, the test is animating by
changing the positions of the elements inside the page. The test complexity
may change also if the current FPS is not equal to the desired FPS.

In this patch, the benchmark and the tests are included. The shared code
and the tests runner are included in separate patches.

  • Animometer/runner/animometer.html:
  • Animometer/runner/resources/animometer.js:

Add two new examples for more complex animation techniques.
Add an option to show/hide the test running results which is off by default.

  • Animometer/runner/resources/tests.js: Added.

(suiteFromName): Returns a suite given its name.
(testFromName): Returns a test given its suite and name.

  • Animometer/tests: Added.

This directory includes all the test suites to be run by the benchmark.
runner. All the tests should try to run on three stages: CSS, canvas and
SVG.

  • Animometer/tests/bouncing-particles: Added.
  • Animometer/tests/bouncing-particles/resources: Added.

The bouncing particles test is an example of a simple animation technique.

  • Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Added.
  • Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Added.
  • Animometer/tests/bouncing-particles/bouncing-css-images.html: Added.
  • Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Added.
  • Animometer/tests/bouncing-particles/bouncing-svg-images.html: Added.
  • Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Added.

Bouncing particles test pages.

  • Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Added.

(BouncingParticle): Base class for a bouncing particle.
(BouncingParticle.prototype.center): Returns the center point or the particle.
(BouncingParticle.prototype.animate): Moves the particle based on its current position, angle and velocity.

(BouncingParticlesAnimator): A sub class of Animator.

(BouncingParticlesStage): Represents the container of all the bouncing particles.
(BouncingParticlesStage.prototype.parseShapeParamters): Gets the shape parameters for shape animating tests.
(BouncingParticlesStage.prototype.randomRotater): Creates a rotater for the particles.
(BouncingParticlesStage.prototype.animate): Animates all the particles.
(BouncingParticlesStage.prototype.tune): Changes the test by adding or removing particles.

(BouncingParticlesBenchmark): Runs the benchmark for bouncing particles test.
(BouncingParticlesBenchmark.prototype.createAnimator): Creates an animator of type BouncingParticlesAnimator.

  • Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: Added.

(BouncingCssShape): A sub class of BouncingParticle for animating CSS shapes.
(BouncingCssShape.prototype._createSpan): Creates a <span> element and takes the shape and clipping classes into consideration.
(BouncingCssShape.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
(BouncingCssShape.prototype.animate): Rotates and moves the shape to a new location.

(BouncingCssShapesStage): A sub class of BouncingParticlesStage for animating CSS shapes.
(BouncingCssShapesStage.prototype.createParticle): Creates a particle of type BouncingCssShape.
(BouncingCssShapesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.

(BouncingCssShapesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS shapes.
(BouncingCssShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCssShapesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCssShapesBenchmark.

  • Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: Added.

(BouncingCssImage): A sub class of BouncingParticle for animating CSS images.
(BouncingCssImage.prototype._move): Move the particle to a new location. Apply transform since it does not require layout.
(BouncingCssImage.prototype.animate): Rotates and moves the shape to a new location.

(BouncingCssImagesStage): A sub class of BouncingParticlesStage for animating CSS images.
(BouncingCssImagesStage.prototype.createParticle): Creates a particle of type BouncingCssImage.
(BouncingCssImagesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.

(BouncingCssImagesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS images.
(BouncingCssImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCssImagesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCssImagesBenchmark.

  • Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Added.

(BouncingCanvasParticle): A base sub-class of BouncingParticle for animating canvas particles.
(BouncingCanvasParticle.prototype._applyRotation): Apply the particle rotation-around-center transform to the canvas context.
(BouncingCanvasParticle.prototype._applyClipping): Apply the particle clipping to the canvas context.
(BouncingCanvasParticle.prototype._draw): A non-implemented version of the drawing function.
(BouncingCanvasParticle.prototype.animate): Carries out all the steps to redraw the canvas particle.

(BouncingCanvasParticlesStage): A base sub-class of BouncingParticlesStage for animating canvas particles.

(BouncingCanvasParticlesAnimator): A concrete sub-class of BouncingParticlesAnimator for animating canvas particles.
(BouncingCanvasParticlesAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.

(BouncingCanvasParticlesBenchmark): A base sub-class of StageBenchmark for animating canvas particles.
(BouncingCanvasParticlesBenchmark.prototype.createAnimator): Creates the canvas particles animator.

  • Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Added.

(BouncingCanvasShape): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
(BouncingCanvasShape.prototype._applyFill): Sets the fillStyle in the canvas context.
(BouncingCanvasShape.prototype._drawShape): Carries out the actual drawing.
(BouncingCanvasShape.prototype._draw): Carries out all the steps to draw the shape.

(BouncingCanvasShapesStage): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
(BouncingCanvasShapesStage.prototype.createParticle): Creates a particle of type BouncingCanvasShape.

(BouncingCanvasShapesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas shapes.
(BouncingCanvasShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasShapesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasShapesBenchmark.

  • Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Added.

(BouncingCanvasImage): A concrete sub-class of BouncingCanvasParticle for animating canvas images.
(BouncingCanvasImage.prototype._draw): Draws an image on the context of a canvas.

(BouncingCanvasImagesStage): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
(BouncingCanvasImagesStage.prototype.createParticle): Creates a particle of type BouncingCanvasImage.

(BouncingCanvasImagesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
(BouncingCanvasImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasImagesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasImagesBenchmark.

  • Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Added.

(BouncingSvgParticle): A base sub-class of BouncingParticle for animating SVG particles.
(BouncingSvgParticle.prototype._applyClipping): Apply the particle clipping by setting the 'clip-path' attribute of the SVGElement.
(BouncingSvgParticle.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
(BouncingSvgParticle.prototype.animate): Rotates and moves the shape to a new location.
(BouncingSvgParticlesStage): A sub class of BouncingParticlesStage for animating SVGElements.
(BouncingSvgParticlesStage.prototype._createDefs): Creates an SVGDefsElement.
(BouncingSvgParticlesStage.prototype._ensureDefsIsCreated): Ensures there is only one SVGDefsElement is created.
(BouncingSvgParticlesStage.prototype._createClipStar): Creates an SVGClipPathElement and sets its 'd' attribute to a star like shape.
(BouncingSvgParticlesStage.prototype.ensureClipStarIsCreated): Ensure there is only one star SVGClipPathElement is created.
(BouncingSvgParticlesStage.prototype.particleWillBeRemoved): Remove the corresponding element form the parent children list.

  • Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Added.

(BouncingSvgShape): A concrete sub-class of BouncingSVGParticle for animating SVG shapes.
(BouncingSvgShape.prototype._createShape): Creates an SVG shape.
(BouncingSvgShape.prototype._applyFill): Applies the selected fill style to the SVG shape.

(BouncingSvgShapesStage): A concrete sub-class of BouncingSvgParticlesStage for animating SVG shapes.
(BouncingSvgShapesStage.prototype.createGradient): Creates an SVGLinearGradientElement.
(BouncingSvgShapesStage.prototype.createParticle): Creates a particle of type BouncingSvgShape.
(BouncingSvgShapesStage.prototype.particleWillBeRemoved): Ensures the attached SVGLinearGradientElement is removed from the SVGDefsElement.

(BouncingSvgShapesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
(BouncingSvgShapesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgShapesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingSvgShapesBenchmark.

  • Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Added.

(BouncingSvgImage): A concrete sub-class of BouncingSVGParticle for animating SVG images.

(BouncingSvgImagesStage): A concrete sub-class of BouncingSVGParticlesBenchmark for animating SVG images.
(BouncingSvgImagesStage.prototype.createParticle): Creates a particle of type BouncingSvgImage.

(BouncingSvgImagesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
(BouncingSvgImagesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgImagesStage.
(window.benchmarkClient.create): Creates a benchmark of type BouncingSvgImagesBenchmark.

  • Animometer/tests/examples: Added.
  • Animometer/tests/examples/canvas-electrons.html: Added.
  • Animometer/tests/examples/canvas-stars.html: Added.

Examples test pages.

  • Animometer/tests/examples/resources: Added.
  • Animometer/tests/examples/resources/canvas-electrons.js: Added.

(CanvasElectron): An object which draws and animate a electron object on a canvas stage.
(CanvasElectron.prototype._draw): Draws the electron object.
(CanvasElectron.prototype.animate): Animates the electron object.

(CanvasElectronsStage): A concrete sub-class of Stage for animating electrons.
(CanvasElectronsStage.prototype.tune): Changes the test by adding or removing elements.
(CanvasElectronsStage.prototype.animate): Animates the test elements.

(CanvasElectronsAnimator): A concrete sub-class of StageAnimator for animating canvas electrons.
(CanvasElectronsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.

(CanvasElectronsBenchmark): A concrete sub-class of StageBenchmark for animating electrons.
(CanvasElectronsBenchmark.prototype.createStage): Creates a stage of CanvasElectronsStage.
(CanvasElectronsBenchmark.prototype.createAnimator): Creates an animator of type CanvasElectronsAnimator.
(window.benchmarkClient.create): Creates a benchmark of type CanvasElectronsBenchmark.

  • Animometer/tests/examples/resources/canvas-stars.js: Added.

(CanvasStar): An object which draws and animate a star object on a canvas stage.
(CanvasStar.prototype._draw): Draws the star object.
(CanvasStar.prototype.animate): Animates the star object.

(CanvasStarsStage): A concrete sub-class of Stage for animating stars.
(CanvasStarsStage.prototype.tune): Changes the test by adding or removing elements.
(CanvasStarsStage.prototype.animate): Animates the test elements.

(CanvasStarsAnimator): A concrete sub-class of StageAnimator for animating canvas stars.
(CanvasStarsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.

(CanvasStarsBenchmark): A concrete sub-class of Benchmark for animating stars.
(CanvasStarsBenchmark.prototype.createStage): Creates a stage of CanvasStarsStage.
(CanvasStarsBenchmark.prototype.createAnimator): Creates an animator of type CanvasStarsAnimator.
(window.benchmarkClient.create): Creates a benchmark of type CanvasStarsBenchmark.

  • Animometer/tests/resources: Added.

This directory includes the script which is required to run an adaptive
graphics benchmark. From an empty test page, the set of classes in this
directory are responsible for measuring the current frame rate and
changing the test to reach a desired FPS. It keeps asking the test page
to tune itself by a certain value to increase or decrease the frame rate.
It's also responsible for sampling the test state and the corresponding
frame rate.

  • Animometer/tests/resources/main.js: Added.

(BenchmarkState): Tracks the state of the benchmark test.
(BenchmarkState.prototype._timeOffset): Returns the timeOffset of a stage.
(BenchmarkState.prototype._message): Returns the message of a stage.
(BenchmarkState.prototype.update): Sets the currentTimeOffset to a new value.
(BenchmarkState.prototype.samplingTimeOffset): Returns the timeOffset of the sampling stage.
(BenchmarkState.prototype.currentStage): Returns the current stage of the benchmark.
(BenchmarkState.prototype.currentMessage): Returns the message of the current stage and timeOffset.
(BenchmarkState.prototype.currentProgress): Returns a percentage of how much the benchmark is running.

(Animator): Manages animating the test.
(Animator.prototype.start): Called if animating using setInterval is requested.
(Animator.prototype.timeDelta): Returns the current timeDelta
(Animator.prototype.animate): Manages the test animation.
(Animator.prototype.animateLoop): Called if animating using requestAnimationFrame is requested.

(Benchmark): Manages running the test benchmark and recording the sampled data.
(Benchmark.prototype.start): Starts the benchmark.
(Benchmark.prototype.update): Called from the animator.animate() to change the complexity of the test.
(Benchmark.prototype.record): Shows the current (not final) results of the benchmark.
(Benchmark.prototype.resolveWhenFinished): Spins until the benchmark is finished and returns its results.
(Benchmark.prototype.run): Starts the test, runs it, waits until it is finished and return its results.
(window.runBenchmark): Called from the benchmark runner through the suite controller run-callback.

  • Animometer/tests/resources/math.js: Added.

(Matrix): A matrix object.
(Vector3): A vector of size 3 object.
(Matrix3): A matrix of size 3x3 object.

(PIDController): Closed-loop controller for a set-point y.
(PIDController.prototype._sat): Limits the output to a certain range.
(PIDController.prototype.tune): Given the current output of a system, it produces a new pid value for tuning it.

(KalmanEstimator): Implement Kalman filter to get an estimate for a sampled data point.
(KalmanEstimator.prototype.estimate): Returns an estimate for for a sampled data point.

  • Animometer/tests/resources/utilities.js: Added.

(window.Utilities._parse): Given a separator character, it pareses a string to a set of <key, value> pairs.
(window.Utilities.parseParameters): Parses a test parameters.
(window.Utilities.parseArguments): Parses a tag arguments.
(window.Utilities.extendObject): Adds the attributes and their values of an object to another object.
(window.Utilities.copyObject): Copies the attributes and their values of an object to a new object.
(window.Utilities.mergeObjects): Copies the attributes and their values of two objects to a new object.
(window.Utilities.createSvgElement): Creates an SVGElement given its name and its attributes.

  • Animometer/tests/resources/stage.css: Added.
  • Animometer/tests/resources/stage.js: Added.

(Rotater): Manages rotating an angle within a fixed time interval.
(Rotater.prototype.get interval): Returns the time interval which is required to rotate 360 degrees.
(Rotater.prototype.next): Moves the current time by a delta.
(Rotater.prototype.degree): Returns the current rotating degree.
(Rotater.prototype.rotateZ): Returns CSS formatted transform rotateZ() string for the current degree.
(Rotater.prototype.rotate): Returns SVG formatted transform rotate() string for the current degree.

(Stage): A base class for managing the test complexity and test animation.
(Stage.prototype.get size): Returns the size of the stage excluding the CSS padding.
(Stage.prototype.random): Returns a random float.
(Stage.prototype.randomInt): Returns a random integer.
(Stage.prototype.randomPosition): Returns a random position.
(Stage.prototype.randomSquareSize): Returns a square size.
(Stage.prototype.randomVelocity): Returns a random velocity.
(Stage.prototype.randomAngle): Returns a random angle.
(Stage.prototype.randomColor): Returns a random color not too dark and not too light.
(Stage.prototype.randomRotater): Creates a random rotater. Its velocity depends on choosing a random rotation time interval.
(Stage.prototype.tune): A not-implemented version of this function.
(Stage.prototype.animate): A not-implemented version of this function.
(Stage.prototype.clear): Clears the stage from all its animation elements.

(StageAnimator): A base class for the stage-based animators.
(StageAnimator.prototype.animate): Calls Animator.animate() which updates the test page and then calls Stage.animate() to force redraw.

(StageBenchmark): A base class for the stage-based benchmarks.
(StageBenchmark.prototype.createStage): Creates the default stage.
(StageBenchmark.prototype.createAnimator): Creates the default animator.
(StageBenchmark.prototype.tune): Delegates the call to stage.
(StageBenchmark.prototype.clear): Delegates the call to stage.
(StageBenchmark.prototype.showResults): Shows the results/progress through its recordTable and progressBar.

  • Animometer/tests/resources/yin-yang.png: Added.
  • Animometer/tests/resources/yin-yang.svg: Added.

These images are shared among all the tests.

  • Animometer/tests/template: Added.
  • Animometer/tests/template/resources: Added.

This directory includes template tests which do nothing. They can be used
to author new tests. Animated items can be created, moved and redrawn by
removing the TODO comments in the script files and writing actual code.

  • Animometer/tests/template/template-css.html: Added.
  • Animometer/tests/template/template-canvas.html: Added.
  • Animometer/tests/template/template-svg.html: Added.

Template test pages. They can be used as they are. CSS attributes or hidden
elements can be added to these derived test pages if needed.

  • Animometer/tests/template/resources/template-css.js: Added.

(TemplateCssStage): A stage to create and animate HTMLElements.
(TemplateCssStage.prototype.tune): Changes the test by adding or removing elements.
(TemplateCssStage.prototype.animate): Animates the test elements.
(TemplateCssBenchmark):
(TemplateCssBenchmark.prototype.createStage): Creates the test stage.
(window.benchmarkClient.create): Creates a benchmark of type TemplateCssBenchmark.

  • Animometer/tests/template/resources/template-canvas.js: Added.

(TemplateCanvasObject):
(TemplateCanvasObject.prototype._draw): Draws the objects on the canvas context.
(TemplateCanvasObject.prototype.animate): Moves and redraws the object.
(TemplateCanvasStage): A stage to create and animate drawing elements.
(TemplateCanvasStage.prototype.tune): hanges the test by adding or removing elements.
(TemplateCanvasStage.prototype.animate): Animates the test elements.
(TemplateCanvasAnimator.prototype.animate): Starts the animation every frame.
(TemplateCanvasBenchmark):
(TemplateCanvasBenchmark.prototype.createStage): Creates a stage of type TemplateCanvasStage.
(TemplateCanvasBenchmark.prototype.createAnimator): Creates a animator of type TemplateCanvasAnimator.
(window.benchmarkClient.create): Creates a benchmark of type TemplateCanvasBenchmark.

  • Animometer/tests/template/resources/template-svg.js: Added.

(TemplateSvgStage): A stage to create and animate SVGElements.
(TemplateSvgStage.prototype.tune): Changes the test by adding or removing elements.
(TemplateSvgStage.prototype.animate): Animates the test elements.
(TemplateSvgBenchmark.prototype.createStage): Creates a stage of type TemplateSvgStage.
(window.benchmarkClient.create): Creates a benchmark of type TemplateSvgBenchmark.

  • Animometer/tests/text: Added.
  • Animometer/tests/text/resources: Added.

This directory includes the text animating tests which currently runs
on CSS stage only.

  • Animometer/tests/text/layering-text.html: Added.

Text test page.

  • Animometer/tests/text/resources/layering-text.js: Added.

(LayeringTextStage): Represents the container of all the stacked text layers.
(LayeringTextStage.parseTextItem): Parses a textItem which may be an opening tag, a closing tag or a self-closing tag.
(LayeringTextStage.isOpeningTextItem): Returns true if the textItem is an opening tag e.g. '<ol>'.
(LayeringTextStage.isClosingTextItem): Returns true if the textItem is an closing tag e.g. '</ol>.
(LayeringTextStage.textItemsFlags.LayeringTextStage.textItems.map): Calculates and stores isOpening and isClosing flags for each textItem.
(LayeringTextStage.isColorableTextItem): Returns true if the textItem is self-closing tag e.g. '<p>...</p>'.
(LayeringTextStage.isInsertableTextItem): Returns true if the textItems causes a new element to be added to the text layers.
(LayeringTextStage.colorableTextItems.LayeringTextStage.textItemsFlags.filter): Number of colorable textItems.
(LayeringTextStage.insertableTextItems.LayeringTextStage.textItemsFlags.filter): Number of insertable textItems.
(LayeringTextStage.colorIndexToTextElementIndex): Maps from colorIndex [0..colorableTextItems-1] to textElementIndex [0..insertableTextItems-1].
(LayeringTextStage.prototype._nextTextItem): Moves the _textItemIndex one step forward in a loop [0..LayeringTextStage.textItems.length-1].
(LayeringTextStage.prototype._previousTextItem): Moves the _textItemIndex one step backward in a loop.
(LayeringTextStage.prototype._pushTextElement): Creates a new textItemElement and adds it to the topmost container <div>.
(LayeringTextStage.prototype._popTextElement): Removes the last textItemElement from the topmost container <div>.
(LayeringTextStage.prototype._colorTextItem): Changes the background color of a single colorable textElement. The index advances in a circle [0..colorableTextItems-1].
(LayeringTextStage.prototype.animate): Changes the background color and the text color of the textElements such that a redraw is enforced.
(LayeringTextStage.prototype.tune): Adds or removes textElements to the stage.

(LayeringTextBenchmark): Runs the benchmark for the layering text test.
(LayeringTextBenchmark.prototype.createStage): Creates a stage of type LayeringTextStage.
(window.benchmarkClient.create): Creates a benchmark of type LayeringTextBenchmark.

Location:
trunk/PerformanceTests
Files:
45 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/Animometer/runner/animometer.html

    r190526 r190575  
    33<head>
    44    <link rel="stylesheet" href="resources/animometer.css">
    5     <script src="../resources/statistics.js" defer></script>
    65    <script src="../resources/sampler.js" defer></script>
    76    <script src="../resources/extensions.js" defer></script>
     
    2524                    <label><input id="canvas-suite" type="checkbox" checked> Canvas drawings suite</label><br>
    2625                    <label><input id="svg-suite" type="checkbox" checked> SVG elements suite</label><br>
     26                    <label><input id="examples-suite" type="checkbox"> Examples suite</label><br>
    2727                    <label><input id="template-suite" type="checkbox"> Template suite</label>
    2828                </div>
     
    3232                    <label><input id="estimated-frame-rate" type="checkbox" checked> Estimated Frame Rate</label><br>
    3333                    <label><input id="fix-test-complexity" type="checkbox"> Fix test complexity after warmup</label>
     34                    <label><input id="show-running-results" type="checkbox"> Show running results</label>
    3435                </div>
    3536            </div>
  • trunk/PerformanceTests/Animometer/runner/resources/animometer.js

    r190526 r190575  
    6464        document.getElementById("canvas-suite"),
    6565        document.getElementById("svg-suite"),
     66        document.getElementById("examples-suite"),
    6667        document.getElementById("template-suite"),
    6768    ];
     
    7374    benchmarkRunnerClient.options["estimatedFrameRate"] = document.getElementById("estimated-frame-rate").checked;   
    7475    benchmarkRunnerClient.options["fixTestComplexity"] = document.getElementById("fix-test-complexity").checked;
     76    benchmarkRunnerClient.options["showRunningResults"] = document.getElementById("show-running-results").checked;
     77   
     78    if (!benchmarkRunnerClient.options["showRunningResults"])
     79        document.getElementById("record").style.display = "none";
     80
    7581    var runner = new BenchmarkRunner(enabledSuites, benchmarkRunnerClient);
    7682    runner.runMultipleIterations(benchmarkRunnerClient.iterationCount);
  • trunk/PerformanceTests/ChangeLog

    r190541 r190575  
     12015-10-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Add a graphics benchmark
     4        https://bugs.webkit.org/show_bug.cgi?id=149053
     5        <rdar://problem/18984169>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Instead of measuring the FPS of the animation, this benchmark measures the
     10        test complexity when rendering at a set-point FPS which should be lower
     11        than 60 FPS. This benchmark tries to stay at the set-point FPS by using
     12        a closed loop control system PID function. The gain of the system is passed
     13        as a parameter when running the test. Measuring the FPS faithfully results
     14        very fluctuating values. A Kalman filter is used to give a better estimate
     15        for the current FPS.
     16
     17        The animation of the tests is done manually. requestAnimationFrame() is
     18        called with a callback. Inside this callback, the test is animating by
     19        changing the positions of the elements inside the page. The test complexity
     20        may change also if the current FPS is not equal to the desired FPS.
     21
     22        In this patch, the benchmark and the tests are included. The shared code
     23        and the tests runner are included in separate patches.
     24
     25        * Animometer/runner/animometer.html:
     26        * Animometer/runner/resources/animometer.js:
     27        Add two new examples for more complex animation techniques.
     28        Add an option to show/hide the test running results which is off by default.
     29
     30        * Animometer/runner/resources/tests.js: Added.
     31        (suiteFromName): Returns a suite given its name.
     32        (testFromName): Returns a test given its suite and name.
     33
     34        * Animometer/tests: Added.
     35        This directory includes all the test suites to be run by the benchmark.
     36        runner. All the tests should try to run on three stages: CSS, canvas and
     37        SVG.
     38       
     39        * Animometer/tests/bouncing-particles: Added.
     40        * Animometer/tests/bouncing-particles/resources: Added.
     41        The bouncing particles test is an example of a simple animation technique.
     42       
     43        * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Added.
     44        * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Added.
     45        * Animometer/tests/bouncing-particles/bouncing-css-images.html: Added.
     46        * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Added.
     47        * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Added.
     48        * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Added.
     49        Bouncing particles test pages.
     50
     51        * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Added.
     52        (BouncingParticle): Base class for a bouncing particle.
     53        (BouncingParticle.prototype.center): Returns the center point or the particle.
     54        (BouncingParticle.prototype.animate): Moves the particle based on its current position, angle and velocity.
     55       
     56        (BouncingParticlesAnimator): A sub class of Animator.
     57       
     58        (BouncingParticlesStage): Represents the container of all the bouncing particles.
     59        (BouncingParticlesStage.prototype.parseShapeParamters): Gets the shape parameters for shape animating tests.
     60        (BouncingParticlesStage.prototype.randomRotater): Creates a rotater for the particles.
     61        (BouncingParticlesStage.prototype.animate): Animates all the particles.
     62        (BouncingParticlesStage.prototype.tune): Changes the test by adding or removing particles.
     63       
     64        (BouncingParticlesBenchmark): Runs the benchmark for bouncing particles test.
     65        (BouncingParticlesBenchmark.prototype.createAnimator): Creates an animator of type BouncingParticlesAnimator.
     66
     67        * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: Added.
     68        (BouncingCssShape): A sub class of BouncingParticle for animating CSS shapes.
     69        (BouncingCssShape.prototype._createSpan): Creates a <span> element and takes the shape and clipping classes into consideration.
     70        (BouncingCssShape.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
     71        (BouncingCssShape.prototype.animate): Rotates and moves the shape to a new location.
     72       
     73        (BouncingCssShapesStage): A sub class of BouncingParticlesStage for animating CSS shapes.
     74        (BouncingCssShapesStage.prototype.createParticle): Creates a particle of type BouncingCssShape.
     75        (BouncingCssShapesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
     76       
     77        (BouncingCssShapesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS shapes.
     78        (BouncingCssShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCssShapesStage.
     79        (window.benchmarkClient.create): Creates a benchmark of type BouncingCssShapesBenchmark.
     80       
     81        * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: Added.
     82        (BouncingCssImage): A sub class of BouncingParticle for animating CSS images.
     83        (BouncingCssImage.prototype._move): Move the particle to a new location. Apply transform since it does not require layout.
     84        (BouncingCssImage.prototype.animate): Rotates and moves the shape to a new location.
     85       
     86        (BouncingCssImagesStage): A sub class of BouncingParticlesStage for animating CSS images.
     87        (BouncingCssImagesStage.prototype.createParticle): Creates a particle of type BouncingCssImage.
     88        (BouncingCssImagesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
     89       
     90        (BouncingCssImagesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS images.
     91        (BouncingCssImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCssImagesStage.
     92        (window.benchmarkClient.create): Creates a benchmark of type BouncingCssImagesBenchmark.
     93       
     94        * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Added.
     95        (BouncingCanvasParticle): A base sub-class of BouncingParticle for animating canvas particles.
     96        (BouncingCanvasParticle.prototype._applyRotation): Apply the particle rotation-around-center transform to the canvas context.
     97        (BouncingCanvasParticle.prototype._applyClipping): Apply the particle clipping to the canvas context.
     98        (BouncingCanvasParticle.prototype._draw): A non-implemented version of the drawing function.
     99        (BouncingCanvasParticle.prototype.animate): Carries out all the steps to redraw the canvas particle.
     100       
     101        (BouncingCanvasParticlesStage): A base sub-class of BouncingParticlesStage for animating canvas particles.
     102       
     103        (BouncingCanvasParticlesAnimator): A concrete sub-class of BouncingParticlesAnimator for animating canvas particles.
     104        (BouncingCanvasParticlesAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
     105       
     106        (BouncingCanvasParticlesBenchmark): A base sub-class of StageBenchmark for animating canvas particles.
     107        (BouncingCanvasParticlesBenchmark.prototype.createAnimator): Creates the canvas particles animator.
     108       
     109        * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Added.
     110        (BouncingCanvasShape): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
     111        (BouncingCanvasShape.prototype._applyFill): Sets the fillStyle in the canvas context.
     112        (BouncingCanvasShape.prototype._drawShape): Carries out the actual drawing.
     113        (BouncingCanvasShape.prototype._draw): Carries out all the steps to draw the shape.
     114       
     115        (BouncingCanvasShapesStage): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
     116        (BouncingCanvasShapesStage.prototype.createParticle): Creates a particle of type BouncingCanvasShape.
     117       
     118        (BouncingCanvasShapesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas shapes.
     119        (BouncingCanvasShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasShapesStage.
     120        (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasShapesBenchmark.
     121
     122        * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Added.
     123        (BouncingCanvasImage): A concrete sub-class of BouncingCanvasParticle for animating canvas images.
     124        (BouncingCanvasImage.prototype._draw): Draws an image on the context of a canvas.
     125       
     126        (BouncingCanvasImagesStage): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
     127        (BouncingCanvasImagesStage.prototype.createParticle): Creates a particle of type BouncingCanvasImage.
     128       
     129        (BouncingCanvasImagesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
     130        (BouncingCanvasImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasImagesStage.
     131        (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasImagesBenchmark.
     132
     133        * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Added.
     134        (BouncingSvgParticle): A base sub-class of BouncingParticle for animating SVG particles.
     135        (BouncingSvgParticle.prototype._applyClipping): Apply the particle clipping by setting the 'clip-path' attribute of the SVGElement.
     136        (BouncingSvgParticle.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
     137        (BouncingSvgParticle.prototype.animate): Rotates and moves the shape to a new location.
     138        (BouncingSvgParticlesStage): A sub class of BouncingParticlesStage for animating SVGElements.
     139        (BouncingSvgParticlesStage.prototype._createDefs): Creates an SVGDefsElement.
     140        (BouncingSvgParticlesStage.prototype._ensureDefsIsCreated): Ensures there is only one SVGDefsElement is created.
     141        (BouncingSvgParticlesStage.prototype._createClipStar): Creates an SVGClipPathElement and sets its 'd' attribute to a star like shape.
     142        (BouncingSvgParticlesStage.prototype.ensureClipStarIsCreated): Ensure there is only one star SVGClipPathElement is created.
     143        (BouncingSvgParticlesStage.prototype.particleWillBeRemoved): Remove the corresponding element form the parent children list.
     144
     145        * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Added.
     146        (BouncingSvgShape): A concrete sub-class of BouncingSVGParticle for animating SVG shapes.
     147        (BouncingSvgShape.prototype._createShape): Creates an SVG shape.
     148        (BouncingSvgShape.prototype._applyFill): Applies the selected fill style to the SVG shape.
     149       
     150        (BouncingSvgShapesStage): A concrete sub-class of BouncingSvgParticlesStage for animating SVG shapes.
     151        (BouncingSvgShapesStage.prototype.createGradient): Creates an SVGLinearGradientElement.
     152        (BouncingSvgShapesStage.prototype.createParticle): Creates a particle of type BouncingSvgShape.
     153        (BouncingSvgShapesStage.prototype.particleWillBeRemoved): Ensures the attached SVGLinearGradientElement is removed from the SVGDefsElement.
     154       
     155        (BouncingSvgShapesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
     156        (BouncingSvgShapesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgShapesStage.
     157        (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgShapesBenchmark.
     158       
     159        * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Added.
     160        (BouncingSvgImage): A concrete sub-class of BouncingSVGParticle for animating SVG images.
     161       
     162        (BouncingSvgImagesStage): A concrete sub-class of BouncingSVGParticlesBenchmark for animating SVG images.
     163        (BouncingSvgImagesStage.prototype.createParticle): Creates a particle of type BouncingSvgImage.
     164       
     165        (BouncingSvgImagesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
     166        (BouncingSvgImagesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgImagesStage.
     167        (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgImagesBenchmark.
     168
     169        * Animometer/tests/examples: Added.
     170        * Animometer/tests/examples/canvas-electrons.html: Added.
     171        * Animometer/tests/examples/canvas-stars.html: Added.
     172        Examples test pages.
     173       
     174        * Animometer/tests/examples/resources: Added.
     175        * Animometer/tests/examples/resources/canvas-electrons.js: Added.
     176        (CanvasElectron): An object which draws and animate a electron object on a canvas stage.
     177        (CanvasElectron.prototype._draw): Draws the electron object.
     178        (CanvasElectron.prototype.animate): Animates the electron object.
     179       
     180        (CanvasElectronsStage): A concrete sub-class of Stage for animating electrons.
     181        (CanvasElectronsStage.prototype.tune): Changes the test by adding or removing elements.
     182        (CanvasElectronsStage.prototype.animate): Animates the test elements.
     183       
     184        (CanvasElectronsAnimator): A concrete sub-class of StageAnimator for animating canvas electrons.
     185        (CanvasElectronsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
     186       
     187        (CanvasElectronsBenchmark): A concrete sub-class of StageBenchmark for animating electrons.
     188        (CanvasElectronsBenchmark.prototype.createStage): Creates a stage of CanvasElectronsStage.
     189        (CanvasElectronsBenchmark.prototype.createAnimator): Creates an animator of type CanvasElectronsAnimator.
     190        (window.benchmarkClient.create): Creates a benchmark of type CanvasElectronsBenchmark.
     191       
     192        * Animometer/tests/examples/resources/canvas-stars.js: Added.
     193        (CanvasStar): An object which draws and animate a star object on a canvas stage.
     194        (CanvasStar.prototype._draw): Draws the star object.
     195        (CanvasStar.prototype.animate): Animates the star object.
     196       
     197        (CanvasStarsStage): A concrete sub-class of Stage for animating stars.
     198        (CanvasStarsStage.prototype.tune): Changes the test by adding or removing elements.
     199        (CanvasStarsStage.prototype.animate): Animates the test elements.
     200       
     201        (CanvasStarsAnimator): A concrete sub-class of StageAnimator for animating canvas stars.
     202        (CanvasStarsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
     203       
     204        (CanvasStarsBenchmark): A concrete sub-class of Benchmark for animating stars.
     205        (CanvasStarsBenchmark.prototype.createStage): Creates a stage of CanvasStarsStage.
     206        (CanvasStarsBenchmark.prototype.createAnimator): Creates an animator of type CanvasStarsAnimator.
     207        (window.benchmarkClient.create): Creates a benchmark of type CanvasStarsBenchmark.
     208
     209        * Animometer/tests/resources: Added.
     210        This directory includes the script which is required to run an adaptive
     211        graphics benchmark. From an empty test page, the set of classes in this
     212        directory are responsible for measuring the current frame rate and
     213        changing the test to reach a desired FPS. It keeps asking the test page
     214        to tune itself by a certain value to increase or decrease the frame rate.
     215        It's also responsible for sampling the test state and the corresponding
     216        frame rate.
     217       
     218        * Animometer/tests/resources/main.js: Added.
     219        (BenchmarkState): Tracks the state of the benchmark test.
     220        (BenchmarkState.prototype._timeOffset): Returns the timeOffset of a stage.
     221        (BenchmarkState.prototype._message): Returns the message of a stage.
     222        (BenchmarkState.prototype.update): Sets the currentTimeOffset to a new value.
     223        (BenchmarkState.prototype.samplingTimeOffset): Returns the timeOffset of the sampling stage.
     224        (BenchmarkState.prototype.currentStage): Returns the current stage of the benchmark.
     225        (BenchmarkState.prototype.currentMessage): Returns the message of the current stage and timeOffset.
     226        (BenchmarkState.prototype.currentProgress): Returns a percentage of how much the benchmark is running.
     227       
     228        (Animator): Manages animating the test.
     229        (Animator.prototype.start): Called if animating using setInterval is requested.
     230        (Animator.prototype.timeDelta): Returns the current timeDelta
     231        (Animator.prototype.animate): Manages the test animation.
     232        (Animator.prototype.animateLoop): Called if animating using requestAnimationFrame is requested.
     233
     234        (Benchmark): Manages running the test benchmark and recording the sampled data.
     235        (Benchmark.prototype.start): Starts the benchmark.
     236        (Benchmark.prototype.update): Called from the animator.animate() to change the complexity of the test.
     237        (Benchmark.prototype.record): Shows the current (not final) results of the benchmark.
     238        (Benchmark.prototype.resolveWhenFinished): Spins until the benchmark is finished and returns its results.
     239        (Benchmark.prototype.run): Starts the test, runs it, waits until it is finished and return its results.
     240        (window.runBenchmark): Called from the benchmark runner through the suite controller run-callback.
     241
     242        * Animometer/tests/resources/math.js: Added.
     243        (Matrix): A matrix object.
     244        (Vector3): A vector of size 3 object.
     245        (Matrix3): A matrix of size 3x3 object.
     246       
     247        (PIDController): Closed-loop controller for a set-point y.
     248        (PIDController.prototype._sat): Limits the output to a certain range.
     249        (PIDController.prototype.tune): Given the current output of a system, it produces a new pid value for tuning it.
     250       
     251        (KalmanEstimator): Implement Kalman filter to get an estimate for a sampled data point.
     252        (KalmanEstimator.prototype.estimate): Returns an estimate for for a sampled data point.
     253
     254        * Animometer/tests/resources/utilities.js: Added.
     255        (window.Utilities._parse): Given a separator character, it pareses a string to a set of <key, value> pairs.
     256        (window.Utilities.parseParameters): Parses a test parameters.
     257        (window.Utilities.parseArguments): Parses a tag arguments.
     258        (window.Utilities.extendObject): Adds the attributes and their values of an object to another object.
     259        (window.Utilities.copyObject): Copies the attributes and their values of an object to a new object.
     260        (window.Utilities.mergeObjects): Copies the attributes and their values of two objects to a new object.
     261        (window.Utilities.createSvgElement): Creates an SVGElement given its name and its attributes.
     262       
     263        * Animometer/tests/resources/stage.css: Added.
     264        * Animometer/tests/resources/stage.js: Added.
     265        (Rotater): Manages rotating an angle within a fixed time interval.
     266        (Rotater.prototype.get interval): Returns the time interval which is required to rotate 360 degrees.
     267        (Rotater.prototype.next): Moves the current time by a delta.
     268        (Rotater.prototype.degree): Returns the current rotating degree.
     269        (Rotater.prototype.rotateZ): Returns CSS formatted transform rotateZ() string for the current degree.
     270        (Rotater.prototype.rotate): Returns SVG formatted transform rotate() string for the current degree.
     271       
     272        (Stage): A base class for managing the test complexity and test animation.
     273        (Stage.prototype.get size): Returns the size of the stage excluding the CSS padding.
     274        (Stage.prototype.random): Returns a random float.
     275        (Stage.prototype.randomInt): Returns a random integer.
     276        (Stage.prototype.randomPosition): Returns a random position.
     277        (Stage.prototype.randomSquareSize): Returns a square size.
     278        (Stage.prototype.randomVelocity): Returns a random velocity.
     279        (Stage.prototype.randomAngle): Returns a random angle.
     280        (Stage.prototype.randomColor): Returns a random color not too dark and not too light.
     281        (Stage.prototype.randomRotater): Creates a random rotater. Its velocity depends on choosing a random rotation time interval.
     282        (Stage.prototype.tune): A not-implemented version of this function.
     283        (Stage.prototype.animate): A not-implemented version of this function.
     284        (Stage.prototype.clear): Clears the stage from all its animation elements.
     285       
     286        (StageAnimator): A base class for the stage-based animators.
     287        (StageAnimator.prototype.animate): Calls Animator.animate() which updates the test page and then calls Stage.animate() to force redraw.
     288       
     289        (StageBenchmark): A base class for the stage-based benchmarks.
     290        (StageBenchmark.prototype.createStage): Creates the default stage.
     291        (StageBenchmark.prototype.createAnimator): Creates the default animator.
     292        (StageBenchmark.prototype.tune): Delegates the call to stage.
     293        (StageBenchmark.prototype.clear): Delegates the call to stage.
     294        (StageBenchmark.prototype.showResults): Shows the results/progress through its recordTable and progressBar.
     295       
     296        * Animometer/tests/resources/yin-yang.png: Added.
     297        * Animometer/tests/resources/yin-yang.svg: Added.
     298        These images are shared among all the tests.
     299       
     300        * Animometer/tests/template: Added.
     301        * Animometer/tests/template/resources: Added.
     302        This directory includes template tests which do nothing. They can be used
     303        to author new tests. Animated items can be created, moved and redrawn by
     304        removing the TODO comments in the script files and writing actual code.
     305
     306        * Animometer/tests/template/template-css.html: Added.
     307        * Animometer/tests/template/template-canvas.html: Added.
     308        * Animometer/tests/template/template-svg.html: Added.
     309        Template test pages. They can be used as they are. CSS attributes or hidden
     310        elements can be added to these derived test pages if needed.
     311       
     312        * Animometer/tests/template/resources/template-css.js: Added.
     313       
     314        (TemplateCssStage): A stage to create and animate HTMLElements.
     315        (TemplateCssStage.prototype.tune): Changes the test by adding or removing elements.
     316        (TemplateCssStage.prototype.animate): Animates the test elements.
     317        (TemplateCssBenchmark):
     318        (TemplateCssBenchmark.prototype.createStage): Creates the test stage.
     319        (window.benchmarkClient.create): Creates a benchmark of type TemplateCssBenchmark.
     320       
     321        * Animometer/tests/template/resources/template-canvas.js: Added.
     322        (TemplateCanvasObject):
     323        (TemplateCanvasObject.prototype._draw): Draws the objects on the canvas context.
     324        (TemplateCanvasObject.prototype.animate): Moves and redraws the object.
     325        (TemplateCanvasStage): A stage to create and animate drawing elements.
     326        (TemplateCanvasStage.prototype.tune): hanges the test by adding or removing elements.
     327        (TemplateCanvasStage.prototype.animate):  Animates the test elements.
     328        (TemplateCanvasAnimator.prototype.animate): Starts the animation every frame.
     329        (TemplateCanvasBenchmark):
     330        (TemplateCanvasBenchmark.prototype.createStage): Creates a stage of type TemplateCanvasStage.
     331        (TemplateCanvasBenchmark.prototype.createAnimator): Creates a animator of type TemplateCanvasAnimator.
     332        (window.benchmarkClient.create): Creates a benchmark of type TemplateCanvasBenchmark.
     333       
     334        * Animometer/tests/template/resources/template-svg.js: Added.
     335        (TemplateSvgStage): A stage to create and animate SVGElements.
     336        (TemplateSvgStage.prototype.tune): Changes the test by adding or removing elements.
     337        (TemplateSvgStage.prototype.animate): Animates the test elements.
     338        (TemplateSvgBenchmark.prototype.createStage): Creates a stage of type TemplateSvgStage.
     339        (window.benchmarkClient.create): Creates a benchmark of type TemplateSvgBenchmark.
     340       
     341        * Animometer/tests/text: Added.
     342        * Animometer/tests/text/resources: Added.
     343        This directory includes the text animating tests which currently runs
     344        on CSS stage only.
     345       
     346        * Animometer/tests/text/layering-text.html: Added.
     347        Text test page.
     348       
     349        * Animometer/tests/text/resources/layering-text.js: Added.
     350        (LayeringTextStage): Represents the container of all the stacked text layers.
     351        (LayeringTextStage.parseTextItem): Parses a textItem which may be an opening tag, a closing tag or a self-closing tag.
     352        (LayeringTextStage.isOpeningTextItem): Returns true if the textItem is an opening tag e.g. '<ol>'.
     353        (LayeringTextStage.isClosingTextItem): Returns true if  the textItem is an closing tag e.g. '</ol>.
     354        (LayeringTextStage.textItemsFlags.LayeringTextStage.textItems.map): Calculates and stores isOpening and isClosing flags for each textItem.
     355        (LayeringTextStage.isColorableTextItem): Returns true if the textItem is self-closing tag e.g. '<p>...</p>'.
     356        (LayeringTextStage.isInsertableTextItem): Returns true if the textItems causes a new element to be added to the text layers.
     357        (LayeringTextStage.colorableTextItems.LayeringTextStage.textItemsFlags.filter): Number of colorable textItems.
     358        (LayeringTextStage.insertableTextItems.LayeringTextStage.textItemsFlags.filter): Number of insertable textItems.
     359        (LayeringTextStage.colorIndexToTextElementIndex): Maps from colorIndex [0..colorableTextItems-1] to textElementIndex [0..insertableTextItems-1].
     360        (LayeringTextStage.prototype._nextTextItem): Moves the _textItemIndex one step forward in a loop [0..LayeringTextStage.textItems.length-1].
     361        (LayeringTextStage.prototype._previousTextItem): Moves the _textItemIndex one step backward in a loop.
     362        (LayeringTextStage.prototype._pushTextElement): Creates a new textItemElement and adds it to the topmost container <div>.
     363        (LayeringTextStage.prototype._popTextElement): Removes the last textItemElement from the topmost container <div>.
     364        (LayeringTextStage.prototype._colorTextItem): Changes the background color of a single colorable textElement. The index advances in a circle [0..colorableTextItems-1].
     365        (LayeringTextStage.prototype.animate): Changes the background color and the text color of the textElements such that a redraw is enforced.
     366        (LayeringTextStage.prototype.tune): Adds or removes textElements to the stage.
     367
     368        (LayeringTextBenchmark): Runs the benchmark for the layering text test.
     369        (LayeringTextBenchmark.prototype.createStage): Creates a stage of type LayeringTextStage.
     370        (window.benchmarkClient.create): Creates a benchmark of type LayeringTextBenchmark.
     371
    13722015-10-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
    2373
Note: See TracChangeset for help on using the changeset viewer.