Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/child_process_host_impl.h" | 5 #include "content/common/child_process_host_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 uint32 width, | 315 uint32 width, |
| 316 uint32 height, | 316 uint32 height, |
| 317 gfx::GpuMemoryBuffer::Format format, | 317 gfx::GpuMemoryBuffer::Format format, |
| 318 gfx::GpuMemoryBuffer::Usage usage, | 318 gfx::GpuMemoryBuffer::Usage usage, |
| 319 gfx::GpuMemoryBufferHandle* handle) { | 319 gfx::GpuMemoryBufferHandle* handle) { |
| 320 // TODO(reveman): Add support for other types of GpuMemoryBuffers. | 320 // TODO(reveman): Add support for other types of GpuMemoryBuffers. |
| 321 | 321 |
| 322 // AllocateForChildProcess() will check if |width| and |height| are valid | 322 // AllocateForChildProcess() will check if |width| and |height| are valid |
| 323 // and handle failure in a controlled way when not. We just need to make | 323 // and handle failure in a controlled way when not. We just need to make |
| 324 // sure |format| and |usage| are supported here. | 324 // sure |format| and |usage| are supported here. |
| 325 if (GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) && | 325 if (!GpuMemoryBufferImplSharedMemory::IsFormatSupported(format)) |
| 326 usage == gfx::GpuMemoryBuffer::MAP) { | 326 return; |
|
reveman
2015/05/20 14:26:08
just change this line to "GpuMemoryBufferImplShare
danakj
2015/05/20 17:51:14
Done.
| |
| 327 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( | 327 if (usage != gfx::GpuMemoryBuffer::MAP && |
| 328 g_next_gpu_memory_buffer_id.GetNext(), | 328 usage != gfx::GpuMemoryBuffer::PERSISTENT_MAP) |
| 329 gfx::Size(width, height), | 329 return; |
| 330 format, | 330 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( |
| 331 peer_process_.Handle()); | 331 g_next_gpu_memory_buffer_id.GetNext(), gfx::Size(width, height), format, |
| 332 } | 332 peer_process_.Handle()); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( | 335 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |
| 336 gfx::GpuMemoryBufferId id, | 336 gfx::GpuMemoryBufferId id, |
| 337 uint32 sync_point) { | 337 uint32 sync_point) { |
| 338 // Note: Nothing to do here as ownership of shared memory backed | 338 // Note: Nothing to do here as ownership of shared memory backed |
| 339 // GpuMemoryBuffers is passed with IPC. | 339 // GpuMemoryBuffers is passed with IPC. |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace content | 342 } // namespace content |
| OLD | NEW |