Bug 92900 - [chromium] Upstream android's FlingAnimator
Summary: [chromium] Upstream android's FlingAnimator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nate Chapin
URL:
Keywords:
Depends on:
Blocks: 66687
  Show dependency treegraph
 
Reported: 2012-08-01 12:35 PDT by Nate Chapin
Modified: 2012-08-08 13:40 PDT (History)
7 users (show)

See Also:


Attachments
patch (23.96 KB, patch)
2012-08-01 12:47 PDT, Nate Chapin
jamesr: review-
Details | Formatted Diff | Diff
Add public interface so impl can live downstream (26.36 KB, patch)
2012-08-07 11:44 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
Move WebFlingAnimator.h to Platform, fix style issues (26.68 KB, patch)
2012-08-07 12:53 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
Address jamesr's comments (26.61 KB, patch)
2012-08-07 13:43 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
Remove WebKit/chromium and WebCore/platform/graphics/chromium/ changes (15.09 KB, patch)
2012-08-07 16:01 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
Address ChangeLog nits (15.10 KB, patch)
2012-08-07 16:45 PDT, Nate Chapin
japhet: commit-queue+
Details | Formatted Diff | Diff
Address ChangeLog nits (15.10 KB, patch)
2012-08-07 16:47 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
Patch for landing (15.28 KB, patch)
2012-08-08 10:49 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
The remainder (cc and WebKit/chromium changes) (11.21 KB, patch)
2012-08-08 13:28 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Chapin 2012-08-01 12:35:05 PDT
Also, include a USE(FLING_ANIMATOR) flag to keep track of the associated code.
Comment 1 Nate Chapin 2012-08-01 12:47:30 PDT
Created attachment 155863 [details]
patch
Comment 2 James Robinson 2012-08-01 12:55:02 PDT
Comment on attachment 155863 [details]
patch

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

> Source/WebKit/chromium/src/android/FlingAnimator.cpp:30
> +#include "base/android/jni_android.h"
> +#include "base/android/scoped_java_ref.h"

This #include won't compile in all configs and is a bad dependency.

I don't think any WebKit code should know about JNI.  Previously when we talked about this animator we had (I thought) decided that this code should call out to chromium code via WebKit API and chromium code can do whatever communication with JNI it needs to.
Comment 3 Adam Barth 2012-08-01 13:12:56 PDT
For context, FlingAnimator is responsible for about 15% of the remaining chromium-android diff in Source/WebKit.

The idea behind this patch is to remove this code from the diff and unblock the upstreaming effort.  Eventually, this code will be removed in favor of asking the embedder to supply the gesture animation curve.
Comment 4 James Robinson 2012-08-01 13:18:13 PDT
I understand, but #include'ing base/... is not something we can sustain upstream.
Comment 5 Adam Barth 2012-08-01 13:29:36 PDT
Maybe we should change FlingAnimator to be WebFlingAnimator and put the Impl in Chromium where it can #include base.
Comment 6 James Robinson 2012-08-01 13:36:18 PDT
That's pretty much what I'm suggesting in comment #2.  We talked about this (me and some clank graphics folks) a few months ago and I thought everyone had agreed to do so at the time, but I'm guessing nobody actually did anything.
Comment 7 Adam Barth 2012-08-01 13:48:49 PDT
Ah, I misunderstood what you were suggesting.  Yes.  The problem is that no one has done that and we're now running up against this as a blocker.
Comment 8 James Robinson 2012-08-01 13:53:14 PDT
Sounds like a good reason to do it!
Comment 9 Nate Chapin 2012-08-07 11:44:09 PDT
Created attachment 156965 [details]
Add public interface so impl can live downstream
Comment 10 WebKit Review Bot 2012-08-07 11:47:29 PDT
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 11 WebKit Review Bot 2012-08-07 11:47:48 PDT
Attachment 156965 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/Platform/ChangeLog', u'Source/Platf..." exit_code: 1
Source/WebKit/chromium/src/PlatformGestureCurveFactory.h:39:  The parameter name "point" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebKit/chromium/src/PlatformGestureCurveFactory.cpp:29:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 2 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Adam Barth 2012-08-07 11:50:11 PDT
Comment on attachment 156965 [details]
Add public interface so impl can live downstream

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

> Source/Platform/chromium/public/Platform.h:414
> +    virtual WebFlingAnimator* createFlingAnimator() { return 0; }

