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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_io_surface.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/common/child_process_messages.h ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
index 9794bbfa47dedff6ba239452bb39143554ecfac5..2df99949367712fe14dd55b81d452967d54f0f14 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
@@ -7,7 +7,7 @@
#include "base/logging.h"
#include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h"
#include "ui/gfx/buffer_format_util.h"
-#include "ui/gfx/mac/io_surface_manager.h"
+#include "ui/gfx/mac/io_surface.h"
namespace content {
namespace {
@@ -25,8 +25,7 @@ uint32_t LockFlags(gfx::BufferUsage usage) {
return 0;
}
-void FreeIOSurfaceForTesting(gfx::GpuMemoryBufferId id) {
- gfx::IOSurfaceManager::GetInstance()->UnregisterIOSurface(id, 0);
+void NoOp() {
}
} // namespace
@@ -54,7 +53,7 @@ GpuMemoryBufferImplIOSurface::CreateFromHandle(
gfx::BufferUsage usage,
const DestructionCallback& callback) {
base::ScopedCFTypeRef<IOSurfaceRef> io_surface(
- gfx::IOSurfaceManager::GetInstance()->AcquireIOSurface(handle.id));
+ IOSurfaceLookupFromMachPort(handle.mach_port.get()));
if (!io_surface)
return nullptr;
@@ -78,15 +77,13 @@ base::Closure GpuMemoryBufferImplIOSurface::AllocateForTesting(
gfx::BufferUsage usage,
gfx::GpuMemoryBufferHandle* handle) {
base::ScopedCFTypeRef<IOSurfaceRef> io_surface(
- gfx::IOSurfaceManager::CreateIOSurface(size, format));
+ gfx::CreateIOSurface(size, format));
DCHECK(io_surface);
gfx::GpuMemoryBufferId kBufferId(1);
- bool rv = gfx::IOSurfaceManager::GetInstance()->RegisterIOSurface(
- kBufferId, 0, io_surface);
- DCHECK(rv);
handle->type = gfx::IO_SURFACE_BUFFER;
handle->id = kBufferId;
- return base::Bind(&FreeIOSurfaceForTesting, kBufferId);
+ handle->mach_port.reset(IOSurfaceCreateMachPort(io_surface));
+ return base::Bind(&NoOp);
}
bool GpuMemoryBufferImplIOSurface::Map() {
« no previous file with comments | « content/common/child_process_messages.h ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698