Bug 26544 - Transition animation fails to render correctly at http://www.ferretarmy.com/ (singular matrices)
Summary: Transition animation fails to render correctly at http://www.ferretarmy.com/ ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Chris Marrin
URL: http://www.ferretarmy.com/files/css-a...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-06-19 09:42 PDT by Chris Marrin
Modified: 2009-06-19 15:43 PDT (History)
0 users

See Also:


Attachments
Patch (2.32 KB, patch)
2009-06-19 09:45 PDT, Chris Marrin
simon.fraser: review-
Details | Formatted Diff | Diff
Replacement patch (8.90 KB, patch)
2009-06-19 13:53 PDT, Chris Marrin
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Marrin 2009-06-19 09:42:58 PDT
Transition animation fails to rendered correctly at http://www.ferretarmy.com/files/css-animation/test1/test1.html. Reproduces on TOT or Webkit nightly ( r44702) under SL 10A386 with a Mac Book Pro ( late 2008 )

* STEPS TO REPRODUCE
1. Launch TOT or Webkit nightly ( r44702) under SL 10A386
2. Go to http://www.ferretarmy.com/files/css-animation/test1/test1.html
3. Click on on page to start the animation.  The animation SHOULD display a series of green blocks falling and rotating slightly as they drop to bottom of browser window. Instead, you see the green blocks remain stationery on the page and scale to (0).
Comment 1 Chris Marrin 2009-06-19 09:45:59 PDT
Created attachment 31547 [details]
Patch
Comment 2 Simon Fraser (smfr) 2009-06-19 11:25:00 PDT
<rdar://problem/6978323>
Comment 3 Simon Fraser (smfr) 2009-06-19 11:50:26 PDT
Comment on attachment 31547 [details]
Patch

> Index: WebCore/platform/graphics/mac/GraphicsLayerCA.mm
> ===================================================================
> --- WebCore/platform/graphics/mac/GraphicsLayerCA.mm	(revision 44828)
> +++ WebCore/platform/graphics/mac/GraphicsLayerCA.mm	(working copy)
> @@ -981,6 +981,15 @@ bool GraphicsLayerCA::animateTransform(c
>                  if (isMatrixAnimation) {
>                      TransformationMatrix t;
>                      curValue.value()->apply(size, t);
> +                    
> +                    // If any matrix is singular, CA won't animate it correctly. So fall back to software animation
> +                    if (!t.isInvertible()) {
> +                        [timesArray release];
> +                        [valArray release];
> +                        [tfArray release];
> +                        return false;
> +                    }

Maybe use OwnPtrs for those arrays so we don't have to worry about releasing them?

Also, you can't return here without END_BLOCK_OBJC_EXCEPTIONS. I'd prefer a 'break' out of the loop, to avoid additional returns from this method.

>                      CATransform3D cat;
>                      copyTransform(cat, t);
>                      [valArray addObject:[NSValue valueWithCATransform3D:cat]];
> @@ -1004,6 +1013,12 @@ bool GraphicsLayerCA::animateTransform(c
>                  TransformationMatrix fromt, tot;
>                  valueList.at(0).value()->apply(size, fromt);
>                  valueList.at(1).value()->apply(size, tot);
> +
> +                // If any matrix is singular, CA won't animate it correctly. So fall back to software animation
> +                if (!fromt.isInvertible())
> +                    return false;
> +                if (!tot.isInvertible())
> +                    return false;

Same issue about returning without END_BLOCK_OBJC_EXCEPTIONS.
Comment 4 Chris Marrin 2009-06-19 13:53:26 PDT
Created attachment 31562 [details]
Replacement patch

Incorporates changes from review
Comment 5 Chris Marrin 2009-06-19 15:43:49 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/platform/graphics/mac/GraphicsLayerCA.mm
Transmitting file data ..
Committed revision 44878.