Title: [270801] trunk
Revision
270801
Author
[email protected]
Date
2020-12-14 12:55:27 -0800 (Mon, 14 Dec 2020)

Log Message

Simplify transform blending for simple cases
https://bugs.webkit.org/show_bug.cgi?id=219863

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Rebaseline some WPT test outputs, resulting in round numbers for animated transform output, including a few new PASS results.

* web-platform-tests/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt:
* web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:

Source/WebCore:

Optimize two simple cases for transform blending. First, use matrices as-is for the cases when we blend with
progress equal to 0 or 1. Then, when rotating around an angle that's an increment of 360º, simply return the
existing matrix.

* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::rotate):
(WebCore::TransformationMatrix::blend):

LayoutTests:

Rebaselining test output where -0 values are now +0.

* compositing/backing/animate-into-view-expected.txt:
* compositing/backing/animate-into-view-with-descendant-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (270800 => 270801)


--- trunk/LayoutTests/ChangeLog	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/ChangeLog	2020-12-14 20:55:27 UTC (rev 270801)
@@ -1,3 +1,15 @@
+2020-12-14  Antoine Quint  <[email protected]>
+
+        Simplify transform blending for simple cases
+        https://bugs.webkit.org/show_bug.cgi?id=219863
+
+        Reviewed by Simon Fraser.
+
+        Rebaselining test output where -0 values are now +0.
+
+        * compositing/backing/animate-into-view-expected.txt:
+        * compositing/backing/animate-into-view-with-descendant-expected.txt:
+
 2020-12-14  Youenn Fablet  <[email protected]>
 
         LayoutTests/webrtc/video-sframe.html is flaky on bots

Modified: trunk/LayoutTests/compositing/backing/animate-into-view-expected.txt (270800 => 270801)


--- trunk/LayoutTests/compositing/backing/animate-into-view-expected.txt	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/compositing/backing/animate-into-view-expected.txt	2020-12-14 20:55:27 UTC (rev 270801)
@@ -15,7 +15,7 @@
           (bounds 10.00 31.00)
           (drawsContent 1)
           (backingStoreAttached 1)
-          (transform [1.50 -0.00 0.00 0.00] [0.00 0.50 0.00 0.00] [0.00 0.00 1.00 0.00] [-565.25 7.75 0.00 1.00])
+          (transform [1.50 0.00 0.00 0.00] [0.00 0.50 0.00 0.00] [0.00 0.00 1.00 0.00] [-565.25 7.75 0.00 1.00])
         )
       )
     )

Modified: trunk/LayoutTests/compositing/backing/animate-into-view-with-descendant-expected.txt (270800 => 270801)


--- trunk/LayoutTests/compositing/backing/animate-into-view-with-descendant-expected.txt	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/compositing/backing/animate-into-view-with-descendant-expected.txt	2020-12-14 20:55:27 UTC (rev 270801)
@@ -13,7 +13,7 @@
           (position 503.00 66.00)
           (bounds 20.00 20.00)
           (backingStoreAttached 1)
