| 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 "base/memory/ptr_util.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( | 91 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( |
| 92 sync_token); | 92 sync_token); |
| 93 } | 93 } |
| 94 | 94 |
| 95 std::unique_ptr<gfx::GpuFence> ChildGpuMemoryBufferManager::CreateGpuFence() { | 95 std::unique_ptr<gfx::GpuFence> ChildGpuMemoryBufferManager::CreateGpuFence() { |
| 96 gfx::GpuFenceHandle handle; | 96 gfx::GpuFenceHandle handle; |
| 97 IPC::Message* message = new ChildProcessHostMsg_SyncCreateGpuFence(&handle); | 97 IPC::Message* message = new ChildProcessHostMsg_SyncCreateGpuFence(&handle); |
| 98 bool success = sender_->Send(message); | 98 bool success = sender_->Send(message); |
| 99 if (!success) | 99 if (!success) |
| 100 return nullptr; | 100 return nullptr; |
| 101 std::unique_ptr<gpu::GpuFenceImpl> fence(new gpu::GpuFenceImpl(handle)); | 101 std::unique_ptr<gpu::GpuFenceImpl> fence( |
| 102 gpu::GpuFenceImpl::CreateFromHandle(handle)); |
| 102 return std::move(fence); | 103 return std::move(fence); |
| 103 } | 104 } |
| 104 | 105 |
| 105 std::unique_ptr<gfx::GpuFence> | 106 std::unique_ptr<gfx::GpuFence> |
| 106 ChildGpuMemoryBufferManager::CreateGpuFenceFromHandle( | 107 ChildGpuMemoryBufferManager::CreateGpuFenceFromHandle( |
| 107 const gfx::GpuFenceHandle& handle) { | 108 const gfx::GpuFenceHandle& handle) { |
| 108 NOTIMPLEMENTED(); | 109 NOTIMPLEMENTED(); |
| 109 return nullptr; | 110 return nullptr; |
| 110 } | 111 } |
| 111 | 112 |
| 112 gfx::GpuFence* ChildGpuMemoryBufferManager::GpuFenceFromClientFence( | 113 gfx::GpuFence* ChildGpuMemoryBufferManager::GpuFenceFromClientFence( |
| 113 ClientFence fence) { | 114 ClientFence fence) { |
| 114 return gpu::GpuFenceImpl::FromClientFence(fence); | 115 return gpu::GpuFenceImpl::FromClientFence(fence); |
| 115 } | 116 } |
| 116 | 117 |
| 117 } // namespace content | 118 } // namespace content |
| OLD | NEW |