From 9f6cac12a46fb8960d4dc25ae5901906697a45f8 Mon Sep 17 00:00:00 2001 From: kbr Date: Sun, 9 Aug 2015 11:54:45 -0700 Subject: Revert of Mac Overlays: Add GPU back-pressure (patchset #8 id:140001 of https://codereview.chromium.org/1273563002/ ) Reason for revert: This broke the WebGL 2.0 prototype on Mac OS -- please see https://code.google.com/p/chromium/issues/detail?id=515696#c16 for details. Original issue's description: > Mac Overlays: Add GPU back-pressure > > Issue a GL fence after every SwapBuffers. Do not call -[CALayer > setContents:] with the content being rendered by that SwapBuffers until > the fence has passed. > > Query the previous's frame's GL fence at the beginning of each > SwapBuffers. Also issue a callback to query the GL fence at the > mid-point of the VSync period (if there is no subsequent SwapBuffers, > or if the frame takes more than one VSync to render). > > Note that waiting for the GL fence to complete before calling -[CALayer > setContents] is not required for correctness -- only the expected content > (everything before the glFlush) will appear in the layer. Rather, the > reason for waiting for the GL fence is to make the time at which the > content will appear on-screen more reliable. > > Because there may be multiple calls to SwapBuffers in flight, store the > data necessary to call -[CALayer setContents] in a PendingSwap > structure. Maintain a queue of these structures. > > Because the ImageTransportSurface does not know anything about the > VSync period, send the CGDirectDisplayID for the attached display to the > ImageTransportSurface in the AcceleratedSurfaceMsg_BufferPresented IPC > (which is where the CGL renderer ID is already communicated). Send this > information instead of the raw VSync parameters so that the updates to > all windows on a single display may be coalesced into a single callback > in the future. > > Note that this display is the display that is used for vsync by the > RenderWidgetHostViewMac, so if vsync is disabled, it will be 0. > > Separate gfx::ScopedSetGLToRealGLApi into its own header file to > simplify header orders. > > Access the IOSurface of the GLImageIOSurface directly, rather than > using its ScheduleOverlayPlane method. This simplifies things > immediately, in that we can reason about the underlying IOSurface's > lifetime better than weak pointers to images. It will also simplify > the implementation of partial swap and multiple overlays. > > BUG=515696 > > Committed: https://crrev.com/5c207cac73c835b5f362670d6b46333dfae1f4c4 > Cr-Commit-Position: refs/heads/master@{#342548} TBR=dcheng@chromium.org,jbauman@chromium.org,tapted@chromium.org,ccameron@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=515696 Review URL: https://codereview.chromium.org/1280033004 Cr-Commit-Position: refs/heads/master@{#342566} --- content/browser/gpu/gpu_process_host_ui_shim.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'content/browser/gpu') diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index 040daa3..637f4bc 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -308,8 +308,7 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( params.scale_factor, params.damage_rect, base::Bind(&OnSurfaceDisplayedCallback, params.surface_id), - &ack_params.disable_throttling, &ack_params.renderer_id, - &ack_params.display_id_for_vsync); + &ack_params.disable_throttling, &ack_params.renderer_id); } Send(new AcceleratedSurfaceMsg_BufferPresented(params.route_id, ack_params)); } -- cgit v1.1