-          (transform [1.50 -0.00 0.00 0.00] [0.00 0.50 0.00 0.00] [0.00 0.00 1.00 0.00] [-565.25 7.75 0.00 1.00])
+          (transform [1.50 0.00 0.00 0.00] [0.00 0.50 0.00 0.00] [0.00 0.00 1.00 0.00] [-565.25 7.75 0.00 1.00])
           (children 1
             (GraphicsLayer
               (anchor 0.50 0.52)

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (270800 => 270801)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-12-14 20:55:27 UTC (rev 270801)
@@ -1,3 +1,18 @@
+2020-12-14  Antoine Quint  <[email protected]>
+
+        Simplify transform blending for simple cases
+        https://bugs.webkit.org/show_bug.cgi?id=219863
+
+        Reviewed by Simon Fraser.
+
+        Rebaseline some WPT test outputs, resulting in round numbers for animated transform output, including a few new PASS results.
+
+        * web-platform-tests/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt:
+        * web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
+        * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
+        * web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:
+
 2020-12-12  Frank Olivier  <[email protected]>
 
         Implement WebVTT VTTCue region attribute

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt (270800 => 270801)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt	2020-12-14 20:55:27 UTC (rev 270801)
@@ -10,7 +10,7 @@
 FAIL Interpolation between translateY(0%) and translateX(50%) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translate(25%, 0px)" but got "matrix(1, 0, 0, 1, 0, 0)"
 FAIL Interpolation between translateX(50px) and translateY(50px) gives the correct computed value halfway according to computedStyleMap. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between translateX(50px) and translateY(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
-FAIL Interpolation between translateX(50px) and translateY(50px) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translate(25px, 25px)" but got "matrix(1, -2.4492935982947064e-16, 2.4492935982947064e-16, 1, 25, 25)"
+FAIL Interpolation between translateX(50px) and translateY(50px) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translate(25px, 25px)" but got "matrix(1, 0, 0, 1, 25, 25)"
 FAIL Interpolation between translateX(50px) and translateZ(50px) gives the correct computed value halfway according to computedStyleMap. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between translateX(50px) and translateZ(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between translateX(50px) and translateZ(50px) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translate3d(25px, 0px, 25px)" but got "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 25, 0, 25, 1)"
@@ -52,13 +52,13 @@
 FAIL Interpolation between scaleZ(1) and scaleZ(2) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scaleZ(1.5)" but got "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 1)"
 FAIL Interpolation between scaleX(2) and scaleY(2) gives the correct computed value halfway according to computedStyleMap. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between scaleX(2) and scaleY(2) gives the correct computed value halfway according to computedStyleMap with zoom active. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
-FAIL Interpolation between scaleX(2) and scaleY(2) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale(1.5)" but got "matrix(1.5, -3.6739403974420594e-16, 3.6739403974420594e-16, 1.5, 0, 0)"
+FAIL Interpolation between scaleX(2) and scaleY(2) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale(1.5)" but got "matrix(1.5, 0, 0, 1.5, 0, 0)"
 FAIL Interpolation between scaleX(2) and scaleY(3) gives the correct computed value halfway according to computedStyleMap. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between scaleX(2) and scaleY(3) gives the correct computed value halfway according to computedStyleMap with zoom active. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
-FAIL Interpolation between scaleX(2) and scaleY(3) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale(1.5, 2)" but got "matrix(1.5, -3.6739403974420594e-16, 4.898587196589413e-16, 2, 0, 0)"
+FAIL Interpolation between scaleX(2) and scaleY(3) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale(1.5, 2)" but got "matrix(1.5, 0, 0, 2, 0, 0)"
 FAIL Interpolation between scaleZ(1) and scale(2) gives the correct computed value halfway according to computedStyleMap. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between scaleZ(1) and scale(2) gives the correct computed value halfway according to computedStyleMap with zoom active. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
-FAIL Interpolation between scaleZ(1) and scale(2) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale3d(1.5, 1.5, 1)" but got "matrix(1.5, -3.6739403974420594e-16, 3.6739403974420594e-16, 1.5, 0, 0)"
+FAIL Interpolation between scaleZ(1) and scale(2) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale3d(1.5, 1.5, 1)" but got "matrix(1.5, 0, 0, 1.5, 0, 0)"
 FAIL Interpolation between scale(1, 2) and scale(3, 4) gives the correct computed value halfway according to computedStyleMap. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between scale(1, 2) and scale(3, 4) gives the correct computed value halfway according to computedStyleMap with zoom active. div.computedStyleMap is not a function. (In 'div.computedStyleMap()', 'div.computedStyleMap' is undefined)
 FAIL Interpolation between scale(1, 2) and scale(3, 4) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale(2, 3)" but got "matrix(2, 0, 0, 3, 0, 0)"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt (270800 => 270801)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt	2020-12-14 20:55:27 UTC (rev 270801)
@@ -21,7 +21,7 @@
 FAIL Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from add [matrix(1, 0, 0, 1, 100, 0)] to add [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(1, 1, 0, 0, 200, 300)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 200 , 300 ) " but got "matrix ( 1 , 0 , 0 , 1 , 200 , 0 ) "
 FAIL Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from add [matrix(1, 0, 0, 1, 100, 0)] to add [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(1, 1, 0, 0, 200, 300)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 200 , 300 ) " but got "matrix ( 1 , 0 , 0 , 1 , 250 , 0 ) "
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (-0.5) should be [matrix(1, 1, 0, 0, 100, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 100 , 100 ) " but got "matrix ( 1.28 , 0.84 , - 0.03 , 0.3 , 87.5 , - 37.5 ) "
-FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(1, 1, 0, 0, 100, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 100 , 100 ) " but got "matrix ( 1 , 1 , 0 , 0 , 50 , 50 ) "
+FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(1, 1, 0, 0, 100, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 100 , 100 ) " but got "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) "
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (0.25) should be [matrix(1, 1, 0, 0, 100, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 100 , 100 ) " but got "matrix ( 0.95 , 0.86 , - 0.01 , 0.08 , 59.37 , 65.62 ) "
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (0.5) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.95 , 0.63 , - 0.03 , 0.3 , 87.5 , 62.5 ) "
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (0.75) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.97 , 0.32 , - 0.04 , 0.63 , 134.38 , 40.63 ) "
@@ -49,7 +49,7 @@
 PASS Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(1, 0, 0, 1, 200, 0)]
 PASS Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(1, 0, 0, 1, 250, 0)]
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (-0.5) should be [matrix(1, 1, 0, 0, 0, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) " but got "matrix ( 1.28 , 0.84 , - 0.03 , 0.3 , 87.5 , - 37.5 ) "
-FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(1, 1, 0, 0, 0, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) " but got "matrix ( 1 , 1 , 0 , 0 , 50 , 50 ) "
+PASS Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(1, 1, 0, 0, 0, 100)]
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.25) should be [matrix(1, 1, 0, 0, 0, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) " but got "matrix ( 0.95 , 0.86 , - 0.01 , 0.08 , 59.37 , 65.62 ) "
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.5) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.95 , 0.63 , - 0.03 , 0.3 , 87.5 , 62.5 ) "
 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.75) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.97 , 0.32 , - 0.04 , 0.63 , 134.38 , 40.63 ) "

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt (270800 => 270801)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt	2020-12-14 20:55:27 UTC (rev 270801)
@@ -154,11 +154,11 @@
 FAIL transform: rotate3d assert_approx_equals: expected matrix3d(0.853553, 0.146447, 0.5, 0, 0.146447, 0.853553, -0.5, 0, -0.5, 0.5, 0.707107, 0, 0, 0, 0, 1) but got matrix3d(0.5, 0.5, 0.707107, 0, 0.5, 0.5, -0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 0, 0, 1): The value should be matrix3d(0.853553, 0.146447, 0.5, 0, 0.146447, 0.853553, -0.5, 0, -0.5, 0.5, 0.707107, 0, 0, 0, 0, 1) at 0ms but got matrix3d(0.5, 0.5, 0.707107, 0, 0.5, 0.5, -0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 0, 0, 1) expected 0.853553 +/- 0.0001 but got 0.5
 FAIL transform: matrix3d assert_approx_equals: expected matrix3d(0.853553, 0.146447, 0.5, 0, 0.146447, 0.853553, -0.5, 0, -0.5, 0.5, 0.707107, 0, 0, 0, 0, 1) but got matrix3d(0.5, 0.5, 0.707107, 0, 0.5, 0.5, -0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 0, 0, 1): The value should be matrix3d(0.853553, 0.146447, 0.5, 0, 0.146447, 0.853553, -0.5, 0, -0.5, 0.5, 0.707107, 0, 0, 0, 0, 1) at 0ms but got matrix3d(0.5, 0.5, 0.707107, 0, 0.5, 0.5, -0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 0, 0, 1) expected 0.853553 +/- 0.0001 but got 0.5
 FAIL transform: none assert_equals: dimension of the matrix: The value should be matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1) at 0ms but got matrix(1, 0, 0, 1, 0, 0) expected 16 but got 6
