Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / common / gpu / gpu_memory_buffer_factory_io_surface.cc
index 8c9fee5..182f826 100644 (file)
@@ -37,9 +37,10 @@ GpuMemoryBufferFactoryIOSurface::~GpuMemoryBufferFactoryIOSurface() {
 
 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,
@@ -49,10 +50,10 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer(
   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);
@@ -61,20 +62,21 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer(
   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);
@@ -82,10 +84,11 @@ void GpuMemoryBufferFactoryIOSurface::DestroyGpuMemoryBuffer(
 
 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>();