Simplify the test harness
[WebKit-https.git] / PerformanceTests / Animometer / tests / bouncing-particles / resources / bouncing-svg-images.js
1 (function() {
2
3 BouncingSvgImage = Utilities.createSubclass(BouncingSvgParticle,
4     function(stage)
5     {
6         BouncingSvgParticle.call(this, stage, "image");
7
8         var attrs = { x: 0, y: 0, width: this.size.x, height: this.size.y };
9         var xlinkAttrs = { href: stage.imageSrc };
10         this.element = DocumentExtension.createSvgElement("image", attrs, xlinkAttrs, stage.element);
11         this._move();
12     }
13 );
14
15 BouncingSvgImagesStage = Utilities.createSubclass(BouncingSvgParticlesStage,
16     function()
17     {
18         BouncingSvgParticlesStage.call(this);
19     }, {
20
21     initialize: function(benchmark)
22     {
23         BouncingSvgParticlesStage.prototype.initialize.call(this, benchmark);
24         this.imageSrc = benchmark.options["imageSrc"] || "resources/yin-yang.svg";
25     },
26
27     createParticle: function()
28     {
29         return new BouncingSvgImage(this);
30     }
31 });
32
33 BouncingSvgImagesBenchmark = Utilities.createSubclass(Benchmark,
34     function(options)
35     {
36         Benchmark.call(this, new BouncingSvgImagesStage(), options);
37     }
38 );
39
40 window.benchmarkClass = BouncingSvgImagesBenchmark;
41
42 })();
43