-FAIL transform: non-invertible matrices (non-invertible onto invertible) assert_approx_equals: expected matrix(1, 1, 0, 0, 0, 100) but got matrix(1, 1, 0, 0, 50, 50): The value should be matrix(1, 1, 0, 0, 0, 100) at 0ms but got matrix(1, 1, 0, 0, 50, 50) expected 0 +/- 0.0001 but got 50
+PASS transform: non-invertible matrices (non-invertible onto invertible)
 PASS transform: non-invertible matrices (invertible onto non-invertible)
-FAIL transform: non-invertible matrices in matched transform lists (non-invertible onto invertible) assert_approx_equals: expected matrix(-1, -1, 0, 0, 100, 100) but got matrix(-1, -1, 0, 0, 150, 50): The value should be matrix(-1, -1, 0, 0, 100, 100) at 0ms but got matrix(-1, -1, 0, 0, 150, 50) expected 100 +/- 0.0001 but got 150
+PASS transform: non-invertible matrices in matched transform lists (non-invertible onto invertible)
 PASS transform: non-invertible matrices in matched transform lists (invertible onto non-invertible)
-FAIL transform: non-invertible matrices in mismatched transform lists (non-invertible onto invertible) assert_approx_equals: expected matrix(1, 1, 1, 1, 100, 100) but got matrix(1, 1, 1, 1, 150, 50): The value should be matrix(1, 1, 1, 1, 100, 100) at 0ms but got matrix(1, 1, 1, 1, 150, 50) expected 100 +/- 0.0001 but got 150
+PASS transform: non-invertible matrices in mismatched transform lists (non-invertible onto invertible)
 PASS transform: non-invertible matrices in mismatched transform lists (invertible onto non-invertible)
 PASS transform-box (type: discrete) has testAccumulation function
 PASS transform-box: "border-box" onto "fill-box"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt (270800 => 270801)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt	2020-12-14 20:55:27 UTC (rev 270801)
