Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / common / gpu / client / gpu_memory_buffer_impl_mac.cc
index 489ddd9..c4e9a03 100644 (file)
 namespace content {
 
 // static
-void GpuMemoryBufferImpl::Create(const gfx::Size& size,
-                                 unsigned internalformat,
-                                 unsigned usage,
+void GpuMemoryBufferImpl::Create(gfx::GpuMemoryBufferId id,
+                                 const gfx::Size& size,
+                                 Format format,
+                                 Usage usage,
                                  int client_id,
                                  const CreationCallback& callback) {
-  if (GpuMemoryBufferImplIOSurface::IsConfigurationSupported(internalformat,
-                                                             usage)) {
-    GpuMemoryBufferImplIOSurface::Create(
-        size, internalformat, usage, client_id, callback);
+  if (GpuMemoryBufferImplIOSurface::IsConfigurationSupported(format, usage)) {
+    GpuMemoryBufferImplIOSurface::Create(id, size, format, client_id, callback);
     return;
   }
 
   if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
-          size, internalformat, usage)) {
-    GpuMemoryBufferImplSharedMemory::Create(
-        size, internalformat, usage, callback);
+          size, format, usage)) {
+    GpuMemoryBufferImplSharedMemory::Create(id, size, format, callback);
     return;
   }
 
@@ -34,23 +32,23 @@ void GpuMemoryBufferImpl::Create(const gfx::Size& size,
 
 // static
 void GpuMemoryBufferImpl::AllocateForChildProcess(
+    gfx::GpuMemoryBufferId id,
     const gfx::Size& size,
-    unsigned internalformat,
-    unsigned usage,
+    Format format,
+    Usage usage,
     base::ProcessHandle child_process,
     int child_client_id,
     const AllocationCallback& callback) {
-  if (GpuMemoryBufferImplIOSurface::IsConfigurationSupported(internalformat,
-                                                             usage)) {
+  if (GpuMemoryBufferImplIOSurface::IsConfigurationSupported(format, usage)) {
     GpuMemoryBufferImplIOSurface::AllocateForChildProcess(
-        size, internalformat, usage, child_client_id, callback);
+        id, size, format, child_client_id, callback);
     return;
   }
 
   if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
-          size, internalformat, usage)) {
+          size, format, usage)) {
     GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
-        size, internalformat, child_process, callback);
+        id, size, format, child_process, callback);
     return;
   }
 
@@ -60,23 +58,36 @@ void GpuMemoryBufferImpl::AllocateForChildProcess(
 // static
 void GpuMemoryBufferImpl::DeletedByChildProcess(
     gfx::GpuMemoryBufferType type,
-    const gfx::GpuMemoryBufferId& id,
-    base::ProcessHandle child_process) {
+    gfx::GpuMemoryBufferId id,
+    base::ProcessHandle child_process,
+    int child_client_id,
+    uint32 sync_point) {
+  switch (type) {
+    case gfx::SHARED_MEMORY_BUFFER:
+      break;
+    case gfx::IO_SURFACE_BUFFER:
+      GpuMemoryBufferImplIOSurface::DeletedByChildProcess(
+          id, child_client_id, sync_point);
+      break;
+    default:
+      NOTREACHED();
+      break;
+  }
 }
 
 // static
 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle(
     const gfx::GpuMemoryBufferHandle& handle,
     const gfx::Size& size,
-    unsigned internalformat,
+    Format format,
     const DestructionCallback& callback) {
   switch (handle.type) {
     case gfx::SHARED_MEMORY_BUFFER:
       return GpuMemoryBufferImplSharedMemory::CreateFromHandle(
-          handle, size, internalformat, callback);
+          handle, size, format, callback);
     case gfx::IO_SURFACE_BUFFER:
       return GpuMemoryBufferImplIOSurface::CreateFromHandle(
-          handle, size, internalformat, callback);
+          handle, size, format, callback);
     default:
       return scoped_ptr<GpuMemoryBufferImpl>();
   }