gfx::GpuMemoryBufferHandle
GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer(
- const gfx::GpuMemoryBufferId& id,
+ gfx::GpuMemoryBufferId id,
const gfx::Size& size,
- unsigned internalformat) {
+ gfx::GpuMemoryBuffer::Format format,
+ int client_id) {
base::ScopedCFTypeRef<CFMutableDictionaryRef> properties;
properties.reset(CFDictionaryCreateMutable(kCFAllocatorDefault,
0,
AddIntegerValue(properties, kIOSurfaceHeight, size.height());
AddIntegerValue(properties,
kIOSurfaceBytesPerElement,
- GpuMemoryBufferImpl::BytesPerPixel(internalformat));
+ GpuMemoryBufferImpl::BytesPerPixel(format));
AddIntegerValue(properties,
kIOSurfacePixelFormat,
- GpuMemoryBufferImplIOSurface::PixelFormat(internalformat));
+ GpuMemoryBufferImplIOSurface::PixelFormat(format));
// TODO(reveman): Remove this when using a mach_port_t to transfer
// IOSurface to browser and renderer process. crbug.com/323304
AddBooleanValue(properties, kIOSurfaceIsGlobal, true);
if (!io_surface)
return gfx::GpuMemoryBufferHandle();
- IOSurfaceMapKey key(id.primary_id, id.secondary_id);
+ IOSurfaceMapKey key(id, client_id);
DCHECK(io_surfaces_.find(key) == io_surfaces_.end());
io_surfaces_[key] = io_surface;
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::IO_SURFACE_BUFFER;
- handle.global_id = id;
+ handle.id = id;
handle.io_surface_id = IOSurfaceGetID(io_surface);
return handle;
}
void GpuMemoryBufferFactoryIOSurface::DestroyGpuMemoryBuffer(
- const gfx::GpuMemoryBufferId& id) {
- IOSurfaceMapKey key(id.primary_id, id.secondary_id);
+ gfx::GpuMemoryBufferId id,
+ int client_id) {
+ IOSurfaceMapKey key(id, client_id);
IOSurfaceMap::iterator it = io_surfaces_.find(key);
if (it != io_surfaces_.end())
io_surfaces_.erase(it);
scoped_refptr<gfx::GLImage>
GpuMemoryBufferFactoryIOSurface::CreateImageForGpuMemoryBuffer(
- const gfx::GpuMemoryBufferId& id,
+ gfx::GpuMemoryBufferId id,
const gfx::Size& size,
- unsigned internalformat) {
- IOSurfaceMapKey key(id.primary_id, id.secondary_id);
+ gfx::GpuMemoryBuffer::Format format,
+ int client_id) {
+ IOSurfaceMapKey key(id, client_id);
IOSurfaceMap::iterator it = io_surfaces_.find(key);
if (it == io_surfaces_.end())
return scoped_refptr<gfx::GLImage>();