| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/mus/gpu/mus_gpu_memory_buffer_manager.h" | 5 #include "components/mus/gpu/mus_gpu_memory_buffer_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/mus/common/generic_shared_memory_id_generator.h" | 8 #include "components/mus/common/generic_shared_memory_id_generator.h" |
| 9 #include "components/mus/gpu/gpu_service_mus.h" | 9 #include "components/mus/gpu/gpu_service_mus.h" |
| 10 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" | 10 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 std::unique_ptr<gfx::GpuMemoryBuffer> | 82 std::unique_ptr<gfx::GpuMemoryBuffer> |
| 83 MusGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( | 83 MusGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( |
| 84 const gfx::GpuMemoryBufferHandle& handle, | 84 const gfx::GpuMemoryBufferHandle& handle, |
| 85 const gfx::Size& size, | 85 const gfx::Size& size, |
| 86 gfx::BufferFormat format) { | 86 gfx::BufferFormat format) { |
| 87 NOTIMPLEMENTED(); | 87 NOTIMPLEMENTED(); |
| 88 return nullptr; | 88 return nullptr; |
| 89 } | 89 } |
| 90 | 90 |
| 91 std::unique_ptr<gfx::GpuMemoryBuffer> | |
| 92 MusGpuMemoryBufferManager::CreateGpuMemoryBufferFromClientId( | |
| 93 int client_id, | |
| 94 const gfx::GpuMemoryBufferId& gpu_memory_buffer_id) { | |
| 95 NOTIMPLEMENTED(); | |
| 96 return nullptr; | |
| 97 } | |
| 98 | |
| 99 gfx::GpuMemoryBuffer* | 91 gfx::GpuMemoryBuffer* |
| 100 MusGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer( | 92 MusGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer( |
| 101 ClientBuffer buffer) { | 93 ClientBuffer buffer) { |
| 102 return gpu::GpuMemoryBufferImpl::FromClientBuffer(buffer); | 94 return gpu::GpuMemoryBufferImpl::FromClientBuffer(buffer); |
| 103 } | 95 } |
| 104 | 96 |
| 105 void MusGpuMemoryBufferManager::SetDestructionSyncToken( | 97 void MusGpuMemoryBufferManager::SetDestructionSyncToken( |
| 106 gfx::GpuMemoryBuffer* buffer, | 98 gfx::GpuMemoryBuffer* buffer, |
| 107 const gpu::SyncToken& sync_token) { | 99 const gpu::SyncToken& sync_token) { |
| 108 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( | 100 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( |
| 109 sync_token); | 101 sync_token); |
| 110 } | 102 } |
| 111 | 103 |
| 112 void MusGpuMemoryBufferManager::DestroyGpuMemoryBuffer( | 104 void MusGpuMemoryBufferManager::DestroyGpuMemoryBuffer( |
| 113 gfx::GpuMemoryBufferId id, | 105 gfx::GpuMemoryBufferId id, |
| 114 int client_id, | 106 int client_id, |
| 115 bool is_native, | 107 bool is_native, |
| 116 const gpu::SyncToken& sync_token) { | 108 const gpu::SyncToken& sync_token) { |
| 117 if (is_native) { | 109 if (is_native) { |
| 118 gpu_service_->gpu_channel_manager()->DestroyGpuMemoryBuffer(id, client_id, | 110 gpu_service_->gpu_channel_manager()->DestroyGpuMemoryBuffer(id, client_id, |
| 119 sync_token); | 111 sync_token); |
| 120 } | 112 } |
| 121 } | 113 } |
| 122 | 114 |
| 123 } // namespace mus | 115 } // namespace mus |
| OLD | NEW |