Chromium Code Reviews| Index: content/common/child_process_host_impl.cc |
| diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc |
| index 69a63507f5866808d58339dc9aa9f17ccc654caa..a398cda6d026d1ca13881d7ee2e5e09e7a88631d 100644 |
| --- a/content/common/child_process_host_impl.cc |
| +++ b/content/common/child_process_host_impl.cc |
| @@ -322,14 +322,14 @@ void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer( |
| // AllocateForChildProcess() will check if |width| and |height| are valid |
| // and handle failure in a controlled way when not. We just need to make |
| // sure |format| and |usage| are supported here. |
| - if (GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) && |
| - usage == gfx::GpuMemoryBuffer::MAP) { |
|
reveman
2015/05/20 14:26:08
just change this line to "GpuMemoryBufferImplShare
danakj
2015/05/20 17:51:14
Done.
|
| - *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( |
| - g_next_gpu_memory_buffer_id.GetNext(), |
| - gfx::Size(width, height), |
| - format, |
| - peer_process_.Handle()); |
| - } |
| + if (!GpuMemoryBufferImplSharedMemory::IsFormatSupported(format)) |
| + return; |
| + if (usage != gfx::GpuMemoryBuffer::MAP && |
| + usage != gfx::GpuMemoryBuffer::PERSISTENT_MAP) |
| + return; |
| + *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( |
| + g_next_gpu_memory_buffer_id.GetNext(), gfx::Size(width, height), format, |
| + peer_process_.Handle()); |
| } |
| void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |