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

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

Issue 1269503007: Unify graphics buffer format & usage enums for GpuMemoryBuffer & SurfaceFactoryOzone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add header to BUILD.gn Created 5 years, 4 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
« no previous file with comments | « content/common/child_process_host_impl.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 353 }
354 354
355 void ChildProcessHostImpl::OnShutdownRequest() { 355 void ChildProcessHostImpl::OnShutdownRequest() {
356 if (delegate_->CanShutdown()) 356 if (delegate_->CanShutdown())
357 Send(new ChildProcessMsg_Shutdown()); 357 Send(new ChildProcessMsg_Shutdown());
358 } 358 }
359 359
360 void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer( 360 void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer(
361 uint32 width, 361 uint32 width,
362 uint32 height, 362 uint32 height,
363 gfx::GpuMemoryBuffer::Format format, 363 gfx::BufferFormat format,
364 gfx::GpuMemoryBuffer::Usage usage, 364 gfx::BufferUsage usage,
365 gfx::GpuMemoryBufferHandle* handle) { 365 gfx::GpuMemoryBufferHandle* handle) {
366 // TODO(reveman): Add support for other types of GpuMemoryBuffers. 366 // TODO(reveman): Add support for other types of GpuMemoryBuffers.
367 367
368 // AllocateForChildProcess() will check if |width| and |height| are valid 368 // AllocateForChildProcess() will check if |width| and |height| are valid
369 // and handle failure in a controlled way when not. We just need to make 369 // and handle failure in a controlled way when not. We just need to make
370 // sure |format| and |usage| are supported here. 370 // sure |format| and |usage| are supported here.
371 if (GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) && 371 if (GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) &&
372 GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage)) { 372 GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage)) {
373 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( 373 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
374 g_next_gpu_memory_buffer_id.GetNext(), gfx::Size(width, height), format, 374 g_next_gpu_memory_buffer_id.GetNext(), gfx::Size(width, height), format,
375 peer_process_.Handle()); 375 peer_process_.Handle());
376 } 376 }
377 } 377 }
378 378
379 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( 379 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer(
380 gfx::GpuMemoryBufferId id, 380 gfx::GpuMemoryBufferId id,
381 uint32 sync_point) { 381 uint32 sync_point) {
382 // Note: Nothing to do here as ownership of shared memory backed 382 // Note: Nothing to do here as ownership of shared memory backed
383 // GpuMemoryBuffers is passed with IPC. 383 // GpuMemoryBuffers is passed with IPC.
384 } 384 }
385 385
386 } // namespace content 386 } // namespace content
OLDNEW
« no previous file with comments | « content/common/child_process_host_impl.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698