| 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 "services/ui/surfaces/mus_gpu_memory_buffer_manager.h" | 5 #include "services/ui/common/mus_gpu_memory_buffer_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" | 8 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" |
| 9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" | 9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" |
| 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" | 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
| 11 #include "services/ui/common/generic_shared_memory_id_generator.h" | 11 #include "services/ui/common/generic_shared_memory_id_generator.h" |
| 12 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" | 12 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 MusGpuMemoryBufferManager::MusGpuMemoryBufferManager( | 16 MusGpuMemoryBufferManager::MusGpuMemoryBufferManager( |
| 17 mojom::GpuServiceInternalPtr gpu_service, | 17 mojom::GpuServiceInternal* gpu_service, |
| 18 int client_id) | 18 int client_id) |
| 19 : gpu_service_(std::move(gpu_service)), | 19 : gpu_service_(gpu_service), client_id_(client_id), weak_factory_(this) {} |
| 20 client_id_(client_id), | |
| 21 weak_factory_(this) {} | |
| 22 | 20 |
| 23 MusGpuMemoryBufferManager::~MusGpuMemoryBufferManager() {} | 21 MusGpuMemoryBufferManager::~MusGpuMemoryBufferManager() {} |
| 24 | 22 |
| 25 std::unique_ptr<gfx::GpuMemoryBuffer> | 23 std::unique_ptr<gfx::GpuMemoryBuffer> |
| 26 MusGpuMemoryBufferManager::CreateGpuMemoryBuffer( | 24 MusGpuMemoryBufferManager::CreateGpuMemoryBuffer( |
| 27 const gfx::Size& size, | 25 const gfx::Size& size, |
| 28 gfx::BufferFormat format, | 26 gfx::BufferFormat format, |
| 29 gfx::BufferUsage usage, | 27 gfx::BufferUsage usage, |
| 30 gpu::SurfaceHandle surface_handle) { | 28 gpu::SurfaceHandle surface_handle) { |
| 31 gfx::GpuMemoryBufferId id = GetNextGenericSharedMemoryId(); | 29 gfx::GpuMemoryBufferId id = GetNextGenericSharedMemoryId(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 gfx::GpuMemoryBufferId id, | 69 gfx::GpuMemoryBufferId id, |
| 72 int client_id, | 70 int client_id, |
| 73 bool is_native, | 71 bool is_native, |
| 74 const gpu::SyncToken& sync_token) { | 72 const gpu::SyncToken& sync_token) { |
| 75 if (is_native) { | 73 if (is_native) { |
| 76 gpu_service_->DestroyGpuMemoryBuffer(id, client_id, sync_token); | 74 gpu_service_->DestroyGpuMemoryBuffer(id, client_id, sync_token); |
| 77 } | 75 } |
| 78 } | 76 } |
| 79 | 77 |
| 80 } // namespace ui | 78 } // namespace ui |
| OLD | NEW |