@@ -22,9 +22,9 @@
 FAIL iteration composition of transform: [ scale(1), scale(2) ] animation assert_approx_equals: expected matrix(3, 0, 0, 3, 0, 0) but got matrix(1, 0, 0, 1, 0, 0): Animated transform(scale) style at 0s of the third iteration expected 3 +/- 0.0001 but got 1
 FAIL iteration composition of transform: scale(2) animation assert_approx_equals: expected matrix(2, 0, 0, 2, 0, 0) but got matrix(0, 0, 0, 0, 0, 0): Animated transform(scale) style at 0s of the third iteration expected 2 +/- 0.0001 but got 0
 FAIL iteration composition of transform list animation assert_approx_equals: expected matrix(1, 0, 0, 1, 20, 0) but got matrix(1, 0, 0, 1, 0, 0): Animated transform list at 0s of the third iteration expected 20 +/- 0.0001 but got 0
-FAIL iteration composition of transform of matrix function assert_approx_equals: expected matrix(6, 0, 0, 6, 60, 0) but got matrix(2, -4.898587196589413e-16, 4.898587196589413e-16, 2, 0, 0): Animated transform of matrix function at 0s of the third iteration expected 6 +/- 0.0001 but got 2
-FAIL iteration composition of transform list animation whose order is mismatched assert_approx_equals: expected matrix(6, 0, 0, 6, 60, 0) but got matrix(2, -4.898587196589413e-16, 4.898587196589413e-16, 2, 0, 0): Animated transform list at 0s of the third iteration expected 6 +/- 0.0001 but got 2
-FAIL iteration composition of transform list animation whose order is mismatched because of missing functions assert_approx_equals: expected matrix(3, 0, 0, 3, 40, 0) but got matrix(1, -2.4492935982947064e-16, 2.4492935982947064e-16, 1, 0, 0): Animated transform list at 0s of the third iteration expected 3 +/- 0.0001 but got 1
+FAIL iteration composition of transform of matrix function assert_approx_equals: expected matrix(6, 0, 0, 6, 60, 0) but got matrix(2, 0, 0, 2, 0, 0): Animated transform of matrix function at 0s of the third iteration expected 6 +/- 0.0001 but got 2
+FAIL iteration composition of transform list animation whose order is mismatched assert_approx_equals: expected matrix(6, 0, 0, 6, 60, 0) but got matrix(2, 0, 0, 2, 0, 0): Animated transform list at 0s of the third iteration expected 6 +/- 0.0001 but got 2
+FAIL iteration composition of transform list animation whose order is mismatched because of missing functions assert_approx_equals: expected matrix(3, 0, 0, 3, 40, 0) but got matrix(1, 0, 0, 1, 0, 0): Animated transform list at 0s of the third iteration expected 3 +/- 0.0001 but got 1
 FAIL iteration composition of transform from none to translate assert_approx_equals: expected matrix(1, 0, 0, 1, 20, 0) but got matrix(1, 0, 0, 1, 0, 0): Animated transform list at 0s of the third iteration expected 20 +/- 0.0001 but got 0
 FAIL iteration composition of transform of matrix3d function assert_approx_equals: expected matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 130, 1) but got matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 30, 1): Animated transform of matrix3d function at 0s of the third iteration expected 130 +/- 0.0001 but got 30
 FAIL iteration composition of transform of rotate3d function assert_equals: dimension of the matrix: Animated transform of rotate3d function at 0s of the third iteration expected 16 but got 6

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt (270800 => 270801)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt	2020-12-14 20:55:27 UTC (rev 270801)
@@ -11,7 +11,7 @@
 FAIL Commits relative line-height assert_equals: line-height is committed as a relative value expected "1.5" but got "15px"
 PASS Commits transforms
 FAIL Commits transforms as a transform list assert_equals: expected "translate(20px, 20px)" but got "matrix(1, 0, 0, 1, 20, 20)"
