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

Issue 2174203002: OnDrawHardware() implementation with async messages (Closed)

Created:
4 years, 5 months ago by ojars
Modified:
4 years, 3 months ago
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds alternative OnDrawHardware() implementation that uses async IPC messages The purpose of this CL is to remove unnecessary blocking on UI thread which happens when BrowserViewRenderer sends a synchronous IPC message to get the next hardware frame. This new implementation instead sends an async message and receives the frame with another async message from render thread. This change alone is not sufficient as it causes scroll latency. The async implementation is turned on by command line param. Committed: https://crrev.com/5339299e1c78677caaf1c3b434ac8f154f0468ec Cr-Commit-Position: refs/heads/master@{#416404}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Further changes. #

Total comments: 3

Patch Set 3 : OnDrawHardware now fully async #

Patch Set 4 : Code cleanup. #

Patch Set 5 : Added boolean switch for old/new implementation #

Patch Set 6 : Added flag to branch old and new implementation #

Total comments: 28

Patch Set 7 : Added command line param #

Patch Set 8 : Implemented suggestions from previous code review #

Total comments: 18

Patch Set 9 : Implemented CR suggestions #

Total comments: 10

Patch Set 10 : Implemented code review #

Total comments: 13

Patch Set 11 : Code review #

Total comments: 1

Patch Set 12 : Code review #

Patch Set 13 : Code review #

Patch Set 14 : Added DemandDrawHwAsync to TestSynchronousCompositor #

Total comments: 1

Patch Set 15 : Removed unnecessary return statement #

Unified diffs Side-by-side diffs Delta from patch set Stats (+183 lines, -23 lines) Patch
M android_webview/browser/browser_view_renderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +4 lines, -0 lines 0 comments Download
M android_webview/browser/browser_view_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +38 lines, -9 lines 0 comments Download
M android_webview/common/aw_switches.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/common/aw_switches.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/android/synchronous_compositor_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/android/synchronous_compositor_host.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +41 lines, -4 lines 0 comments Download
M content/common/android/sync_compositor_messages.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M content/public/browser/android/synchronous_compositor.h View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/browser/android/synchronous_compositor_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/test/test_synchronous_compositor_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/test/test_synchronous_compositor_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/android/synchronous_compositor_proxy.h View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -0 lines 0 comments Download
M content/renderer/android/synchronous_compositor_proxy.cc View 1 2 3 4 5 6 7 8 9 5 chunks +55 lines, -10 lines 0 comments Download

Messages