If you're going to reference WebFlingAnimator from Source/Platform, you should move WebFlingAnimator.h to Source/Platform/chromium/public.
Comment 13 Nate Chapin 2012-08-07 12:53:24 PDT
Created attachment 156980 [details]
Move WebFlingAnimator.h to Platform, fix style issues
Comment 14 WebKit Review Bot 2012-08-07 12:56:29 PDT
Attachment 156980 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/Platform/ChangeLog', u'Source/Platf..." exit_code: 1
Source/WebKit/chromium/src/WebFlingAnimatorToGestureCurveAdapter.h:34:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 15 James Robinson 2012-08-07 13:01:41 PDT
Comment on attachment 156980 [details]
Move WebFlingAnimator.h to Platform, fix style issues

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

> Source/Platform/chromium/public/WebFlingAnimator.h:2
> + * Copyright (C) 2011 Google Inc. All rights reserved.

2012

> Source/Platform/chromium/public/WebFlingAnimator.h:39
> +    virtual void startFling(const WebCore::FloatPoint& velocity, const WebCore::IntRect& range) = 0;

We can't use WebCore:: types in the public API since code that isn't in WebKit can't use these types - stuff in chromium can't include any WebCore headers.  We have wrapper types for geometry classes that you can use instead - WebFloatPoint, WebRect, etc.  They're just simple POD structs with some helpers to easily convert back/forth with WebCore and chromium types.

> Source/WebKit/chromium/src/PlatformGestureCurveFactory.h:2
> + * Copyright (C) 2011 Google Inc. All rights reserved.

2012

I think you could put all of this in WebCore/platform/chromium/support/ - that's the preferred location for implementations of Platform API that depends on WebCore but doesn't depend on anything in WebKit/chromium/src/

> Source/WebKit/chromium/src/WebFlingAnimatorToGestureCurveAdapter.h:46
> +    // WebCore::PlatformGestureCurve implementation:

could you add OVERRIDE annotations to functions that override from some base class? they go after the signature and just before the implementation
Comment 16 Nate Chapin 2012-08-07 13:43:05 PDT
Created attachment 156992 [details]
Address jamesr's comments
Comment 17 James Robinson 2012-08-07 15:47:13 PDT
Comment on attachment 156992 [details]
Address jamesr's comments

I'm happy with WebFlingAnimator, PlatformGestureCurve*, etc but have some questions about the WebCompositorInputHandlerImpl and CC* changes.  Could you break those changes out to a different patch so we can land that part and then hash out the scrolling behavior details?
Comment 18 Nate Chapin 2012-08-07 16:01:37 PDT
Created attachment 157032 [details]
Remove WebKit/chromium and WebCore/platform/graphics/chromium/ changes
Comment 19 James Robinson 2012-08-07 16:06:49 PDT
Comment on attachment 157032 [details]
Remove WebKit/chromium and WebCore/platform/graphics/chromium/ changes

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

R=me. Will wait for the EWS bot before touching cq, just to be safe.

> Source/Platform/ChangeLog:8
> +        Tests in chromium's WebCompositorInputHandlerImplTest.

This isn't quite accurate any more

> Source/WebCore/ChangeLog:8
> +        Tests in chromium's WebCompositorInputHandlerImplTest.

I think you want to update this bit.
Comment 20 Nate Chapin 2012-08-07 16:45:55 PDT
Created attachment 157041 [details]
Address ChangeLog nits
Comment 21 Nate Chapin 2012-08-07 16:47:19 PDT
Created attachment 157042 [details]
Address ChangeLog nits
Comment 22 WebKit Review Bot 2012-08-07 19:43:07 PDT
Comment on attachment 157042 [details]
Address ChangeLog nits

Rejecting attachment 157042 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
hromium/support/WebFlingAnimatorToGestureCurveAdapter.h
patching file Source/WebCore/platform/chromium/support/PlatformGestureCurveFactory.cpp
patching file Source/WebCore/WebCore.gypi
Hunk #1 FAILED at 8216.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebCore/WebCore.gypi.rej
patching file Source/WebCore/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/13456304
Comment 23 Nate Chapin 2012-08-08 10:49:34 PDT
Created attachment 157253 [details]
Patch for landing
Comment 24 WebKit Review Bot 2012-08-08 11:52:16 PDT
Comment on attachment 157253 [details]
Patch for landing

Clearing flags on attachment: 157253

Committed r125061: <http://trac.webkit.org/changeset/125061>
Comment 25 WebKit Review Bot 2012-08-08 11:52:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 26 Nate Chapin 2012-08-08 13:26:52 PDT
Reopening for the second stage...
Comment 27 Nate Chapin 2012-08-08 13:28:46 PDT
Created attachment 157280 [details]
The remainder (cc and WebKit/chromium changes)
Comment 28 James Robinson 2012-08-08 13:32:31 PDT
New bug, please.
Comment 29 Nate Chapin 2012-08-08 13:39:20 PDT
(In reply to comment #28)
> New bug, please.

Doh, sorry.