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

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: Rebase Created 4 years, 12 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
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/in_process_io_surface_manager_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4b84d6da762a7437d78f3e4d3f6d940b3daffa23..083c99d457ab4158f20897692dd240c3e026ec1c 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -26,7 +26,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
@@ -246,24 +245,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,
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/in_process_io_surface_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698