Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Issue 14268004: Add overscroll edge effect animations for Android. (Closed)

Created:
7 years, 8 months ago by jdduke (slow)
Modified:
7 years, 7 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, James Su, trchen, David Trainor- moved to gerrit
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add overscroll edge effect animations for Android. Android provides simple edge effect animations for scrollable widgets. However, these are incompatible with performance constraints in the current compositing architecture. This patch implements a native version of the Android EdgeEffect and OverScroll behaviors, with hooks for animation and addition to a given layer. The necessary textures are also added as Android resources. BUG=135975 NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200846

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use system resources #

Patch Set 3 : Cleanup and layer attachment fixes #

Total comments: 2

Patch Set 4 : Use vsync ticks to drive overscroll animation #

Total comments: 66

Patch Set 5 : Code review. Properly disable animation on loss of focus. #

Total comments: 11

Patch Set 6 : Fixes for new approach to vsync signalling #

Patch Set 7 : Rebase and use ContentViewCore for animation #

Patch Set 8 : Rebase #

Total comments: 6

Patch Set 9 : Rebase + CR. Avoid round-trip animation requests on animate(). #

Total comments: 25

Patch Set 10 : Code review. Simpler layer attachment. #

Patch Set 11 : Enable by default #

Total comments: 2

Patch Set 12 : Rebase and switch string fix #

Total comments: 2

Patch Set 13 : Name refactor and make Java method private #

Patch Set 14 : Rebase #

Patch Set 15 : Use LazyInstance for overscroll resources #