-FAIL Commits matrix-interpolated relative transforms assert_equals: Resolved transform is correct after commit. expected "matrix(2, 0, 0, 2, 100, 0)" but got "matrix(2, -4.898587196589413e-16, 4.898587196589413e-16, 2, 0, 0)"
+FAIL Commits matrix-interpolated relative transforms assert_equals: Resolved transform is correct after commit. expected "matrix(2, 0, 0, 2, 100, 0)" but got "matrix(2, 0, 0, 2, 0, 0)"
 FAIL Commits "none" transform assert_equals: Resolved transform is correct after commit. expected "none" but got "matrix(1, 0, 0, 1, 0, 0)"
 FAIL Commits the intermediate value of an animation in the middle of stack assert_approx_equals: expected 0.4 +/- 0.0001 but got 0.20000000298023224
 FAIL Commit composites on top of the underlying value assert_approx_equals: expected 0.5 +/- 0.0001 but got 0.20000000298023224

Modified: trunk/Source/WebCore/ChangeLog (270800 => 270801)


--- trunk/Source/WebCore/ChangeLog	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/Source/WebCore/ChangeLog	2020-12-14 20:55:27 UTC (rev 270801)
@@ -1,3 +1,18 @@
+2020-12-14  Antoine Quint  <[email protected]>
+
+        Simplify transform blending for simple cases
+        https://bugs.webkit.org/show_bug.cgi?id=219863
+
+        Reviewed by Simon Fraser.
+
+        Optimize two simple cases for transform blending. First, use matrices as-is for the cases when we blend with
+        progress equal to 0 or 1. Then, when rotating around an angle that's an increment of 360º, simply return the
+        existing matrix.
+
+        * platform/graphics/transforms/TransformationMatrix.cpp:
+        (WebCore::TransformationMatrix::rotate):
+        (WebCore::TransformationMatrix::blend):
+
 2020-12-14  Wenson Hsieh  <[email protected]>
 
         GPU process sometimes hangs during MotionMark Focus when enabling GPU Process for DOM

Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp (270800 => 270801)


--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp	2020-12-14 20:43:40 UTC (rev 270800)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp	2020-12-14 20:55:27 UTC (rev 270801)
@@ -949,6 +949,9 @@
 
 TransformationMatrix& TransformationMatrix::rotate(double angle)
 {
+    if (!std::fmod(angle, 360))
+        return *this;
+
     angle = deg2rad(angle);
     double sinZ = sin(angle);
     double cosZ = cos(angle);
@@ -1665,6 +1668,14 @@
 
 void TransformationMatrix::blend(const TransformationMatrix& from, double progress)
 {
+    if (!progress) {
+        *this = from;
+        return;
+    }
+
+    if (progress == 1)
+        return;
+
     if (from.isIdentity() && isIdentity())
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to