Total messages: 58 (22 generated)
ojars
I have some questions. Would be good to talk on Monday.
4 years, 5 months ago (2016-07-24 04:53:08 UTC) #2
boliu
some high level comments https://codereview.chromium.org/2174203002/diff/1/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/1/android_webview/browser/browser_view_renderer.cc#newcode267 android_webview/browser/browser_view_renderer.cc:267: void BrowserViewRenderer::OnDrawHardwareProcessFrame( You want to ...
4 years, 5 months ago (2016-07-24 17:33:54 UTC) #3
hush (inactive)
I'm not sure what will break by making OnDrawHardware async. What kind of frame do ...
4 years, 4 months ago (2016-07-26 20:50:50 UTC) #5
boliu
On 2016/07/26 20:50:50, hush wrote: > I'm not sure what will break by making OnDrawHardware ...
4 years, 4 months ago (2016-07-26 20:52:38 UTC) #6
ojars
OnDrawHardware() in BVR is now async except the first 60 calls. Currently it crashes when ...
4 years, 4 months ago (2016-07-28 22:53:55 UTC) #8
boliu
https://codereview.chromium.org/2174203002/diff/20001/android_webview/browser/hardware_renderer.cc File android_webview/browser/hardware_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/20001/android_webview/browser/hardware_renderer.cc#newcode185 android_webview/browser/hardware_renderer.cc:185: DCHECK(child_frame_->frame->delegated_frame_data); crash looks like this DCHECK is failing the ...
4 years, 4 months ago (2016-07-29 00:48:21 UTC) #9
ojars
OnDrawHardware now works asynchronously. https://codereview.chromium.org/2174203002/diff/20001/android_webview/browser/hardware_renderer.cc File android_webview/browser/hardware_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/20001/android_webview/browser/hardware_renderer.cc#newcode185 android_webview/browser/hardware_renderer.cc:185: DCHECK(child_frame_->frame->delegated_frame_data); On 2016/07/29 00:48:21, boliu ...
4 years, 4 months ago (2016-08-02 21:18:50 UTC) #10
ojars
Code cleanup.
4 years, 4 months ago (2016-08-03 00:58:58 UTC) #11
ojars
Two changes here: 1. boolean switch for old/new implementation 2. common renderer params now sent ...
4 years, 4 months ago (2016-08-10 22:30:14 UTC) #12
ojars
Added flag to branch old and new implementation.
4 years, 4 months ago (2016-08-11 18:33:38 UTC) #13
boliu
https://codereview.chromium.org/2174203002/diff/100001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/100001/android_webview/browser/browser_view_renderer.cc#newcode240 android_webview/browser/browser_view_renderer.cc:240: bool AFLAG = false; Here is an example of ...
4 years, 4 months ago (2016-08-11 19:23:40 UTC) #14
ojars
Added check for command line arg https://codereview.chromium.org/2174203002/diff/100001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/100001/android_webview/browser/browser_view_renderer.cc#newcode240 android_webview/browser/browser_view_renderer.cc:240: bool AFLAG = ...
4 years, 4 months ago (2016-08-17 22:51:33 UTC) #15
ojars
Implemented suggestions from last code review. I diffed this upload against origin/master, hope that's fine. ...
4 years, 4 months ago (2016-08-23 02:15:42 UTC) #16
boliu
https://codereview.chromium.org/2174203002/diff/140001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/140001/android_webview/browser/browser_view_renderer.cc#newcode246 android_webview/browser/browser_view_renderer.cc:246: frame_produced_ = false; you don't need this, just check ...
4 years, 4 months ago (2016-08-23 02:39:53 UTC) #17
ojars
Implemented suggestions https://codereview.chromium.org/2174203002/diff/140001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/140001/android_webview/browser/browser_view_renderer.cc#newcode246 android_webview/browser/browser_view_renderer.cc:246: frame_produced_ = false; On 2016/08/23 02:39:52, boliu ...
4 years, 4 months ago (2016-08-23 21:58:43 UTC) #19
boliu
write a better CL description, first a one line summary, then a blank line, then ...
4 years, 4 months ago (2016-08-23 22:08:02 UTC) #20
ojars
Also updated the CL description https://codereview.chromium.org/2174203002/diff/180001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/180001/android_webview/browser/browser_view_renderer.cc#newcode252 android_webview/browser/browser_view_renderer.cc:252: return current_compositor_frame_consumer_->HasFrameOnUI(); On 2016/08/23 ...
4 years, 3 months ago (2016-08-29 21:54:45 UTC) #25
boliu
lgtm +sievers for content/public +dcheng for ipc Note the async path is behind a switch, ...
4 years, 3 months ago (2016-08-29 22:02:10 UTC) #27
no sievers
On 2016/08/29 22:02:10, boliu wrote: > lgtm > > +sievers for content/public > lgtm
4 years, 3 months ago (2016-08-30 20:53:31 UTC) #28
dcheng
https://codereview.chromium.org/2174203002/diff/200001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/200001/android_webview/browser/browser_view_renderer.cc#newcode262 android_webview/browser/browser_view_renderer.cc:262: if (!frame.frame.get()) Nit: I think .get() can probably be ...
4 years, 3 months ago (2016-08-31 18:06:44 UTC) #29
boliu
https://codereview.chromium.org/2174203002/diff/200001/content/browser/android/synchronous_compositor_host.cc File content/browser/android/synchronous_compositor_host.cc (right): https://codereview.chromium.org/2174203002/diff/200001/content/browser/android/synchronous_compositor_host.cc#newcode146 content/browser/android/synchronous_compositor_host.cc:146: *frame.frame = std::move(const_cast<cc::CompositorFrame&>(compositor_frame)); On 2016/08/31 18:06:44, dcheng wrote: > ...
4 years, 3 months ago (2016-08-31 18:23:53 UTC) #30
boliu
https://codereview.chromium.org/2174203002/diff/200001/content/browser/android/synchronous_compositor_host.cc File content/browser/android/synchronous_compositor_host.cc (right): https://codereview.chromium.org/2174203002/diff/200001/content/browser/android/synchronous_compositor_host.cc#newcode146 content/browser/android/synchronous_compositor_host.cc:146: *frame.frame = std::move(const_cast<cc::CompositorFrame&>(compositor_frame)); On 2016/08/31 18:23:53, boliu wrote: > ...
4 years, 3 months ago (2016-08-31 18:25:45 UTC) #31
ojars
https://codereview.chromium.org/2174203002/diff/200001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/200001/android_webview/browser/browser_view_renderer.cc#newcode232 android_webview/browser/browser_view_renderer.cc:232: // If the WebView is on a layer, WebView ...
4 years, 3 months ago (2016-09-02 01:29:56 UTC) #32
boliu
https://codereview.chromium.org/2174203002/diff/220001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/2174203002/diff/220001/android_webview/browser/browser_view_renderer.cc#newcode243 android_webview/browser/browser_view_renderer.cc:243: if (!frame.frame.get()) { remove .get here too
4 years, 3 months ago (2016-09-02 01:35:17 UTC) #33
dcheng
ipc lgtm. I hate to introduce more use of IPC_MESSAGE_HANDLER_GENERIC, but this seems strictly better ...
4 years, 3 months ago (2016-09-02 03:28:35 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2174203002/240001
4 years, 3 months ago (2016-09-02 19:58:57 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/123147) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, ...
4 years, 3 months ago (2016-09-02 20:02:46 UTC) #39
boliu
looks like needs a rebase
4 years, 3 months ago (2016-09-02 20:11:28 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2174203002/260001
4 years, 3 months ago (2016-09-02 21:46:25 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/123221)
4 years, 3 months ago (2016-09-02 22:12:31 UTC) #45
boliu
On 2016/09/02 22:12:31, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 3 months ago (2016-09-02 22:14:29 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2174203002/280001
4 years, 3 months ago (2016-09-02 22:33:31 UTC) #49
boliu
https://codereview.chromium.org/2174203002/diff/280001/content/public/test/test_synchronous_compositor_android.cc File content/public/test/test_synchronous_compositor_android.cc (right): https://codereview.chromium.org/2174203002/diff/280001/content/public/test/test_synchronous_compositor_android.cc#newcode40 content/public/test/test_synchronous_compositor_android.cc:40: return; just leave this empty, don't return in a ...
4 years, 3 months ago (2016-09-02 22:34:23 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2174203002/300001
4 years, 3 months ago (2016-09-02 23:19:35 UTC) #54
commit-bot: I haz the power
Committed patchset #15 (id:300001)
4 years, 3 months ago (2016-09-03 00:09:34 UTC) #56
commit-bot: I haz the power
4 years, 3 months ago (2016-09-03 00:11:45 UTC) #58
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/5339299e1c78677caaf1c3b434ac8f154f0468ec
Cr-Commit-Position: refs/heads/master@{#416404}

Powered by Google App Engine
This is Rietveld 408576698