Unified diffs Side-by-side diffs Delta from patch set Stats (+973 lines, -20 lines) Patch
M content/browser/android/content_view_core_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/android/content_view_core_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +17 lines, -0 lines 0 comments Download
A content/browser/android/edge_effect.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +89 lines, -0 lines 0 comments Download
A content/browser/android/edge_effect.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +370 lines, -0 lines 0 comments Download
A content/browser/android/overscroll_glow.h View 1 2 3 4 5 6 7 8 9 1 chunk +91 lines, -0 lines 0 comments Download
A content/browser/android/overscroll_glow.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +263 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +17 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +85 lines, -19 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +28 lines, -0 lines 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M ui/gfx/android/java_bitmap.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 65 (0 generated)
jdduke (slow)
This is a very rough first pass. Animation is driven by a somewhat crude callback ...
7 years, 8 months ago (2013-04-17 18:11:51 UTC) #1
aelias_OOO_until_Jul13
Can we get the resources from the Android system instead? I believe trchen did this ...
7 years, 8 months ago (2013-04-18 00:11:28 UTC) #2
jdduke (slow)
On 2013/04/18 00:11:28, aelias wrote: > Can we get the resources from the Android system ...
7 years, 8 months ago (2013-04-18 00:29:38 UTC) #3
jdduke (slow)
On 2013/04/18 00:29:38, jdduke wrote: > On 2013/04/18 00:11:28, aelias wrote: > > Can we ...
7 years, 8 months ago (2013-04-18 01:10:17 UTC) #4
aelias_OOO_until_Jul13
I see, I had been thinking we would load the Android ones and shrink them ...
7 years, 8 months ago (2013-04-18 01:27:27 UTC) #5
mkosiba (inactive)
On 2013/04/18 01:27:27, aelias wrote: > I see, I had been thinking we would load ...
7 years, 8 months ago (2013-04-18 09:20:33 UTC) #6
mkosiba (inactive)
https://codereview.chromium.org/14268004/diff/1/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/14268004/diff/1/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode621 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:621: private void initOverscrollResources(Context context) { make this resilient to ...
7 years, 8 months ago (2013-04-18 11:11:28 UTC) #7
jdduke (slow)
https://codereview.chromium.org/14268004/diff/1/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/14268004/diff/1/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode621 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:621: private void initOverscrollResources(Context context) { On 2013/04/18 11:11:28, mkosiba ...
7 years, 8 months ago (2013-04-18 15:18:34 UTC) #8
jdduke (slow)
On 2013/04/18 15:18:34, jdduke wrote: > https://codereview.chromium.org/14268004/diff/1/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java > File > content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java > (right): > > ...
7 years, 8 months ago (2013-04-18 15:20:27 UTC) #9
jdduke (slow)
The latest revision is much cleaner. System resources are used; if absent, the effect is ...
7 years, 8 months ago (2013-04-18 17:49:02 UTC) #10
mkosiba (inactive)
lgtm https://codereview.chromium.org/14268004/diff/21001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/14268004/diff/21001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode672 content/browser/renderer_host/render_widget_host_view_android.cc:672: animation_timer_.Start(FROM_HERE, animationInterval, this, I'm not familiar with how ...
7 years, 8 months ago (2013-04-22 16:24:53 UTC) #11
jdduke (slow)
https://codereview.chromium.org/14268004/diff/21001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/14268004/diff/21001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode672 content/browser/renderer_host/render_widget_host_view_android.cc:672: animation_timer_.Start(FROM_HERE, animationInterval, this, On 2013/04/22 16:24:53, mkosiba wrote: > ...
7 years, 8 months ago (2013-04-22 17:18:16 UTC) #12
jdduke (slow)
@aelias: Should anybody else take a look at these changes?
7 years, 8 months ago (2013-04-22 22:31:40 UTC) #13
aelias_OOO_until_Jul13
Various comments below. The main one requiring followup is that I don't like "CurrentAttachmentDepth". Whatever ...
7 years, 8 months ago (2013-04-22 23:46:48 UTC) #14
jdduke (slow)
On 2013/04/22 23:46:48, aelias wrote: > Various comments below. The main one requiring followup is ...
7 years, 8 months ago (2013-04-23 00:04:26 UTC) #15
jdduke (slow)
> 1) Layer animations (like those in the tab switcher/swipe) suffer marked > slowdown when ...
7 years, 8 months ago (2013-04-23 14:51:35 UTC) #16
jdduke (slow)
The main issue I have is with vsync notifications. See reply below. https://codereview.chromium.org/14268004/diff/28001/content/browser/android/edge_effect.cc File content/browser/android/edge_effect.cc ...
7 years, 8 months ago (2013-04-23 16:02:13 UTC) #17
aelias_OOO_until_Jul13
It sounds like it ends up falling back to a render surface when you have ...
7 years, 8 months ago (2013-04-23 16:19:45 UTC) #18
jdduke (slow)
I've reworked the detachment logic for the edge effect; it no longer uses the kludge ...
7 years, 8 months ago (2013-04-23 22:46:07 UTC) #19
aelias_OOO_until_Jul13
[+skyostil] For the vsync notification, I think you should explicitly rely on the refcounting behavior ...
7 years, 8 months ago (2013-04-24 00:28:10 UTC) #20
Sami
+sievers, +nduca I don't think we want to add yet another place for scheduling animations. ...
7 years, 8 months ago (2013-04-24 13:15:54 UTC) #21
no sievers
Also see crbug.com/235012. Nat, can you help sketch out how the animation system in the ...
7 years, 8 months ago (2013-04-24 13:44:06 UTC) #22
jdduke (slow)
On 2013/04/24 00:28:10, aelias wrote: > [+skyostil] For the vsync notification, I think you should ...
7 years, 8 months ago (2013-04-24 15:23:20 UTC) #23
jdduke (slow)
https://codereview.chromium.org/14268004/diff/43001/content/browser/android/content_startup_flags.cc File content/browser/android/content_startup_flags.cc (right): https://codereview.chromium.org/14268004/diff/43001/content/browser/android/content_startup_flags.cc#newcode62 content/browser/android/content_startup_flags.cc:62: parsed_command_line->AppendSwitch(switches::kEnableOverscrollEdgeEffect); On 2013/04/24 13:15:55, Sami wrote: > Does this ...
7 years, 8 months ago (2013-04-24 15:23:44 UTC) #24
Sami
On 2013/04/24 15:23:44, jdduke wrote: > On 2013/04/24 13:15:55, Sami wrote: > > nit: Constants ...
7 years, 8 months ago (2013-04-24 15:28:36 UTC) #25
jdduke (slow)
> EdgeEffect.java should only change when the Android system style changes, which > isn't all ...
7 years, 8 months ago (2013-04-24 15:29:41 UTC) #26
jdduke (slow)
On 2013/04/24 13:15:54, Sami wrote: > +sievers, +nduca > > I don't think we want ...
7 years, 8 months ago (2013-04-24 16:06:02 UTC) #27
aelias_OOO_until_Jul13
Keep in mind I don't think there's anything wrong with continuing to manage overscroll and ...
7 years, 8 months ago (2013-04-24 18:53:40 UTC) #28
jdduke (slow)
@skyostil: As it stands, most of the code that drives tab switcher animations is not ...
7 years, 8 months ago (2013-04-25 00:18:58 UTC) #29
no sievers
Ok how about instead of hooking into vsync you add an Animate() callback (from ContentViewCore ...
7 years, 8 months ago (2013-04-25 07:38:49 UTC) #30
no sievers
On 2013/04/25 07:38:49, Daniel Sievers wrote: > Ok how about instead of hooking into vsync ...
7 years, 8 months ago (2013-04-25 07:46:21 UTC) #31
Sami
On 2013/04/25 07:46:21, Daniel Sievers wrote: > On 2013/04/25 07:38:49, Daniel Sievers wrote: > > ...
7 years, 8 months ago (2013-04-25 11:00:16 UTC) #32
jdduke (slow)
I've added a (short) NeedsAnimate/Animate pipeline between RHWVA and ContentViewCore that is somewhat decoupled from ...
7 years, 7 months ago (2013-05-09 19:15:38 UTC) #33
jdduke (slow)
On 2013/05/09 19:15:38, jdduke wrote: > I've added a (short) NeedsAnimate/Animate pipeline between RHWVA and ...
7 years, 7 months ago (2013-05-09 19:17:19 UTC) #34
aelias_OOO_until_Jul13
lgtm https://codereview.chromium.org/14268004/diff/67016/content/browser/android/content_startup_flags.cc File content/browser/android/content_startup_flags.cc (right): https://codereview.chromium.org/14268004/diff/67016/content/browser/android/content_startup_flags.cc#newcode79 content/browser/android/content_startup_flags.cc:79: #if defined(OS_ANDROID) No need for #if defined(), this ...
7 years, 7 months ago (2013-05-10 04:37:07 UTC) #35
Sami
Thanks, this animation system looks great. lgtm. https://codereview.chromium.org/14268004/diff/67016/content/browser/renderer_host/render_widget_host_view_android.h File content/browser/renderer_host/render_widget_host_view_android.h (right): https://codereview.chromium.org/14268004/diff/67016/content/browser/renderer_host/render_widget_host_view_android.h#newcode275 content/browser/renderer_host/render_widget_host_view_android.h:275: // Used ...
7 years, 7 months ago (2013-05-10 10:47:57 UTC) #36
jdduke (slow)
Alright, thanks everybody for your feedback/review/patience. Looks like this just needs owner approval for the ...
7 years, 7 months ago (2013-05-10 16:39:52 UTC) #37
danakj
danakj -> sky You may notice the comment by my ownership, which applies to geometry ...
7 years, 7 months ago (2013-05-10 16:44:20 UTC) #38
sky
LGTM
7 years, 7 months ago (2013-05-10 19:21:41 UTC) #39
no sievers
Looks good. A couple for nits inline. Can you consider removing the command line? It ...
7 years, 7 months ago (2013-05-13 18:37:35 UTC) #40
no sievers
(Copying my previous comment, this time publishing inline comments) Looks good. A couple for nits ...
7 years, 7 months ago (2013-05-13 18:38:23 UTC) #41
nduca
dumb question: is overscroll done on the impl thread?
7 years, 7 months ago (2013-05-13 18:39:09 UTC) #42
jdduke (slow)
On 2013/05/13 18:39:09, nduca wrote: > dumb question: is overscroll done on the impl thread? ...
7 years, 7 months ago (2013-05-13 18:41:44 UTC) #43
no sievers
On 2013/05/13 18:41:44, jdduke wrote: > On 2013/05/13 18:39:09, nduca wrote: > > dumb question: ...
7 years, 7 months ago (2013-05-13 18:45:00 UTC) #44
jdduke (slow)
On 2013/05/13 18:37:35, Daniel Sievers wrote: > Looks good. A couple for nits inline. > ...
7 years, 7 months ago (2013-05-13 18:49:01 UTC) #45
jdduke (slow)
On 2013/05/13 18:45:00, Daniel Sievers wrote: > On 2013/05/13 18:41:44, jdduke wrote: > > On ...
7 years, 7 months ago (2013-05-13 18:52:53 UTC) #46
aelias_OOO_until_Jul13
Overscroll is done on the browser main thread, and there's no plan to ever move ...
7 years, 7 months ago (2013-05-13 19:01:18 UTC) #47
aelias_OOO_until_Jul13
Urgh sorry, s/renderer main thread/renderer impl thread/ in what I said above.
7 years, 7 months ago (2013-05-13 19:02:13 UTC) #48
jdduke (slow)
Responding to review, with a few questions. https://codereview.chromium.org/14268004/diff/80001/content/browser/android/content_view_core_impl.h File content/browser/android/content_view_core_impl.h (right): https://codereview.chromium.org/14268004/diff/80001/content/browser/android/content_view_core_impl.h#newcode202 content/browser/android/content_view_core_impl.h:202: jboolean Animate(JNIEnv* ...
7 years, 7 months ago (2013-05-13 20:44:24 UTC) #49
no sievers
Enable-by-default with disable cmdline sounds good. I think WebView will deactivate it. https://codereview.chromium.org/14268004/diff/80001/content/browser/android/edge_effect.h File content/browser/android/edge_effect.h ...
7 years, 7 months ago (2013-05-13 20:53:22 UTC) #50
jdduke (slow)
> https://codereview.chromium.org/14268004/diff/80001/content/browser/renderer_host/render_widget_host_view_android.cc > File content/browser/renderer_host/render_widget_host_view_android.cc (right): > > https://codereview.chromium.org/14268004/diff/80001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode711 > content/browser/renderer_host/render_widget_host_view_android.cc:711: > overscroll_effect_->set_parent_layer(content_view_core_->GetLayer()); > On ...
7 years, 7 months ago (2013-05-13 21:03:53 UTC) #51
jdduke (slow)
On 2013/05/13 21:03:53, jdduke wrote: > > > https://codereview.chromium.org/14268004/diff/80001/content/browser/renderer_host/render_widget_host_view_android.cc > > File content/browser/renderer_host/render_widget_host_view_android.cc (right): > ...
7 years, 7 months ago (2013-05-13 21:12:43 UTC) #52
jdduke (slow)
It turns out that we can avoid the attach/detach logic altogether by simply resetting the ...
7 years, 7 months ago (2013-05-14 17:54:17 UTC) #53
no sievers
Thanks, that looks great. LGTM with cmdline string fixed. https://codereview.chromium.org/14268004/diff/115001/content/public/common/content_switches.cc File content/public/common/content_switches.cc (right): https://codereview.chromium.org/14268004/diff/115001/content/public/common/content_switches.cc#newcode757 content/public/common/content_switches.cc:757: ...
7 years, 7 months ago (2013-05-14 18:12:15 UTC) #54
jdduke (slow)
Hmm, it appears both @tedchoc and @joth are out. Yaron, would you mind taking a ...
7 years, 7 months ago (2013-05-16 15:37:56 UTC) #55
Yaron
https://codereview.chromium.org/14268004/diff/118001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/14268004/diff/118001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode2764 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:2764: public boolean animate(long frameTimeMicros) { Is it just me ...
7 years, 7 months ago (2013-05-16 17:38:39 UTC) #56
jdduke (slow)
https://codereview.chromium.org/14268004/diff/118001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/14268004/diff/118001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode2764 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:2764: public boolean animate(long frameTimeMicros) { On 2013/05/16 17:38:40, Yaron ...
7 years, 7 months ago (2013-05-16 18:31:49 UTC) #57
aelias_OOO_until_Jul13
onAnimate() sounds fine to me given that it's a generic animation hook.
7 years, 7 months ago (2013-05-16 18:35:40 UTC) #58
Yaron
Ok. Definitely happier if it's not public. Part of me wonders if more of this ...
7 years, 7 months ago (2013-05-16 18:41:25 UTC) #59
jdduke (slow)
Looks like @jam is out. @joi: Could you review content/public/common/content_switches.{h,cc}? Thanks.
7 years, 7 months ago (2013-05-16 18:42:58 UTC) #60
jdduke (slow)
On 2013/05/16 18:41:25, Yaron wrote: > Ok. Definitely happier if it's not public. Part of ...
7 years, 7 months ago (2013-05-16 18:49:00 UTC) #61
Jói
LGTM for //content/public/common.
7 years, 7 months ago (2013-05-16 19:23:57 UTC) #62
no sievers
On 2013/05/16 18:41:25, Yaron wrote: > Ok. Definitely happier if it's not public. Part of ...
7 years, 7 months ago (2013-05-16 21:23:40 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jdduke@chromium.org/14268004/134016
7 years, 7 months ago (2013-05-17 17:51:18 UTC) #64
commit-bot: I haz the power
7 years, 7 months ago (2013-05-17 17:51:55 UTC) #65
Message was sent while issue was closed.
Change committed as 200846

Powered by Google App Engine
This is Rietveld 408576698