Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef SERVICES_UI_PUBLIC_CPP_GPU_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_GPU_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ |
| 6 #define SERVICES_UI_PUBLIC_CPP_GPU_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_GPU_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
| 15 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 16 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| 16 #include "services/ui/public/interfaces/gpu.mojom.h" | 17 #include "services/ui/public/interfaces/gpu.mojom.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 38 const gpu::SyncToken& sync_token); | 39 const gpu::SyncToken& sync_token); |
| 39 | 40 |
| 40 // Overridden from gpu::GpuMemoryBufferManager: | 41 // Overridden from gpu::GpuMemoryBufferManager: |
| 41 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( | 42 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( |
| 42 const gfx::Size& size, | 43 const gfx::Size& size, |
| 43 gfx::BufferFormat format, | 44 gfx::BufferFormat format, |
| 44 gfx::BufferUsage usage, | 45 gfx::BufferUsage usage, |
| 45 gpu::SurfaceHandle surface_handle) override; | 46 gpu::SurfaceHandle surface_handle) override; |
| 46 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, | 47 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
| 47 const gpu::SyncToken& sync_token) override; | 48 const gpu::SyncToken& sync_token) override; |
| 49 | |
| 50 void DisconnectGpuOnThread(); | |
| 51 void OnGpuMemoryBufferAllocatedOnThread( | |
|
sadrul
2017/01/21 02:54:31
Move these above to group with TearDownThread()/Al
Ken Rockot(use gerrit already)
2017/01/23 18:00:50
Done
| |
| 52 gfx::GpuMemoryBufferHandle* ret_handle, | |
| 53 base::WaitableEvent* wait, | |
| 54 const gfx::GpuMemoryBufferHandle& handle); | |
| 55 | |
| 48 int counter_ = 0; | 56 int counter_ = 0; |
| 49 // TODO(sad): Explore the option of doing this from an existing thread. | 57 // TODO(sad): Explore the option of doing this from an existing thread. |
| 50 base::Thread thread_; | 58 base::Thread thread_; |
| 51 mojom::GpuPtr gpu_; | 59 mojom::GpuPtr gpu_; |
| 52 base::WeakPtr<ClientGpuMemoryBufferManager> weak_ptr_; | 60 base::WeakPtr<ClientGpuMemoryBufferManager> weak_ptr_; |
| 61 std::set<base::WaitableEvent*> pending_allocation_waiters_; | |
| 53 base::WeakPtrFactory<ClientGpuMemoryBufferManager> weak_ptr_factory_; | 62 base::WeakPtrFactory<ClientGpuMemoryBufferManager> weak_ptr_factory_; |
| 54 | 63 |
| 55 DISALLOW_COPY_AND_ASSIGN(ClientGpuMemoryBufferManager); | 64 DISALLOW_COPY_AND_ASSIGN(ClientGpuMemoryBufferManager); |
| 56 }; | 65 }; |
| 57 | 66 |
| 58 } // namespace ui | 67 } // namespace ui |
| 59 | 68 |
| 60 #endif // SERVICES_UI_PUBLIC_CPP_GPU_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ | 69 #endif // SERVICES_UI_PUBLIC_CPP_GPU_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ |
| OLD | NEW |