Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: content/common/child_process_host_impl.cc

Issue 1139903005: Add PERSISTENT_MAP usage for GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: persistentmap: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage)) {
327 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( 327 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
328 g_next_gpu_memory_buffer_id.GetNext(), 328 g_next_gpu_memory_buffer_id.GetNext(), gfx::Size(width, height), format,
329 gfx::Size(width, height),
330 format,
331 peer_process_.Handle()); 329 peer_process_.Handle());
332 } 330 }
333 } 331 }
334 332
335 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( 333 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer(
336 gfx::GpuMemoryBufferId id, 334 gfx::GpuMemoryBufferId id,
337 uint32 sync_point) { 335 uint32 sync_point) {
338 // Note: Nothing to do here as ownership of shared memory backed 336 // Note: Nothing to do here as ownership of shared memory backed
339 // GpuMemoryBuffers is passed with IPC. 337 // GpuMemoryBuffers is passed with IPC.
340 } 338 }
341 339
342 } // namespace content 340 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698