]
));
-Suites.push(new Suite("Test Templates",
+Suites.push(new Suite("Miscellaneous Tests",
[
{
- url: "template/template-css.html",
- name: "CSS template"
- },
- {
- url: "template/template-canvas.html",
- name: "canvas template"
- },
- {
- url: "template/template-svg.html",
- name: "SVG template"
+ url: "misc/compositing-transforms.html?particleWidth=50&particleHeight=50&filters=yes&imageSrc=../resources/yin-yang.svg",
+ name: "Composited Transforms"
},
]
));
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ img {
+ position: absolute;
+ width: 80px;
+ height: 80px;
+ }
+ </style>
+ <link rel="stylesheet" type="text/css" href="../resources/stage.css">
+ <script src="../../resources/algorithm.js"></script>
+ <script src="../../resources/strings.js"></script>
+ <script src="../../resources/sampler.js"></script>
+ <script src="../../resources/extensions.js"></script>
+ <script src="../resources/math.js"></script>
+ <script src="../resources/utilities.js"></script>
+ <script src="../resources/main.js"></script>
+ <script src="../resources/stage.js"></script>
+ <script src="../bouncing-particles/resources/bouncing-particles.js"></script>
+ <script src="resources/compositing-transforms.js"></script>
+</head>
+<body>
+ <div id="stage"></div>
+</body>
+</html>
--- /dev/null
+function BouncingCompositedImage(stage)
+{
+ BouncingParticle.call(this, stage);
+
+ this.element = document.createElement("img");
+ this.element.style.width = this._size.x + "px";
+ this.element.style.height = this._size.y + "px";
+ this.element.setAttribute("src", stage.imageSrc);
+
+ if (stage.useFilters)
+ this.element.style.filter = "hue-rotate(" + stage.randomAngle() + "rad)";
+
+ stage.element.appendChild(this.element);
+ this._move();
+}
+
+BouncingCompositedImage.prototype = Object.create(BouncingParticle.prototype);
+BouncingCompositedImage.prototype.constructor = BouncingCompositedImage;
+
+BouncingCompositedImage.prototype._move = function()
+{
+ this.element.style.transform = "translate3d(" + this._position.x + "px," + this._position.y + "px, 0) " + this._rotater.rotateZ();
+}
+
+BouncingCompositedImage.prototype.animate = function(timeDelta)
+{
+ BouncingParticle.prototype.animate.call(this, timeDelta);
+ this._move();
+}
+
+function CompositingTransformsStage(element, options)
+{
+ BouncingParticlesStage.call(this, element, options);
+ this.imageSrc = options["imageSrc"] || "../resources/yin-yang.svg";
+ this.useFilters = options["filters"] == "yes";
+}
+
+CompositingTransformsStage.prototype = Object.create(BouncingParticlesStage.prototype);
+CompositingTransformsStage.prototype.constructor = CompositingTransformsStage;
+
+CompositingTransformsStage.prototype.createParticle = function()
+{
+ return new BouncingCompositedImage(this);
+}
+
+CompositingTransformsStage.prototype.particleWillBeRemoved = function(particle)
+{
+ particle.element.remove();
+}
+
+function CompositedTransformsBenchmark(suite, test, options, recordTable, progressBar)
+{
+ BouncingParticlesBenchmark.call(this, suite, test, options, recordTable, progressBar);
+}
+
+CompositedTransformsBenchmark.prototype = Object.create(BouncingParticlesBenchmark.prototype);
+CompositedTransformsBenchmark.prototype.constructor = CompositedTransformsBenchmark;
+
+CompositedTransformsBenchmark.prototype.createStage = function(element)
+{
+ return new CompositingTransformsStage(element, this._options);
+}
+
+window.benchmarkClient.create = function(suite, test, options, recordTable, progressBar)
+{
+ return new CompositedTransformsBenchmark(suite, test, options, recordTable, progressBar);
+}
+2015-12-01 Simon Fraser <simon.fraser@apple.com>
+
+ Add a basic compositing Animometer test
+ https://bugs.webkit.org/show_bug.cgi?id=151724
+
+ Reviewed by Dean Jackson.
+
+ Add a "bouncing particles" test that moves composited layers around, optionally with a filter.
+
+ This is added under a new "Miscellaneous" category.
+
+ Remove the test templates category from the UI.
+
+ * Animometer/runner/resources/tests.js:
+ * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
+ (BouncingCssShape.prototype.animate):
+ * Animometer/tests/misc/compositing-transforms.html: Added.
+ * Animometer/tests/misc/resources/compositing-transforms.js: Added.
+ (BouncingCompositedImage):
+ (BouncingCompositedImage.prototype._move):
+ (BouncingCompositedImage.prototype.animate):
+ (CompositingTransformsStage):
+ (CompositingTransformsStage.prototype.createParticle):
+ (CompositingTransformsStage.prototype.particleWillBeRemoved):
+ (CompositedTransformsBenchmark):
+ (CompositedTransformsBenchmark.prototype.createStage):
+ (window.benchmarkClient.create):
+
2015-11-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Fix the graphics benchmark complexity bounds adjustment