Title: [198612] trunk/PerformanceTests
Revision
198612
Author
[email protected]
Date
2016-03-23 19:40:36 -0700 (Wed, 23 Mar 2016)

Log Message

Update focus and leaves tests
https://bugs.webkit.org/show_bug.cgi?id=155825

Reviewed by Simon Fraser.

Particles would improperly disappear, before they were fully off stage. Update the calculation.
* Animometer/tests/dom/resources/leaves.js:
* Animometer/tests/master/resources/leaves.js:

* Animometer/tests/master/focus.html: Update the center element styling.
* Animometer/tests/master/resources/focus.js:
(FocusElement.Utilities.createClass): Give enough space in the container for each particle for the blur
to spread. It should be about 3x more space than the blur radius on each side.
(Stage.call.initialize): Ditto for the center element.

Modified Paths

Diff

Modified: trunk/PerformanceTests/Animometer/tests/dom/resources/leaves.js (198611 => 198612)


--- trunk/PerformanceTests/Animometer/tests/dom/resources/leaves.js	2016-03-24 02:40:03 UTC (rev 198611)
+++ trunk/PerformanceTests/Animometer/tests/dom/resources/leaves.js	2016-03-24 02:40:36 UTC (rev 198612)
@@ -32,11 +32,11 @@
         if (this._opacity > 1) {
             this._opacity = 1;
             this._opacityRate *= -1;
-        } else if (this._opacity < 0 || this._position.y > this.stage.size.y)
+        } else if (this._opacity < 0 || this._position.y > this.stage.size.height)
             this.reset();
 
-        if (this._position.x < -this.size.width || this._position.x > this.maxPosition.x)
-            this._position.x = (this._position.x + this.maxPosition.x) % this.maxPosition.x;
+        if (this._position.x < -this.size.width || this._position.x > this.stage.size.width)
+            this._position.x = this._position.x - Math.sign(this._position.x) * (this.size.width + this.stage.size.width);
         this.move();
     },
 

Modified: trunk/PerformanceTests/Animometer/tests/master/focus.html (198611 => 198612)


--- trunk/PerformanceTests/Animometer/tests/master/focus.html	2016-03-24 02:40:03 UTC (rev 198611)
+++ trunk/PerformanceTests/Animometer/tests/master/focus.html	2016-03-24 02:40:36 UTC (rev 198612)
@@ -20,14 +20,18 @@
         border-radius: 50%;
     }
 
+    #center-text {
+        transform: translate3d(-50%, -50%, 0);
+    }
+
     #center-text span {
+        position: absolute;
         color: #201A1F;
         font-weight: 400;
         font-size: 2em;
-        position: absolute;
         top: 50%;
         left: 50%;
-        transform: translate3d(-50%, -50%, 0);
+        transform: translate(-50%, -50%);
     }
 
     </style>

Modified: trunk/PerformanceTests/Animometer/tests/master/resources/focus.js (198611 => 198612)


--- trunk/PerformanceTests/Animometer/tests/master/resources/focus.js	2016-03-24 02:40:03 UTC (rev 198611)
+++ trunk/PerformanceTests/Animometer/tests/master/resources/focus.js	2016-03-24 02:40:36 UTC (rev 198612)
@@ -24,8 +24,8 @@
         var size = 2 * radius + sizeVariance - distance;
 
         this.container = document.createElement('div');
-        this.container.style.width = (size + stage.maxBlurValue * 2) + "px";
-        this.container.style.height = (size + stage.maxBlurValue * 2) + "px";
+        this.container.style.width = (size + stage.maxBlurValue * 6) + "px";
+        this.container.style.height = (size + stage.maxBlurValue * 6) + "px";
         this.container.style.top = top + "px";
         this.container.style.left = left + "px";
         this.container.style.zIndex = Math.round((1 - this._depth) * 10);
@@ -33,8 +33,9 @@
         var particle = Utilities.createElement("div", {}, this.container);
         particle.style.width = size + "px";
         particle.style.height = size + "px";
