Bug 106594 - [chromium] Register newly-created layers for animation
Summary: [chromium] Register newly-created layers for animation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-10 12:28 PST by Ali Juma
Modified: 2013-02-22 14:44 PST (History)
8 users (show)

See Also:


Attachments
Patch (6.27 KB, patch)
2013-01-10 12:33 PST, Ali Juma
no flags Details | Formatted Diff | Diff
Patch (5.67 KB, patch)
2013-02-20 13:17 PST, Ali Juma
no flags Details | Formatted Diff | Diff
Patch (8.24 KB, patch)
2013-02-22 09:01 PST, Ali Juma
no flags Details | Formatted Diff | Diff
Patch for landing (13.03 KB, patch)
2013-02-22 11:58 PST, Ali Juma
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Juma 2013-01-10 12:28:24 PST
[chromium] Register newly-created layers for animation
Comment 1 Ali Juma 2013-01-10 12:33:09 PST
Created attachment 182191 [details]
Patch
Comment 2 Ali Juma 2013-01-10 12:36:00 PST
This is needed for enabling accelerated animations for orphaned layers. The overall plan for this can be found at https://chromiumcodereview.appspot.com/11783037

This requires Bug 103635 and https://chromiumcodereview.appspot.com/11783101 to land first.
Comment 3 James Robinson 2013-01-15 19:59:47 PST
Comment on attachment 182191 [details]
Patch

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

> Source/Platform/chromium/public/WebLayerTreeView.h:154
> -    virtual void updateAnimations(double frameBeginTime) = 0;
> +    virtual void updateAnimations(double monotonicFrameBeginTime, double wallClockFrameBegin) = 0;

this is going to busterate the build unless a chromium-side patch implementing both changes has landed in chromium and rolled in.  please put the chromium rev# here on this bug when you do that

> Source/WebKit/chromium/src/ChromeClientImpl.cpp:134
> +    WebKit::ChromeClientImpl* m_chromeClient; // weak pointer

what makes sure this pointer won't outlive the object it points to? saying it's a weak pointer doesn't add anything (that's clear from the type) - what would be useful in a comment would be describing the lifecycle that makes it a *safe* weak pointer

> Source/WebKit/chromium/src/ChromeClientImpl.cpp:174
> +    , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this)))

we have a WebViewImpl* here, why not just pass that in to GraphicsLayerFactoryChromium and avoid the downcast, etc?

> Source/WebKit/chromium/src/WebViewImpl.cpp:1739
> +        double wallClockFrameBeginTime = currentTime();

ick, why are you grabbing a wall clock time here? this isn't going to be a useful value for anyone
Comment 4 Ali Juma 2013-02-20 13:17:52 PST
Created attachment 189364 [details]
Patch
Comment 5 Ali Juma 2013-02-20 13:22:11 PST
Starting orphaned animations before they get added to the tree is no longer part of the plan. This means the changes involving times are no longer needed.

(In reply to comment #3)
> (From update of attachment 182191 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=182191&action=review
> 
> > Source/Platform/chromium/public/WebLayerTreeView.h:154
> > -    virtual void updateAnimations(double frameBeginTime) = 0;
> > +    virtual void updateAnimations(double monotonicFrameBeginTime, double wallClockFrameBegin) = 0;
> 
> this is going to busterate the build unless a chromium-side patch implementing both changes has landed in chromium and rolled in.  please put the chromium rev# here on this bug when you do that

This change has been removed.

 
> > Source/WebKit/chromium/src/ChromeClientImpl.cpp:134
> > +    WebKit::ChromeClientImpl* m_chromeClient; // weak pointer
> 
> what makes sure this pointer won't outlive the object it points to? saying it's a weak pointer doesn't add anything (that's clear from the type) - what would be useful in a comment would be describing the lifecycle that makes it a *safe* weak pointer

Done (for m_webView, which we replaced m_chromeClient as a result of the comment below).


> > Source/WebKit/chromium/src/ChromeClientImpl.cpp:174
> > +    , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this)))
> 
> we have a WebViewImpl* here, why not just pass that in to GraphicsLayerFactoryChromium and avoid the downcast, etc?

