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

Issue 1416493010: Clean up Mac swap acknowledgement code (Closed)

Created:
5 years, 1 month ago by ccameron
Modified:
5 years, 1 month ago
CC:
chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, jam, jbauman+watch_chromium.org, kalyank, nona+watch_chromium.org, piman+watch_chromium.org, shuchen+watch_chromium.org, sievers+watch_chromium.org, James Su, tdanderson+views_chromium.org, tfarina, yusukes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Clean up Mac swap acknowledgement code Mac swap acks differ from other platforms for three reasons 1. When a swap ack comes from the GPU process, it does not mean that the content is necessarily on-screen yet -- it may be that we will need to wait for that content to be drawn into a CAOpenGLLayer. For this reason, we created a separate OnSurfaceDisplayed callback, which happens when the surface is actually drawn. 2. Smooth resize on Mac requires that the IPCs for swap acks go through the GpuProcessHostUIShim (as opposed to the command buffer stub, as on other platforms). 3. Swap acks coming from the GPU process carry additional information that is needed to get the content on the screen on Mac (in particular, the CAContextID or IOSurface). With the consolidation of display paths on Mac, reason 1 is finally gone. The other reasons remain, and for this reason, Mac still needs to be slightly different than the other platforms (which use the GpuCommandBufferMsg_SwapBuffersCompleted IPC, and a callback from CommandBufferProxyImpl to get the ack). Instead of calling ImageTransportFactory::OnSurfaceDisplayed, call instead ImageTransportFactory::OnSwapBuffersCompleted, which will call BrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted, which is where all other platforms' swap acks bottom out as well (their calls come from the CommandBufferProxyImpl). In the process of this, move OnGpuSwapBuffersCompleted from being named OnSwapBuffersCompleted in GpuBrowserCompositorOutputSurface to being a method of BrowserCompositorOutputSurface (with Gpu in its name, to indicate the source). Delete the web of callbacks going through AcceleratedWidgetMac that were responsible for the delayed swap-ack. Remove now-unused IPC fields. Committed: https://crrev.com/4d4a02b8db7c319f26e823fcea22fd2b3797f538 Cr-Commit-Position: refs/heads/master@{#356956}

Patch Set 1 #

Patch Set 2 : Update function name #

Total comments: 2

Patch Set 3 : Update latency info #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -322 lines) Patch
M content/browser/compositor/browser_compositor_output_surface.h View 1 2 chunks +9 lines, -1 line 0 comments Download
M content/browser/compositor/gpu_browser_compositor_output_surface.h View 1 3 chunks +3 lines, -4 lines 0 comments Download
M content/browser/compositor/gpu_browser_compositor_output_surface.cc View 1 2 chunks +4 lines, -14 lines 0 comments Download
M content/browser/compositor/gpu_process_transport_factory.h View 1 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/compositor/gpu_process_transport_factory.cc View 1 1 chunk +5 lines, -2 lines 0 comments Download
M content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h View 1 1 chunk +4 lines, -5 lines 0 comments Download
M content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc View 1 2 chunks +3 lines, -13 lines 0 comments Download
M content/browser/compositor/image_transport_factory.h View 1 3 chunks +7 lines, -1 line 0 comments Download
M content/browser/compositor/offscreen_browser_compositor_output_surface.h View 1 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/compositor/reflector_impl_unittest.cc View 1 1 chunk +6 lines, -1 line 0 comments Download
M content/browser/compositor/software_browser_compositor_output_surface.h View 1 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/compositor/software_browser_compositor_output_surface.cc View 1 1 chunk +5 lines, -4 lines 0 comments Download
M content/browser/compositor/software_output_device_mac.mm View 1 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/compositor/test/no_transport_image_transport_factory.h View 1 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/gpu/gpu_process_host_ui_shim.cc View 1 3 chunks +10 lines, -16 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.h View 1 chunk +1 line, -4 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 3 chunks +2 lines, -67 lines 0 comments Download
M content/common/gpu/gpu_messages.h View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M content/common/gpu/image_transport_surface_overlay_mac.mm View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M ui/accelerated_widget_mac/accelerated_widget_mac.h View 5 chunks +12 lines, -56 lines 0 comments Download
M ui/accelerated_widget_mac/accelerated_widget_mac.mm View 1 2 6 chunks +22 lines, -101 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.h View 1 chunk +1 line, -4 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.mm View 3 chunks +1 line, -10 lines 0 comments Download
M ui/views/widget/native_widget_mac_unittest.mm View 1 chunk +3 lines, -4 lines 0 comments Download