-        particle.style.top = stage.maxBlurValue + "px";
-        particle.style.left = stage.maxBlurValue + "px";
+        particle.style.top = (stage.maxBlurValue * 3) + "px";
+        particle.style.left = (stage.maxBlurValue * 3) + "px";
+        this.particle = particle;
 
         var depthMultiplier = Utilities.lerp(1 - this._depth, 0.8, 1);
         this._sinMultiplier = Pseudo.random() * Stage.randomSign() * depthMultiplier;
@@ -85,15 +86,15 @@
         this._offsetIndex = 0;
 
         this._centerElement = document.getElementById("center-text");
-        this._centerElement.style.width = (centerDiameter + this.maxCenterObjectBlurValue * 2) + "px";
-        this._centerElement.style.height = (centerDiameter + this.maxCenterObjectBlurValue * 2) + "px";
+        this._centerElement.style.width = (centerDiameter + this.maxCenterObjectBlurValue * 6) + "px";
+        this._centerElement.style.height = (centerDiameter + this.maxCenterObjectBlurValue * 6) + "px";
         this._centerElement.style.zIndex = Math.round(10 * this.centerObjectDepth);
 
         var particle = document.querySelector("#center-text div");
         particle.style.width = centerDiameter + "px";
         particle.style.height = centerDiameter + "px";
-        particle.style.top = this.maxCenterObjectBlurValue + "px";
-        particle.style.left = this.maxCenterObjectBlurValue + "px";
+        particle.style.top = (this.maxCenterObjectBlurValue * 3) + "px";
+        particle.style.left = (this.maxCenterObjectBlurValue * 3) + "px";
 
         var blur = this.getBlurValue(this.centerObjectDepth, true);
         Utilities.setElementPrefixedProperty(this._centerElement, "filter", "blur(" + blur + "px)");

Modified: trunk/PerformanceTests/Animometer/tests/master/resources/leaves.js (198611 => 198612)


--- trunk/PerformanceTests/Animometer/tests/master/resources/leaves.js	2016-03-24 02:40:03 UTC (rev 198611)
+++ trunk/PerformanceTests/Animometer/tests/master/resources/leaves.js	2016-03-24 02:40:36 UTC (rev 198612)
@@ -30,11 +30,11 @@
         this._position.y += this._velocity.y;
 
         this._life--;
-        if (!this._life || this._position.y > this.stage.size.y)
+        if (!this._life || this._position.y > this.stage.size.height)
             this.reset();
 
-        if (this._position.x < -this.size.width || this._position.x > this.maxPosition.x)
-            this._position.x = (this._position.x + this.maxPosition.x) % this.maxPosition.x;
+        if (this._position.x < -this.size.width || this._position.x > this.stage.size.width)
+            this._position.x = this._position.x - Math.sign(this._position.x) * (this.size.width + this.stage.size.width);
         this.move();
     },
 

Modified: trunk/PerformanceTests/ChangeLog (198611 => 198612)


--- trunk/PerformanceTests/ChangeLog	2016-03-24 02:40:03 UTC (rev 198611)
+++ trunk/PerformanceTests/ChangeLog	2016-03-24 02:40:36 UTC (rev 198612)
@@ -1,5 +1,22 @@
 2016-03-23  Jon Lee  <[email protected]>
 
+        Update focus and leaves tests
+        https://bugs.webkit.org/show_bug.cgi?id=155825
+
+        Reviewed by Simon Fraser.
+
+        Particles would improperly disappear, before they were fully off stage. Update the calculation.
+        * Animometer/tests/dom/resources/leaves.js:
+        * Animometer/tests/master/resources/leaves.js:
+
+        * Animometer/tests/master/focus.html: Update the center element styling.
+        * Animometer/tests/master/resources/focus.js:
+        (FocusElement.Utilities.createClass): Give enough space in the container for each particle for the blur
+        to spread. It should be about 3x more space than the blur radius on each side.
+        (Stage.call.initialize): Ditto for the center element.
+
+2016-03-23  Jon Lee  <[email protected]>
+
         Update support for other platforms
         https://bugs.webkit.org/show_bug.cgi?id=155824
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to