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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 gfx::GpuMemoryBufferId id, | 287 gfx::GpuMemoryBufferId id, |
288 uint32 width, | 288 uint32 width, |
289 uint32 height, | 289 uint32 height, |
290 gfx::BufferFormat format, | 290 gfx::BufferFormat format, |
291 gfx::BufferUsage usage, | 291 gfx::BufferUsage usage, |
292 gfx::GpuMemoryBufferHandle* handle) { | 292 gfx::GpuMemoryBufferHandle* handle) { |
293 // TODO(reveman): Add support for other types of GpuMemoryBuffers. | 293 // TODO(reveman): Add support for other types of GpuMemoryBuffers. |
294 | 294 |
295 // AllocateForChildProcess() will check if |width| and |height| are valid | 295 // AllocateForChildProcess() will check if |width| and |height| are valid |
296 // and handle failure in a controlled way when not. We just need to make | 296 // and handle failure in a controlled way when not. We just need to make |
297 // sure |format| and |usage| are supported here. | 297 // sure |usage| is supported here. |
298 if (GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) && | 298 if (GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage)) { |
299 GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage)) { | |
300 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( | 299 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( |
301 id, gfx::Size(width, height), format, peer_process_.Handle()); | 300 id, gfx::Size(width, height), format, peer_process_.Handle()); |
302 } | 301 } |
303 } | 302 } |
304 | 303 |
305 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( | 304 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |
306 gfx::GpuMemoryBufferId id, | 305 gfx::GpuMemoryBufferId id, |
307 uint32 sync_point) { | 306 uint32 sync_point) { |
308 // Note: Nothing to do here as ownership of shared memory backed | 307 // Note: Nothing to do here as ownership of shared memory backed |
309 // GpuMemoryBuffers is passed with IPC. | 308 // GpuMemoryBuffers is passed with IPC. |
310 } | 309 } |
311 | 310 |
312 } // namespace content | 311 } // namespace content |
OLD | NEW |