| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" |
| 10 #include "content/common/child_process_messages.h" | 11 #include "content/common/child_process_messages.h" |
| 11 #include "content/common/generic_shared_memory_id_generator.h" | 12 #include "content/common/generic_shared_memory_id_generator.h" |
| 13 #include "gpu/ipc/client/gpu_fence_impl.h" |
| 12 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" | 14 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" |
| 13 | 15 |
| 14 namespace content { | 16 namespace content { |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| 17 void DeletedGpuMemoryBuffer(ThreadSafeSender* sender, | 19 void DeletedGpuMemoryBuffer(ThreadSafeSender* sender, |
| 18 gfx::GpuMemoryBufferId id, | 20 gfx::GpuMemoryBufferId id, |
| 19 const gpu::SyncToken& sync_token) { | 21 const gpu::SyncToken& sync_token) { |
| 20 TRACE_EVENT0("renderer", | 22 TRACE_EVENT0("renderer", |
| 21 "ChildGpuMemoryBufferManager::DeletedGpuMemoryBuffer"); | 23 "ChildGpuMemoryBufferManager::DeletedGpuMemoryBuffer"); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return nullptr; | 79 return nullptr; |
| 78 } | 80 } |
| 79 | 81 |
| 80 void ChildGpuMemoryBufferManager::SetDestructionSyncToken( | 82 void ChildGpuMemoryBufferManager::SetDestructionSyncToken( |
| 81 gfx::GpuMemoryBuffer* buffer, | 83 gfx::GpuMemoryBuffer* buffer, |
| 82 const gpu::SyncToken& sync_token) { | 84 const gpu::SyncToken& sync_token) { |
| 83 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( | 85 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( |
| 84 sync_token); | 86 sync_token); |
| 85 } | 87 } |
| 86 | 88 |
| 89 std::unique_ptr<gfx::GpuFence> ChildGpuMemoryBufferManager::CreateGpuFence() { |
| 90 gfx::GpuFenceHandle handle; |
| 91 IPC::Message* message = new ChildProcessHostMsg_SyncCreateGpuFence(&handle); |
| 92 bool success = sender_->Send(message); |
| 93 if (!success) |
| 94 return nullptr; |
| 95 std::unique_ptr<gpu::GpuFenceImpl> fence(new gpu::GpuFenceImpl(handle)); |
| 96 return std::move(fence); |
| 97 } |
| 98 |
| 99 std::unique_ptr<gfx::GpuFence> |
| 100 ChildGpuMemoryBufferManager::CreateGpuFenceFromHandle( |
| 101 const gfx::GpuFenceHandle& handle) { |
| 102 NOTIMPLEMENTED(); |
| 103 return nullptr; |
| 104 } |
| 105 |
| 106 gfx::GpuFence* ChildGpuMemoryBufferManager::GpuFenceFromClientFence( |
| 107 ClientFence fence) { |
| 108 return gpu::GpuFenceImpl::FromClientFence(fence); |
| 109 } |
| 110 |
| 87 } // namespace content | 111 } // namespace content |
| OLD | NEW |