Changeset 199134 in webkit


Ignore:
Timestamp:
Apr 6, 2016 6:47:53 PM (8 years ago)
Author:
jonlee@apple.com
Message:

Update master benchmark with SVG test
https://bugs.webkit.org/show_bug.cgi?id=156273

Reviewed by Dean Jackson.
Provisionally reviewed by Said Abou-Hallawa.

Switch masks tests for SVG path test.

  • Animometer/resources/debug-runner/tests.js: Move mask test here.
  • Animometer/resources/runner/tests.js: Add SVG test here.
  • Animometer/tests/dom/particles.html: Renamed from PerformanceTests/Animometer/tests/master/particles.html.
  • Animometer/tests/dom/resources/dom-particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/dom-particles.js.
  • Animometer/tests/master/resources/particles.js: Add minPosition for bounds checking. Prevents particle from being

partially obscured.

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

(Particle): The particle is either a path object or a rect using a path as a clip. The
same path is used either way. For each particle create a linear gradient with a random
rotation.
(SVGParticlesStage): Look in #shapes to see how many different kinds of paths are available.
This makes the test more generic in case other shapes need to be tested.

  • Animometer/tests/master/svg-particles.html: Added. Have two defs, one that houses each

particle's gradient, and one that holds the shape templates.

Location:
trunk/PerformanceTests
Files:
2 added
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/Animometer/resources/debug-runner/tests.js

    r198509 r199134  
    171171        },
    172172        {
     173            url: "dom/particles.html",
     174            name: "DOM particles, SVG masks"
     175        },
     176        {
    173177            url: "dom/compositing-transforms.html?particleWidth=50&particleHeight=50&filters=yes&imageSrc=../resources/yin-yang.svg",
    174178            name: "Composited Transforms"
  • trunk/PerformanceTests/Animometer/resources/runner/tests.js

    r198509 r199134  
    4646        },
    4747        {
    48             url: "master/particles.html",
    49             name: "DOM particles, SVG masks"
     48            url: "master/svg-particles.html",
     49            name: "Suits"
    5050        },
    5151    ]
  • trunk/PerformanceTests/Animometer/tests/dom/particles.html

    r199130 r199134  
    1919    <script src="../resources/math.js"></script>
    2020    <script src="../resources/main.js"></script>
    21     <script src="resources/particles.js"></script>
     21    <script src="../master/resources/particles.js"></script>
    2222    <script src="resources/dom-particles.js"></script>
    2323</body>
  • trunk/PerformanceTests/Animometer/tests/dom/resources/dom-particles.js

    r199130 r199134  
    1414        Particle.prototype.reset.call(this);
    1515
    16         var emitLocation = Stage.randomElementInArray(this.stage.emitLocation);
    17         this.position = new Point(emitLocation.x, emitLocation.y);
     16        this.position = Stage.randomElementInArray(this.stage.emitLocation);
    1817
    1918        var angle = Stage.randomInt(0, this.stage.emitSteps) / this.stage.emitSteps * Math.PI * 2 + Stage.dateCounterValue(100) * this.stage.emissionSpin;
  • trunk/PerformanceTests/Animometer/tests/master/resources/particles.js

    r197910 r199134  
    1616        var randSize = Math.round(Math.pow(Pseudo.random(), 4) * this.sizeRange + this.sizeMinimum);
    1717        this.size = new Point(randSize, randSize);
    18         this.maxPosition = this.stage.size.subtract(this.size);
     18        this.minPosition = this.size.multiply(.5);
     19        this.maxPosition = this.stage.size.subtract(this.minPosition);
    1920    },
    2021
     
    3132                this.velocity.x *= -1;
    3233            this.position.x = this.maxPosition.x;
    33         } else if (this.position.x < 0) {
     34        } else if (this.position.x < this.minPosition.x) {
    3435            // If particle is going to move off left side
    3536            if (this.velocity.x < 0)
    3637                this.velocity.x *= -1;
    37             this.position.x = 0;
     38            this.position.x = this.minPosition.x;
    3839        }
    3940
     
    5152                this.position.y = this.maxPosition.y;
    5253            }
    53         } else if (this.position.y < 0) {
     54        } else if (this.position.y < this.minPosition.y) {
    5455            // If particle is going to move off top side
    5556            var magnitude = this.velocity.length();
     
    5859            if (this.velocity.y < 0)
    5960                this.velocity.y *= -0.998;
    60             this.position.y = 0;
     61            this.position.y = this.minPosition.y;
    6162        }
    6263
  • trunk/PerformanceTests/ChangeLog

    r198728 r199134  
     12016-04-06  Jon Lee  <jonlee@apple.com>
     2
     3        Update master benchmark with SVG test
     4        https://bugs.webkit.org/show_bug.cgi?id=156273
     5
     6        Reviewed by Dean Jackson.
     7        Provisionally reviewed by Said Abou-Hallawa.
     8
     9        Switch masks tests for SVG path test.
     10
     11        * Animometer/resources/debug-runner/tests.js: Move mask test here.
     12        * Animometer/resources/runner/tests.js: Add SVG test here.
     13        * Animometer/tests/dom/particles.html: Renamed from PerformanceTests/Animometer/tests/master/particles.html.
     14        * Animometer/tests/dom/resources/dom-particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/dom-particles.js.
     15
     16        * Animometer/tests/master/resources/particles.js: Add minPosition for bounds checking. Prevents particle from being
     17        partially obscured.
     18        * Animometer/tests/master/resources/svg-particles.js: Added.
     19        (Particle): The particle is either a path object or a rect using a path as a clip. The
     20        same path is used either way. For each particle create a linear gradient with a random
     21        rotation.
     22        (SVGParticlesStage): Look in #shapes to see how many different kinds of paths are available.
     23        This makes the test more generic in case other shapes need to be tested.
     24        * Animometer/tests/master/svg-particles.html: Added. Have two defs, one that houses each
     25        particle's gradient, and one that holds the shape templates.
     26
    1272016-03-27  Hunseop Jeong  <hs85.jeong@samsung.com>
    228
Note: See TracChangeset for help on using the changeset viewer.