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 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 10 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 uint32 sync_point) override; | 34 uint32 sync_point) override; |
35 | 35 |
36 void AllocateGpuMemoryBufferForChildProcess( | 36 void AllocateGpuMemoryBufferForChildProcess( |
37 const gfx::Size& size, | 37 const gfx::Size& size, |
38 gfx::GpuMemoryBuffer::Format format, | 38 gfx::GpuMemoryBuffer::Format format, |
39 gfx::GpuMemoryBuffer::Usage usage, | 39 gfx::GpuMemoryBuffer::Usage usage, |
40 base::ProcessHandle child_process_handle, | 40 base::ProcessHandle child_process_handle, |
41 int child_client_id, | 41 int child_client_id, |
42 const AllocationCallback& callback); | 42 const AllocationCallback& callback); |
43 void ChildProcessDeletedGpuMemoryBuffer( | 43 void ChildProcessDeletedGpuMemoryBuffer( |
44 gfx::GpuMemoryBufferType type, | |
45 gfx::GpuMemoryBufferId id, | 44 gfx::GpuMemoryBufferId id, |
46 base::ProcessHandle child_process_handle, | 45 base::ProcessHandle child_process_handle, |
47 int child_client_id, | 46 int child_client_id, |
48 uint32 sync_point); | 47 uint32 sync_point); |
49 void ProcessRemoved(base::ProcessHandle process_handle); | 48 void ProcessRemoved(base::ProcessHandle process_handle, int client_id); |
50 | 49 |
51 private: | 50 private: |
52 struct AllocateGpuMemoryBufferRequest; | 51 struct AllocateGpuMemoryBufferRequest; |
53 | 52 |
| 53 void GpuMemoryBufferAllocatedForChildProcess( |
| 54 base::ProcessHandle child_process_handle, |
| 55 int child_client_id, |
| 56 const AllocationCallback& callback, |
| 57 const gfx::GpuMemoryBufferHandle& handle); |
| 58 |
54 static void AllocateGpuMemoryBufferOnIO( | 59 static void AllocateGpuMemoryBufferOnIO( |
55 AllocateGpuMemoryBufferRequest* request); | 60 AllocateGpuMemoryBufferRequest* request); |
56 static void GpuMemoryBufferCreatedOnIO( | 61 static void GpuMemoryBufferCreatedOnIO( |
57 AllocateGpuMemoryBufferRequest* request, | 62 AllocateGpuMemoryBufferRequest* request, |
58 scoped_ptr<GpuMemoryBufferImpl> buffer); | 63 scoped_ptr<GpuMemoryBufferImpl> buffer); |
59 | 64 |
60 int gpu_client_id_; | 65 int gpu_client_id_; |
| 66 |
| 67 typedef base::hash_map<gfx::GpuMemoryBufferId, gfx::GpuMemoryBufferType> |
| 68 BufferMap; |
| 69 typedef base::hash_map<int, BufferMap> ClientMap; |
| 70 ClientMap clients_; |
| 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(BrowserGpuMemoryBufferManager); |
61 }; | 73 }; |
62 | 74 |
63 } // namespace content | 75 } // namespace content |
64 | 76 |
65 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 77 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
OLD | NEW |