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

Issue 2511273002: Decouple BrowserCompositorOutputSurface from BeginFrameSource. (Closed)

Created:
4 years, 1 month ago by stanisc
Modified:
4 years ago
Reviewers:
danakj, enne (OOO)
CC:
cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, jam, jbauman+watch_chromium.org, kalyank, miu+watch_chromium.org, piman+watch_chromium.org, scheduler-bugs_chromium.org, Ian Vollick, xjz+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Decouple BrowserCompositorOutputSurface from BeginFrameSource. This change is a part of larger effort of propagating D3D VSync signal to the compositor. Since the current implementation in BrowserCompositorOutputSurface explicitly depends on a time based SyntheticBeginFrameSource, enne@ suggested that a good first step would be to try to decouple it from a specific BeginFrameSource type. Instead of passing SyntheticBeginFrameSource and CompositorVSyncManager in every constructor of BrowserCompositorOutputSurface and classes derived from it, this change replaces the SyntheticBFS / VSyncManager pair with a callback to update VSync parameters. The callback is handled at GpuProcessTransportFactory. BUG=467617 Committed: https://crrev.com/3566f880e80d65a57b7e084ccd55030972585c98 Cr-Commit-Position: refs/heads/master@{#436122}

Patch Set 1 #

Patch Set 2 : Fixed build error in gpu_output_surface_mac.* #

Patch Set 3 : Attempt to fix the crash #

Patch Set 4 : Another attempt to fix the crash #

Total comments: 4

Patch Set 5 : Changed implementation to pass callback to GPTF #

Patch Set 6 : Fixed unit tests #

Total comments: 2

Patch Set 7 : Avoid duplicating code that updates VSync manager. #

Total comments: 9

Patch Set 8 : Addressed CR feedback #

Total comments: 11

Patch Set 9 : Addressed CR feedback #

Total comments: 1

