Bug 35520

Summary: [Qt] GraphicsLayer: matrix interpolations in transform-animations don't behave correctly
Product: WebKit Reporter: Noam Rosenthal <noam>
Component: New BugsAssignee: Noam Rosenthal <noam>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, kent.hansen
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Test page for testing transitions and animations with empty source list
none
Test page for testing animations and transitions with same sized but mismatching transform lists
none
Fixes animations behavior with AC to match non-AC in some special cases
eric: review-
Fixes the transform animations by correctly deciding whether to do matrix interpolation or not none

Description Noam Rosenthal 2010-03-01 03:53:27 PST
GraphicsLayer.h has an API that helps realizing whether AC should avoid taking control of the animation.
The Mac implementation, for example, avoids > 180 deg. rotations. Right now Qt tries to do those rotations anyway, and it doesn't look right.
Comment 1 Kim Grönholm 2010-03-03 01:56:41 PST
Created attachment 49889 [details]
Test page for testing transitions and animations with empty source list

The >180deg rotation animations don't work properly (meaning that they "take the shortest way") if the rotation is not interpolated as an angle value but as a transformation matrix. This also happens without AC. 

However, there were actually two bugs in determining whether to fall back to matrix interpolation in case of AC:
1. When the source transformation is empty, AC still falls to matrix interpolation even though it should not.
2. If the source and target transformationlists are of same size but mismatch, AC doesn't fall to matrix interpolation even though it should

Then there also was a bug in the actual interpolation of matrices (target matrix was not taken as is but first combined with source matrix).

I'll attach test cases for both situations and a patch to fix all the mentioned issues.
Comment 2 Kim Grönholm 2010-03-03 01:58:14 PST
Created attachment 49890 [details]
Test page for testing animations and transitions with same sized but mismatching transform lists
Comment 3 Kim Grönholm 2010-03-03 02:10:02 PST
Created attachment 49891 [details]
Fixes animations behavior with AC to match non-AC in some special cases

Submitted a patch that solves the issues making the test cases behave similarly with AC than without AC.
Comment 4 Tor Arne Vestbø 2010-03-05 09:39:49 PST
Please follow the QtWebKit bug reporting guidelines when reporting bugs.

See http://trac.webkit.org/wiki/QtWebKitBugs

Specifically:

  - The 'QtWebKit' component should be used for bugs/features in the public QtWebKit API layer, not to signify that the bug is specific to the Qt port of WebKit

    http://trac.webkit.org/wiki/QtWebKitBugs#Component
Comment 5 Eric Seidel (no email) 2010-03-05 15:14:47 PST
Comment on attachment 49891 [details]
Fixes animations behavior with AC to match non-AC in some special cases

Needs a test.
Comment 6 Noam Rosenthal 2010-03-16 13:58:34 PDT
This is a good test for >180 degree rotations: http://qt.gitorious.org/qt-labs/scxml/blobs/raw/statechartz/statechartz/demo.html

We should test if the patch fixes this site, and doesn't regress anything else.
Comment 7 Kim Grönholm 2010-03-18 00:04:59 PDT
Created attachment 51010 [details]
Fixes the transform animations by correctly deciding whether to do matrix interpolation or not
Comment 8 Noam Rosenthal 2010-03-18 00:49:24 PDT
Signed of by /me :)
Comment 9 Simon Hausmann 2010-03-21 15:13:26 PDT
Comment on attachment 51010 [details]
Fixes the transform animations by correctly deciding whether to do matrix interpolation or not

You might consider using WebCore/manual-tests or manual-tests/qt for manual tests.

But we _really_ need layout tests for this code.
Comment 10 WebKit Commit Bot 2010-03-21 15:53:02 PDT
Comment on attachment 51010 [details]
Fixes the transform animations by correctly deciding whether to do matrix interpolation or not

Clearing flags on attachment: 51010

Committed r56321: <http://trac.webkit.org/changeset/56321>
Comment 11 WebKit Commit Bot 2010-03-21 15:53:06 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Kenneth Rohde Christiansen 2010-03-21 17:13:19 PDT
Comment on attachment 51010 [details]
Fixes the transform animations by correctly deciding whether to do matrix interpolation or not


> +                else
> +                    for (size_t j = 0; j < sourceOperationCount && validTransformLists; ++j)
> +                        if (!sourceOperations.operations()[j]->isSameType(*targetOperations.operations()[j]))
> +                            validTransformLists = false;

Simon the patch you reviewed has wrong coding style.

The else and for has contents that spans multiple real lines in total. Both the else and the for should use braces. The if doesn't not need braces, thus it is correct.
Comment 13 Noam Rosenthal 2010-03-21 19:49:39 PDT
ah, right Kenneth.
Should I submit a style-fix patch for that and a few other style issues?