Disable flattening the stage iframe of the graphics benchmark when running on iOS
authorsaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Nov 2015 00:16:56 +0000 (00:16 +0000)
committersaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Nov 2015 00:16:56 +0000 (00:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151361

Reviewed by Simon Fraser.

Use fixed size for stage iframe of the graphics benchmark to disable
flattening the iframe while animating the particles. Also ensure the
bouncing particles do not go outside the iframe's boundaries.

* Animometer/runner/resources/animometer.css:
(section#running > #running-test > iframe):
(@media screen and (min-device-width: 1800px)):
* Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
(BouncingParticle.prototype.animate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192550 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/Animometer/runner/resources/animometer.css
PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-particles.js
PerformanceTests/ChangeLog

index 789ccd9..66b86e0 100644 (file)
@@ -328,9 +328,10 @@ section#running > #running-test {
 }
 
 section#running > #running-test > iframe {
-    width: 100%;
-    height: 100%;
+    width: 800px;
+    height: 600px;
     border: 0px none;
+    overflow: hidden;
 }
 
 section#running > #progress {
@@ -361,6 +362,13 @@ section#running > #record {
     padding: 16px;
 }
 
+@media screen and (min-device-width: 1800px) {
+    section#running > #running-test > iframe {
+        width: 1600px;
+        height: 800px;
+    }
+}
+
 /* -------------------------------------------------------------------------- */
 /*                           Results Section                                  */
 /* -------------------------------------------------------------------------- */
index a271e6a..d0f94ca 100644 (file)
@@ -23,36 +23,44 @@ BouncingParticle.prototype =
 
         // If particle is going to move off right side
         if (this._position.x + this._size.x > this._stageSize.x) {
-            // If direction is East-South
+            // If direction is East-South, go West-South.
             if (this._angle >= 0 && this._angle < Math.PI / 2)
                 this._angle = Math.PI - this._angle;
-            // If angle is East-North
+            // If angle is East-North, go West-North.
             else if (this._angle > Math.PI / 2 * 3)
                 this._angle = this._angle - (this._angle - Math.PI / 2 * 3) * 2;
+            // Make sure the particle does not go outside the stage boundaries.
+            this._position.x = this._stageSize.x - this._size.x;
         }
         
         // If particle is going to move off left side
         if (this._position.x < 0) {
-            // If angle is West-South
+            // If angle is West-South, go East-South.
             if (this._angle > Math.PI / 2 && this._angle < Math.PI)
                 this._angle = Math.PI - this._angle;
-            // If angle is West-North
+            // If angle is West-North, go East-North.
             else if (this._angle > Math.PI && this._angle < Math.PI / 2 * 3)
                 this._angle = this._angle + (Math.PI / 2 * 3 - this._angle) * 2;
+            // Make sure the particle does not go outside the stage boundaries.
+            this._position.x = 0;
         }
 
         // If particle is going to move off bottom side
         if (this._position.y + this._size.y > this._stageSize.y) {
-            // If direction is South
+            // If direction is South, go North.
             if (this._angle > 0 && this._angle < Math.PI)
                 this._angle = Math.PI * 2 - this._angle;
+            // Make sure the particle does not go outside the stage boundaries.
+            this._position.y = this._stageSize.y - this._size.y;
         }
 
         // If particle is going to move off top side
         if (this._position.y < 0) {
-            // If direction is North
+            // If direction is North, go South.
             if (this._angle > Math.PI && this._angle < Math.PI * 2)
                 this._angle = this._angle - (this._angle - Math.PI) * 2;
+            // Make sure the particle does not go outside the stage boundaries.
+            this._position.y = 0;
         }
     }
 }
index 413d2f7..54e5320 100644 (file)
@@ -1,5 +1,22 @@
 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
+        Disable flattening the stage iframe of the graphics benchmark when running on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=151361
+
+        Reviewed by Simon Fraser.
+        
+        Use fixed size for stage iframe of the graphics benchmark to disable
+        flattening the iframe while animating the particles. Also ensure the
+        bouncing particles do not go outside the iframe's boundaries.
+
+        * Animometer/runner/resources/animometer.css:
+        (section#running > #running-test > iframe):
+        (@media screen and (min-device-width: 1800px)):
+        * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
+        (BouncingParticle.prototype.animate):
+
+2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
         Use the media queries to dynamically set the stage for the graphics benchmark
         https://bugs.webkit.org/show_bug.cgi?id=151327