Done.

 
> > Source/WebKit/chromium/src/WebViewImpl.cpp:1739
> > +        double wallClockFrameBeginTime = currentTime();
> 
> ick, why are you grabbing a wall clock time here? this isn't going to be a useful value for anyone

This change has been removed.
Comment 6 WebKit Review Bot 2013-02-20 13:24:59 PST
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 7 James Robinson 2013-02-20 17:23:53 PST
Comment on attachment 189364 [details]
Patch

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

> Source/WebKit/chromium/src/ChromeClientImpl.cpp:120
> +    GraphicsLayerFactoryChromium(WebKit::WebViewImpl* webView)

explicit

> Source/WebKit/chromium/src/ChromeClientImpl.cpp:136
> +    // GraphicsLayerFactoryChromium's lifetime is bounded by that of its owning
> +    // ChromeClientImpl, whose own lifetime is bounded by that of m_webView.

Hmm - you'll have to remind me.  Why doesn't the WebViewImpl just own this object directly?
Comment 8 Ali Juma 2013-02-21 08:25:21 PST
(In reply to comment #7)
> (From update of attachment 189364 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=189364&action=review
> 
> > Source/WebKit/chromium/src/ChromeClientImpl.cpp:120
> > +    GraphicsLayerFactoryChromium(WebKit::WebViewImpl* webView)
> 
> explicit
> 
> > Source/WebKit/chromium/src/ChromeClientImpl.cpp:136
> > +    // GraphicsLayerFactoryChromium's lifetime is bounded by that of its owning
> > +    // ChromeClientImpl, whose own lifetime is bounded by that of m_webView.
> 
> Hmm - you'll have to remind me.  Why doesn't the WebViewImpl just own this object directly?

WebViewImpl could own this directly. As I understand it, the only reason it's currently owned by ChromeClientImpl is that this seemed to be a logical place for it since ChromeClientImpl defines a ::graphicsLayerFactory method.
Comment 9 Ali Juma 2013-02-22 09:01:39 PST
Created attachment 189777 [details]
Patch
Comment 10 Ali Juma 2013-02-22 09:03:15 PST
(In reply to comment #7)
> (From update of attachment 189364 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=189364&action=review
> 
> > Source/WebKit/chromium/src/ChromeClientImpl.cpp:120
> > +    GraphicsLayerFactoryChromium(WebKit::WebViewImpl* webView)
> 
> explicit

Done.

> > Source/WebKit/chromium/src/ChromeClientImpl.cpp:136
> > +    // GraphicsLayerFactoryChromium's lifetime is bounded by that of its owning
> > +    // ChromeClientImpl, whose own lifetime is bounded by that of m_webView.
> 
> Hmm - you'll have to remind me.  Why doesn't the WebViewImpl just own this object directly?

WebViewImpl now owns this object directly.
Comment 11 James Robinson 2013-02-22 10:18:11 PST
Comment on attachment 189777 [details]
Patch

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

R=me - one change suggested before landing. You don't need to ask me for another review after moving that, just ask any friendly neighborhood WebKit committer to help you out.  Thanks for the iterations and explanations!

> Source/WebKit/chromium/src/WebViewImpl.cpp:212
> +class GraphicsLayerFactoryChromium : public GraphicsLayerFactory {

WebViewImpl.cpp is kind of gigantic, so I would consider moving this class out to its own header/cpp just to cut down on churn.
Comment 12 Ali Juma 2013-02-22 11:58:52 PST
Created attachment 189805 [details]
Patch for landing
Comment 13 WebKit Review Bot 2013-02-22 14:44:45 PST
Comment on attachment 189805 [details]
Patch for landing

Clearing flags on attachment: 189805

Committed r143803: <http://trac.webkit.org/changeset/143803>
Comment 14 WebKit Review Bot 2013-02-22 14:44:49 PST
All reviewed patches have been landed.  Closing bug.