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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_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/gpu/gpu_memory_buffer_factory_io_surface.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
index f8a74d626e63c047b934b34e51e9d22825b0da37..49fab37b5960e7889715f5221b92a4ecdc5cc34c 100644
--- a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
@@ -9,7 +9,7 @@
#include "base/logging.h"
#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
#include "ui/gfx/buffer_format_util.h"
-#include "ui/gfx/mac/io_surface_manager.h"
+#include "ui/gfx/mac/io_surface.h"
#include "ui/gl/gl_image_io_surface.h"
namespace content {
@@ -49,15 +49,10 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer(
int client_id,
gfx::PluginWindowHandle surface_handle) {
base::ScopedCFTypeRef<IOSurfaceRef> io_surface(
- gfx::IOSurfaceManager::CreateIOSurface(size, format));
+ gfx::CreateIOSurface(size, format));
if (!io_surface)
return gfx::GpuMemoryBufferHandle();
- if (!gfx::IOSurfaceManager::GetInstance()->RegisterIOSurface(id, client_id,
- io_surface)) {
- return gfx::GpuMemoryBufferHandle();
- }
-
{
base::AutoLock lock(io_surfaces_lock_);
@@ -69,6 +64,7 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer(
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::IO_SURFACE_BUFFER;
handle.id = id;
+ handle.mach_port.reset(IOSurfaceCreateMachPort(io_surface));
return handle;
}
@@ -93,8 +89,6 @@ void GpuMemoryBufferFactoryIOSurface::DestroyGpuMemoryBuffer(
DCHECK(io_surfaces_.find(key) != io_surfaces_.end());
io_surfaces_.erase(key);
}
-
- gfx::IOSurfaceManager::GetInstance()->UnregisterIOSurface(id, client_id);
}
gpu::ImageFactory* GpuMemoryBufferFactoryIOSurface::AsImageFactory() {
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_io_surface.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698