From be2457f54bb9018e4e6262716e830c1dc4f07e72 Mon Sep 17 00:00:00 2001 From: ccameron Date: Mon, 11 Jan 2016 17:15:40 -0800 Subject: cc: Allow returning overlay resources upon swap completion On Mac, the only way to reliably know that overlay resources are no longer in use is by the function IOSurfaceIsInUse (which is checked by the functions ResourceProvider::InUseByConsumer and ResourceProvider::CanLockForWrite). IOSurfaceIsInUse will start returning true as soon as a CALayer has its contents set to an IOSurface, which happens during swap in the GPU process (in particular, when a Mach port for the IOSurface is created for sending to the WindowServer process), and so the earliest time that resources may be returned to the renderer process is swap completion. Repurpose a now-extinct flag to indicate that overlay resources are to be returned immediately upon swap acknowledgement, and add tests to ensure this behavior. BUG=558701 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1523063005 Cr-Commit-Position: refs/heads/master@{#368751} --- cc/surfaces/display.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cc/surfaces') diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc index 64a2906..c0a8bde 100644 --- a/cc/surfaces/display.cc +++ b/cc/surfaces/display.cc @@ -297,6 +297,8 @@ void Display::DidSwapBuffers() { void Display::DidSwapBuffersComplete() { if (scheduler_) scheduler_->DidSwapBuffersComplete(); + if (renderer_) + renderer_->SwapBuffersComplete(); } void Display::CommitVSyncParameters(base::TimeTicks timebase, -- cgit v1.1