Patch Set 10 : Bring back GpuBrowserCompositorOutputSurface destructor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -128 lines) Patch
M content/browser/compositor/browser_compositor_output_surface.h View 1 2 3 4 5 6 7 8 4 chunks +7 lines, -13 lines 0 comments Download
M content/browser/compositor/browser_compositor_output_surface.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -25 lines 0 comments Download
M content/browser/compositor/gpu_browser_compositor_output_surface.h View 1 2 3 4 2 chunks +1 line, -3 lines 0 comments Download
M content/browser/compositor/gpu_browser_compositor_output_surface.cc View 1 2 3 4 5 6 7 9 3 chunks +8 lines, -9 lines 0 comments Download
M content/browser/compositor/gpu_output_surface_mac.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/compositor/gpu_output_surface_mac.mm View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/compositor/gpu_process_transport_factory.cc View 1 2 3 4 5 6 7 8 7 chunks +14 lines, -15 lines 0 comments Download
M content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc View 1 2 3 4 2 chunks +2 lines, -4 lines 0 comments Download
M content/browser/compositor/mus_browser_compositor_output_surface.h View 1 2 3 4 2 chunks +2 lines, -4 lines 0 comments Download
M content/browser/compositor/mus_browser_compositor_output_surface.cc View 1 2 3 4 2 chunks +4 lines, -8 lines 0 comments Download
M content/browser/compositor/offscreen_browser_compositor_output_surface.h View 1 2 3 4 2 chunks +1 line, -6 lines 0 comments Download
M content/browser/compositor/offscreen_browser_compositor_output_surface.cc View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/compositor/reflector_impl_unittest.cc View 1 2 3 4 5 2 chunks +5 lines, -10 lines 0 comments Download
M content/browser/compositor/software_browser_compositor_output_surface.h View 1 2 3 4 2 chunks +1 line, -6 lines 0 comments Download
M content/browser/compositor/software_browser_compositor_output_surface.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -9 lines 0 comments Download
M content/browser/compositor/software_browser_compositor_output_surface_unittest.cc View 1 2 3 4 5 5 chunks +16 lines, -1 line 0 comments Download
M content/browser/compositor/vulkan_browser_compositor_output_surface.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/compositor/vulkan_browser_compositor_output_surface.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M ui/compositor/compositor.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 70 (42 generated)
stanisc
This might still need a couple of potential refinements - I left a few TODOs ...
4 years, 1 month ago (2016-11-21 19:56:19 UTC) #16
danakj
https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc File content/browser/compositor/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc#newcode455 content/browser/compositor/gpu_process_transport_factory.cc:455: compositor->vsync_manager()->AddObserver(begin_frame_source.get()); I think there are at least 3 ways ...
4 years, 1 month ago (2016-11-21 22:32:11 UTC) #17
stanisc
https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc File content/browser/compositor/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc#newcode455 content/browser/compositor/gpu_process_transport_factory.cc:455: compositor->vsync_manager()->AddObserver(begin_frame_source.get()); On 2016/11/21 22:32:11, danakj wrote: > I think ...
4 years, 1 month ago (2016-11-21 22:52:31 UTC) #18
danakj
https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc File content/browser/compositor/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc#newcode455 content/browser/compositor/gpu_process_transport_factory.cc:455: compositor->vsync_manager()->AddObserver(begin_frame_source.get()); On 2016/11/21 22:52:31, stanisc wrote: > On 2016/11/21 ...
4 years, 1 month ago (2016-11-21 23:06:36 UTC) #19
enne (OOO)
I think it makes some sense to keep most of this logic in GPTF in ...
4 years, 1 month ago (2016-11-21 23:14:43 UTC) #20
stanisc
https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc File content/browser/compositor/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/2511273002/diff/60001/content/browser/compositor/gpu_process_transport_factory.cc#newcode455 content/browser/compositor/gpu_process_transport_factory.cc:455: compositor->vsync_manager()->AddObserver(begin_frame_source.get()); On 2016/11/21 23:06:36, danakj wrote: > On 2016/11/21 ...
4 years, 1 month ago (2016-11-22 19:55:43 UTC) #21
enne (OOO)
I think in the future, BCOS can't be a VSyncObserver. I think I would suggest ...
4 years ago (2016-11-23 20:14:25 UTC) #22
stanisc
Replaced the SyntheticBFS / VSyncManager pair with a callback to update VSync parameters. PTAL!
4 years ago (2016-11-29 20:01:41 UTC) #28
enne (OOO)
Thanks! This is looking good. One small nit: https://codereview.chromium.org/2511273002/diff/100001/content/browser/compositor/gpu_process_transport_factory.cc File content/browser/compositor/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/2511273002/diff/100001/content/browser/compositor/gpu_process_transport_factory.cc#newcode738 content/browser/compositor/gpu_process_transport_factory.cc:738: SetDisplayVSyncParameters(compositor.get(), ...
4 years ago (2016-11-29 21:25:03 UTC) #29
stanisc
https://codereview.chromium.org/2511273002/diff/100001/content/browser/compositor/gpu_process_transport_factory.cc File content/browser/compositor/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/2511273002/diff/100001/content/browser/compositor/gpu_process_transport_factory.cc#newcode738 content/browser/compositor/gpu_process_transport_factory.cc:738: SetDisplayVSyncParameters(compositor.get(), timebase, interval); On 2016/11/29 21:25:03, enne wrote: > ...
4 years ago (2016-11-29 21:38:44 UTC) #30
enne (OOO)
On 2016/11/29 at 21:38:44, stanisc wrote: > So the main reason for this function is ...
4 years ago (2016-11-29 21:47:58 UTC) #31
stanisc
Changed the GPTF callback to be a non-member function that redirects to Compositor::SetDisplayVSyncParameters. It seems ...
4 years ago (2016-11-30 01:35:19 UTC) #36
enne (OOO)
lgtm, thanks for all the changes! I think you need a danakj review here as ...
4 years ago (2016-11-30 01:46:17 UTC) #37
danakj
https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_browser_compositor_output_surface.cc File content/browser/compositor/gpu_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_browser_compositor_output_surface.cc#newcode68 content/browser/compositor/gpu_browser_compositor_output_surface.cc:68: &GpuBrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu, This is going to the base class just ...
4 years ago (2016-11-30 23:49:06 UTC) #38
stanisc
https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_browser_compositor_output_surface.cc File content/browser/compositor/gpu_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_browser_compositor_output_surface.cc#newcode68 content/browser/compositor/gpu_browser_compositor_output_surface.cc:68: &GpuBrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu, On 2016/11/30 23:49:05, danakj wrote: > This is ...
4 years ago (2016-12-01 00:16:27 UTC) #39
danakj
https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_process_transport_factory.cc File content/browser/compositor/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_process_transport_factory.cc#newcode163 content/browser/compositor/gpu_process_transport_factory.cc:163: if (!compositor) On 2016/12/01 00:16:27, stanisc wrote: > On ...
4 years ago (2016-12-01 00:26:34 UTC) #40
stanisc
On 2016/12/01 00:26:34, danakj wrote: > https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_process_transport_factory.cc > File content/browser/compositor/gpu_process_transport_factory.cc (right): > > https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_process_transport_factory.cc#newcode163 > ...
4 years ago (2016-12-01 01:30:26 UTC) #41
danakj
On Wed, Nov 30, 2016 at 5:30 PM, <stanisc@chromium.org> wrote: > On 2016/12/01 00:26:34, danakj ...
4 years ago (2016-12-01 01:52:52 UTC) #42
stanisc
https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_browser_compositor_output_surface.cc File content/browser/compositor/gpu_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2511273002/diff/110001/content/browser/compositor/gpu_browser_compositor_output_surface.cc#newcode68 content/browser/compositor/gpu_browser_compositor_output_surface.cc:68: &GpuBrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu, On 2016/12/01 00:16:27, stanisc wrote: > On 2016/11/30 ...
4 years ago (2016-12-02 19:50:43 UTC) #47
danakj
https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/browser_compositor_output_surface.h File content/browser/compositor/browser_compositor_output_surface.h (right): https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/browser_compositor_output_surface.h#newcode42 content/browser/compositor/browser_compositor_output_surface.h:42: void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase, This should go away? https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/software_browser_compositor_output_surface.cc File ...
4 years ago (2016-12-02 21:44:14 UTC) #48
stanisc
https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/browser_compositor_output_surface.h File content/browser/compositor/browser_compositor_output_surface.h (right): https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/browser_compositor_output_surface.h#newcode42 content/browser/compositor/browser_compositor_output_surface.h:42: void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase, On 2016/12/02 21:44:14, danakj wrote: > ...
4 years ago (2016-12-02 22:25:20 UTC) #49
danakj
https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/software_browser_compositor_output_surface.cc File content/browser/compositor/software_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/software_browser_compositor_output_surface.cc#newcode82 content/browser/compositor/software_browser_compositor_output_surface.cc:82: vsync_provider->GetVSyncParameters(update_vsync_parameters_callback_); On 2016/12/02 22:25:20, stanisc wrote: > On 2016/12/02 ...
4 years ago (2016-12-02 22:35:10 UTC) #50
stanisc
https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/browser_compositor_output_surface.h File content/browser/compositor/browser_compositor_output_surface.h (right): https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/browser_compositor_output_surface.h#newcode42 content/browser/compositor/browser_compositor_output_surface.h:42: void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase, On 2016/12/02 22:25:20, stanisc wrote: > ...
4 years ago (2016-12-02 22:44:55 UTC) #53
danakj
LGTM https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/gpu_browser_compositor_output_surface.cc File content/browser/compositor/gpu_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/gpu_browser_compositor_output_surface.cc#newcode39 content/browser/compositor/gpu_browser_compositor_output_surface.cc:39: GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( I think this still has value. As ...
4 years ago (2016-12-02 22:47:08 UTC) #55
stanisc
https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/gpu_browser_compositor_output_surface.cc File content/browser/compositor/gpu_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2511273002/diff/130001/content/browser/compositor/gpu_browser_compositor_output_surface.cc#newcode39 content/browser/compositor/gpu_browser_compositor_output_surface.cc:39: GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( On 2016/12/02 22:47:07, danakj wrote: > I think ...
4 years ago (2016-12-03 01:02:20 UTC) #62
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/2511273002/170001
4 years ago (2016-12-03 01:03:16 UTC) #65
commit-bot: I haz the power
Committed patchset #10 (id:170001)
4 years ago (2016-12-03 01:24:18 UTC) #68
commit-bot: I haz the power
4 years ago (2016-12-03 01:26:11 UTC) #70
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/3566f880e80d65a57b7e084ccd55030972585c98
Cr-Commit-Position: refs/heads/master@{#436122}

Powered by Google App Engine
This is Rietveld 408576698