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

Issue 2090903002: aw: Share cc::Display instance (Closed)

Created:
4 years, 6 months ago by boliu
Modified:
4 years, 5 months ago
CC:
chromium-reviews, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

aw: Share cc::Display instance When there are multiple webview instances, share the same cc::Display instance, and other related objects. Main goal is to save memory. Sharing the same GLRenderer instance should allow sharing shaders. And sharing the same command buffer instance saves on things like transfer memory. To avoid sync point churn when interleaving draws of different HardwareRenderers, use CompositorFrameMetadata referenced_surfaces always keep references to all child surfaces from the root surface. BUG=611623 Committed: https://crrev.com/8b58fe54a8524d58d91e6e3fa78b1c3a07671e5f Cr-Commit-Position: refs/heads/master@{#402860}

Patch Set 1 #

Patch Set 2 : works #

Total comments: 1

Patch Set 3 : clean up #

Patch Set 4 : referenced_surfaces #

Patch Set 5 : raw pointers #

Total comments: 9

Patch Set 6 : hush review #

Patch Set 7 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+325 lines, -123 lines) Patch
M android_webview/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M android_webview/browser/hardware_renderer.h View 1 2 3 5 chunks +9 lines, -19 lines 0 comments Download
M android_webview/browser/hardware_renderer.cc View 1 2 3 4 5 6 6 chunks +29 lines, -104 lines 0 comments Download
A android_webview/browser/surfaces_instance.h View 1 2 3 4 1 chunk +90 lines, -0 lines 0 comments Download
A android_webview/browser/surfaces_instance.cc View 1 2 3 4 5 6 1 chunk +195 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (10 generated)
boliu
hey Daniel, this CL is not ready for full review yet. but someone nominated you ...
4 years, 6 months ago (2016-06-23 23:27:08 UTC) #2
boliu
+jbauman to review surfaces usage So imagine there is a single SurfacesInstance object shared by ...
4 years, 6 months ago (2016-06-24 16:44:10 UTC) #5
jbauman
On 2016/06/24 16:44:10, boliu wrote: > +jbauman to review surfaces usage > > So imagine ...
4 years, 6 months ago (2016-06-24 22:47:55 UTC) #6
boliu
On 2016/06/24 22:47:55, jbauman wrote: > On 2016/06/24 16:44:10, boliu wrote: > > +jbauman to ...
4 years, 6 months ago (2016-06-24 23:00:48 UTC) #7
boliu
On 2016/06/24 23:00:48, boliu wrote: > On 2016/06/24 22:47:55, jbauman wrote: > > On 2016/06/24 ...
4 years, 6 months ago (2016-06-24 23:11:27 UTC) #8
jbauman
On 2016/06/24 23:11:27, boliu wrote: > On 2016/06/24 23:00:48, boliu wrote: > > On 2016/06/24 ...
4 years, 6 months ago (2016-06-24 23:18:30 UTC) #9
boliu
On 2016/06/24 23:18:30, jbauman wrote: > On 2016/06/24 23:11:27, boliu wrote: > > On 2016/06/24 ...
4 years, 6 months ago (2016-06-24 23:30:13 UTC) #10
jbauman
On 2016/06/24 23:30:13, boliu wrote: > On 2016/06/24 23:18:30, jbauman wrote: > > On 2016/06/24 ...
4 years, 6 months ago (2016-06-24 23:38:13 UTC) #11
boliu
On 2016/06/24 23:38:13, jbauman wrote: > On 2016/06/24 23:30:13, boliu wrote: > > On 2016/06/24 ...
4 years, 6 months ago (2016-06-24 23:57:39 UTC) #12
boliu
added referenced_surfaces change, and checked nothing crashes, but still need to verify if there is ...
4 years, 6 months ago (2016-06-25 01:09:02 UTC) #14
dcheng
If it's all on the same thread, do we need to use base::LazyInstance? Maybe we ...
4 years, 5 months ago (2016-06-27 19:18:46 UTC) #15
boliu
On 2016/06/27 19:18:46, dcheng wrote: > If it's all on the same thread, do we ...
4 years, 5 months ago (2016-06-27 21:13:31 UTC) #16
boliu
jbauman: could you take another look as well, I made sure root referenced_surfaces always contains ...
4 years, 5 months ago (2016-06-27 21:15:04 UTC) #18
jbauman
On 2016/06/27 21:15:04, boliu wrote: > jbauman: could you take another look as well, I ...
4 years, 5 months ago (2016-06-27 21:40:06 UTC) #19
hush (inactive)
https://codereview.chromium.org/2090903002/diff/80001/android_webview/browser/surfaces_instance.cc File android_webview/browser/surfaces_instance.cc (right): https://codereview.chromium.org/2090903002/diff/80001/android_webview/browser/surfaces_instance.cc#newcode45 android_webview/browser/surfaces_instance.cc:45: g_surfaces_instance = this; shouldn't this line be at the ...
4 years, 5 months ago (2016-06-29 00:03:12 UTC) #20
boliu
https://codereview.chromium.org/2090903002/diff/80001/android_webview/browser/surfaces_instance.cc File android_webview/browser/surfaces_instance.cc (right): https://codereview.chromium.org/2090903002/diff/80001/android_webview/browser/surfaces_instance.cc#newcode45 android_webview/browser/surfaces_instance.cc:45: g_surfaces_instance = this; On 2016/06/29 00:03:12, hush wrote: > ...
4 years, 5 months ago (2016-06-29 01:01:04 UTC) #21
hush (inactive)
lgtm
4 years, 5 months ago (2016-06-29 16:00:31 UTC) #22
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/2090903002/120001
4 years, 5 months ago (2016-06-29 16:01:54 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 5 months ago (2016-06-29 17:48:27 UTC) #27
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-06-29 17:48:33 UTC) #28
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/8b58fe54a8524d58d91e6e3fa78b1c3a07671e5f Cr-Commit-Position: refs/heads/master@{#402860}
4 years, 5 months ago (2016-06-29 17:49:55 UTC) #30
Torne
4 years, 5 months ago (2016-07-08 11:12:07 UTC) #32
Message was sent while issue was closed.
https://codereview.chromium.org/2090903002/diff/80001/android_webview/browser...
File android_webview/browser/surfaces_instance.cc (right):

https://codereview.chromium.org/2090903002/diff/80001/android_webview/browser...
android_webview/browser/surfaces_instance.cc:45: g_surfaces_instance = this;
On 2016/06/29 01:01:03, boliu wrote:
> On 2016/06/29 00:03:12, hush wrote:
> > shouldn't this line be at the last line of constructor? because "this" is
not
> > fully fledged yet. Callers can start using a half done object.
> 
> Done
> 
> fwiw this is all single threaded, so not really that big of an issue.

It's not sufficient to just put this as the last line if you were really
concerned about thread safety. Since this code is single threaded it doesn't
matter, but if this was actually being used from multiple threads, it would be
required to have a real memory barrier. The order of memory accesses in source
code is not meaningful.

Powered by Google App Engine
This is Rietveld 408576698