Bug 100673 - [Qt] Animations jump when the page is suspended
Summary: [Qt] Animations jump when the page is suspended
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P3 Normal
Assignee: Noam Rosenthal
URL:
Keywords: Qt
Depends on: 100769
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-29 07:52 PDT by Jocelyn Turcotte
Modified: 2012-10-30 10:08 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.23 KB, patch)
2012-10-29 15:04 PDT, Noam Rosenthal
no flags Details | Formatted Diff | Diff
Patch (5.74 KB, patch)
2012-10-29 16:48 PDT, Noam Rosenthal
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Turcotte 2012-10-29 07:52:03 PDT
In the leaves and poster circle demos in MiniBrowser, starting to pan the page shows a completely out of sync frame while the page is suspended.
The animation resumes correctly at its previous position when the page is resumed.
Comment 1 Noam Rosenthal 2012-10-29 08:06:07 PDT
Are you looking at this, or should I?
Comment 2 Jocelyn Turcotte 2012-10-29 08:11:28 PDT
I didn't investigate yet, I'll do if you don't.
Comment 3 Noam Rosenthal 2012-10-29 08:32:13 PDT
I'll take a look today.
Comment 4 Noam Rosenthal 2012-10-29 15:04:05 PDT
Created attachment 171318 [details]
Patch
Comment 5 Rafael Brandao 2012-10-29 16:43:05 PDT
Comment on attachment 171318 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171318&action=review

I have a few comments. :-)

> Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp:265
> +void GraphicsLayerAnimation::pause(double pauseTime)

I think domTime/documentTime would make more clear what kind of time unit we expect here. Isn't "pauseTime" is already implicit?

> Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp:267
>      // FIXME: should apply offset here.

Do we need this comment?

> Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:811
> +    m_lastAnimationStartTime = WTF::currentTime() - timeOffset;

Is timeOffset the starting time for WebProcess? I still have to trouble to follow the logic of those offsets. :-(
Comment 6 Rafael Brandao 2012-10-29 16:44:01 PDT
Meh, sorry for all the typos on last message. :-(
Comment 7 Noam Rosenthal 2012-10-29 16:48:57 PDT
Created attachment 171336 [details]
Patch
Comment 8 Noam Rosenthal 2012-10-29 16:50:33 PDT
(In reply to comment #5)
> I think domTime/documentTime would make more clear what kind of time unit we expect here. Isn't "pauseTime" is already implicit?
Yes, it is :)

> > Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp:267
> >      // FIXME: should apply offset here.
> 
> Do we need this comment?
No, we don't :)

> 
> > Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:811
> > +    m_lastAnimationStartTime = WTF::currentTime() - timeOffset;
> 
> Is timeOffset the starting time for WebProcess? I still have to trouble to follow the logic of those offsets. :-(

These offsets are for animation delay. For some reason we receive them here as "negative delay" - it's the actual delay, but that time has already passed. I renamed it to delayAsNegativeTimeOffset, any better suggestion?
Comment 9 Rafael Brandao 2012-10-29 17:13:10 PDT
> > > Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:811
> > > +    m_lastAnimationStartTime = WTF::currentTime() - timeOffset;
> > 
> > Is timeOffset the starting time for WebProcess? I still have to trouble to follow the logic of those offsets. :-(
> 
> These offsets are for animation delay. For some reason we receive them here as "negative delay" - it's the actual delay, but that time has already passed. I renamed it to delayAsNegativeTimeOffset, any better suggestion?

Hmm, I think your suggestion sounds awesome! :-D
Comment 10 WebKit Review Bot 2012-10-30 07:11:48 PDT
Comment on attachment 171336 [details]
Patch

Clearing flags on attachment: 171336

Committed r132907: <http://trac.webkit.org/changeset/132907>
Comment 11 WebKit Review Bot 2012-10-30 07:11:52 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Csaba Osztrogonác 2012-10-30 10:08:28 PDT
(In reply to comment #10)
> (From update of attachment 171336 [details])
> Clearing flags on attachment: 171336
> 
> Committed r132907: <http://trac.webkit.org/changeset/132907>

It caused a regression - https://bugs.webkit.org/show_bug.cgi?id=100769
Could you check it please?