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

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

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compile Created 5 years 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_ui_shim.cc
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index fde15261b0c2dacf8f50277716cb473ab49fb8ea..e33c52c79f54013706f68231246a1f201ced8207 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -25,7 +25,6 @@
#include "content/public/browser/browser_thread.h"
#if defined(OS_MACOSX)
-#include "content/browser/browser_io_surface_manager_mac.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
#endif
@@ -245,24 +244,12 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
content::GpuSurfaceTracker::Get()->AcquireNativeWidget(
params.surface_id);
base::ScopedCFTypeRef<IOSurfaceRef> io_surface;
- CAContextID ca_context_id = 0;
-
- switch (ui::GetSurfaceHandleType(params.surface_handle)) {
- case ui::kSurfaceHandleTypeIOSurface: {
- IOSurfaceID io_surface_id =
- ui::IOSurfaceIDFromSurfaceHandle(params.surface_handle);
- io_surface.reset(
- BrowserIOSurfaceManager::GetInstance()->AcquireIOSurface(
- gfx::GenericSharedMemoryId(io_surface_id)));
- break;
- }
- case ui::kSurfaceHandleTypeCAContext: {
- ca_context_id = ui::CAContextIDFromSurfaceHandle(params.surface_handle);
- break;
- }
- default:
- DLOG(ERROR) << "Unrecognized accelerated frame type.";
- return;
+ CAContextID ca_context_id = params.ca_context_id;
+
+ DCHECK((params.ca_context_id == 0) ^
+ (params.io_surface.get() == MACH_PORT_NULL));
+ if (params.io_surface.get()) {
+ io_surface.reset(IOSurfaceLookupFromMachPort(params.io_surface));
}
ui::AcceleratedWidgetMacGotFrame(native_widget, ca_context_id, io_surface,

Powered by Google App Engine
This is Rietveld 408576698