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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 454243002: Make GPU back-pressure work with remote CALayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix flashes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 27496f526e00dd7e58d79ba12020f8cdf6cc877d..1430f37c3ee6990adbffa7516e140c19a10cd075 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -43,12 +43,6 @@
#include "ui/events/latency_info.h"
#include "ui/gl/gl_switches.h"
-#if defined(OS_MACOSX)
-#include <IOSurface/IOSurfaceAPI.h>
-#include "base/mac/scoped_cftyperef.h"
-#include "content/common/gpu/surface_handle_types_mac.h"
-#endif
-
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "content/common/sandbox_win.h"
@@ -758,44 +752,9 @@ void GpuProcessHost::OnGpuMemoryUmaStatsReceived(
}
#if defined(OS_MACOSX)
-namespace {
-void HoldIOSurfaceReference(base::ScopedCFTypeRef<IOSurfaceRef> io_surface) {}
-} // namespace
-
void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
const IPC::Message& message) {
RenderWidgetResizeHelper::Get()->PostGpuProcessMsg(host_id_, message);
-
- if (!IsDelegatedRendererEnabled())
- return;
-
- GpuHostMsg_AcceleratedSurfaceBuffersSwapped::Param param;
- if (!GpuHostMsg_AcceleratedSurfaceBuffersSwapped::Read(&message, &param))
- return;
- const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params = param.a;
-
- if (GetSurfaceHandleType(params.surface_handle) ==
- kSurfaceHandleTypeIOSurface) {
- // As soon as the frame is acked, the IOSurface may be thrown away by the
- // GPU process. Open the IOSurface and post a task referencing it to the UI
- // thread. This will keep the IOSurface from being thrown away until the UI
- // thread can open another reference to it, if needed.
- base::ScopedCFTypeRef<IOSurfaceRef> io_surface(IOSurfaceLookup(
- IOSurfaceIDFromSurfaceHandle(params.surface_handle)));
- BrowserThread::PostTask(BrowserThread::UI,
- FROM_HERE,
- base::Bind(HoldIOSurfaceReference, io_surface));
- }
-
- // If delegated rendering is enabled, then immediately acknowledge this frame
- // on the IO thread instead of the UI thread. The UI thread will wait on the
- // GPU process. If the UI thread were to be responsible for acking swaps,
- // then there would be a cycle and a potential deadlock. Back-pressure from
- // the GPU is provided through the compositor's output surface.
- AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
- ack_params.sync_point = 0;
- ack_params.renderer_id = 0;
- Send(new AcceleratedSurfaceMsg_BufferPresented(params.route_id, ack_params));
}
#endif
« no previous file with comments | « content/browser/compositor/browser_compositor_view_private_mac.mm ('k') | content/browser/gpu/gpu_process_host_ui_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698