OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/child/child_gpu_memory_buffer_manager.h" | 5 #include "content/child/child_gpu_memory_buffer_manager.h" |
6 | 6 |
7 #include "content/common/child_process_messages.h" | 7 #include "content/common/child_process_messages.h" |
8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" | 8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 ChildGpuMemoryBufferManager::ChildGpuMemoryBufferManager( | 23 ChildGpuMemoryBufferManager::ChildGpuMemoryBufferManager( |
24 ThreadSafeSender* sender) | 24 ThreadSafeSender* sender) |
25 : sender_(sender) { | 25 : sender_(sender) { |
26 } | 26 } |
27 | 27 |
28 ChildGpuMemoryBufferManager::~ChildGpuMemoryBufferManager() { | 28 ChildGpuMemoryBufferManager::~ChildGpuMemoryBufferManager() { |
29 } | 29 } |
30 | 30 |
31 scoped_ptr<gfx::GpuMemoryBuffer> | 31 scoped_ptr<gfx::GpuMemoryBuffer> |
32 ChildGpuMemoryBufferManager::AllocateGpuMemoryBuffer( | 32 ChildGpuMemoryBufferManager::AllocateGpuMemoryBuffer(const gfx::Size& size, |
33 const gfx::Size& size, | 33 gfx::BufferFormat format, |
34 gfx::GpuMemoryBuffer::Format format, | 34 gfx::BufferUsage usage) { |
35 gfx::GpuMemoryBuffer::Usage usage) { | |
36 TRACE_EVENT2("renderer", | 35 TRACE_EVENT2("renderer", |
37 "ChildGpuMemoryBufferManager::AllocateGpuMemoryBuffer", | 36 "ChildGpuMemoryBufferManager::AllocateGpuMemoryBuffer", |
38 "width", | 37 "width", |
39 size.width(), | 38 size.width(), |
40 "height", | 39 "height", |
41 size.height()); | 40 size.height()); |
42 | 41 |
43 gfx::GpuMemoryBufferHandle handle; | 42 gfx::GpuMemoryBufferHandle handle; |
44 IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer( | 43 IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer( |
45 size.width(), size.height(), format, usage, &handle); | 44 size.width(), size.height(), format, usage, &handle); |
(...skipping 19 matching lines...) Expand all Loading... |
65 } | 64 } |
66 | 65 |
67 void ChildGpuMemoryBufferManager::SetDestructionSyncPoint( | 66 void ChildGpuMemoryBufferManager::SetDestructionSyncPoint( |
68 gfx::GpuMemoryBuffer* buffer, | 67 gfx::GpuMemoryBuffer* buffer, |
69 uint32 sync_point) { | 68 uint32 sync_point) { |
70 static_cast<GpuMemoryBufferImpl*>(buffer) | 69 static_cast<GpuMemoryBufferImpl*>(buffer) |
71 ->set_destruction_sync_point(sync_point); | 70 ->set_destruction_sync_point(sync_point); |
72 } | 71 } |
73 | 72 |
74 } // namespace content | 73 } // namespace content |
OLD | NEW |