Messages

Total messages: 23 (8 generated)
ccameron
More cleanup and code-deleting
5 years, 1 month ago (2015-10-27 19:59:25 UTC) #5
Ken Russell (switch to Gerrit)
Is there another reviewer who could take this? I'm under a big crunch right now ...
5 years, 1 month ago (2015-10-27 20:03:49 UTC) #7
ccameron
Sure -- jbauman, can you take a look?
5 years, 1 month ago (2015-10-27 20:39:52 UTC) #8
ccameron
Adding sadrul@ for ui/ stamp, dcheng@ for _messages.h stamp.
5 years, 1 month ago (2015-10-28 21:54:48 UTC) #10
dcheng
Yay, removed code! deletions in gpu_messages.h lgtm!
5 years, 1 month ago (2015-10-28 21:55:34 UTC) #11
jbauman
Generally makes sense; just one question. https://codereview.chromium.org/1416493010/diff/20001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (left): https://codereview.chromium.org/1416493010/diff/20001/content/browser/renderer_host/render_widget_host_view_mac.mm#oldcode542 content/browser/renderer_host/render_widget_host_view_mac.mm:542: latency_info.AddLatencyNumberWithTimestamp( Is this ...
5 years, 1 month ago (2015-10-28 22:27:30 UTC) #12
ccameron
https://codereview.chromium.org/1416493010/diff/20001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (left): https://codereview.chromium.org/1416493010/diff/20001/content/browser/renderer_host/render_widget_host_view_mac.mm#oldcode542 content/browser/renderer_host/render_widget_host_view_mac.mm:542: latency_info.AddLatencyNumberWithTimestamp( On 2015/10/28 22:27:30, jbauman wrote: > Is this ...
5 years, 1 month ago (2015-10-28 22:37:05 UTC) #13
jbauman
On 2015/10/28 22:37:05, ccameron wrote: > https://codereview.chromium.org/1416493010/diff/20001/content/browser/renderer_host/render_widget_host_view_mac.mm > File content/browser/renderer_host/render_widget_host_view_mac.mm (left): > > https://codereview.chromium.org/1416493010/diff/20001/content/browser/renderer_host/render_widget_host_view_mac.mm#oldcode542 > ...
5 years, 1 month ago (2015-10-28 22:51:47 UTC) #14
sadrul
On 2015/10/28 21:54:48, ccameron wrote: > Adding sadrul@ for ui/ stamp, dcheng@ for _messages.h stamp. ...
5 years, 1 month ago (2015-10-29 06:23:25 UTC) #15
ccameron
On 2015/10/28 22:51:47, jbauman wrote: > On 2015/10/28 22:37:05, ccameron wrote: > > > https://codereview.chromium.org/1416493010/diff/20001/content/browser/renderer_host/render_widget_host_view_mac.mm ...
5 years, 1 month ago (2015-10-29 19:57:10 UTC) #16
jbauman
On 2015/10/29 19:57:10, ccameron wrote: > On 2015/10/28 22:51:47, jbauman wrote: > > On 2015/10/28 ...
5 years, 1 month ago (2015-10-29 20:58:36 UTC) #17
ccameron
Thanks!
5 years, 1 month ago (2015-10-29 21:17:28 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1416493010/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1416493010/40001
5 years, 1 month ago (2015-10-29 21:19:01 UTC) #21
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 1 month ago (2015-10-29 21:35:12 UTC) #22
commit-bot: I haz the power
5 years, 1 month ago (2015-10-29 21:35:57 UTC) #23
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/4d4a02b8db7c319f26e823fcea22fd2b3797f538
Cr-Commit-Position: refs/heads/master@{#356956}

Powered by Google App Engine
This is Rietveld 408576698