OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 // CommandBuffer implementation: | 79 // CommandBuffer implementation: |
80 virtual bool Initialize() OVERRIDE; | 80 virtual bool Initialize() OVERRIDE; |
81 virtual State GetState() OVERRIDE; | 81 virtual State GetState() OVERRIDE; |
82 virtual State GetLastState() OVERRIDE; | 82 virtual State GetLastState() OVERRIDE; |
83 virtual int32 GetLastToken() OVERRIDE; | 83 virtual int32 GetLastToken() OVERRIDE; |
84 virtual void Flush(int32 put_offset) OVERRIDE; | 84 virtual void Flush(int32 put_offset) OVERRIDE; |
85 virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE; | 85 virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE; |
86 virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE; | 86 virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE; |
87 virtual void SetGetBuffer(int32 shm_id) OVERRIDE; | 87 virtual void SetGetBuffer(int32 shm_id) OVERRIDE; |
88 virtual void SetGetOffset(int32 get_offset) OVERRIDE; | |
89 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, | 88 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, |
90 int32* id) OVERRIDE; | 89 int32* id) OVERRIDE; |
91 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; | 90 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; |
92 virtual scoped_refptr<gpu::Buffer> GetTransferBuffer(int32 id) OVERRIDE; | |
93 virtual void SetToken(int32 token) OVERRIDE; | |
94 virtual void SetParseError(gpu::error::Error error) OVERRIDE; | |
95 virtual void SetContextLostReason( | |
96 gpu::error::ContextLostReason reason) OVERRIDE; | |
97 | 91 |
98 // gpu::GpuControl implementation: | 92 // gpu::GpuControl implementation: |
99 virtual gpu::Capabilities GetCapabilities() OVERRIDE; | 93 virtual gpu::Capabilities GetCapabilities() OVERRIDE; |
100 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( | 94 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( |
101 size_t width, | 95 size_t width, |
102 size_t height, | 96 size_t height, |
103 unsigned internalformat, | 97 unsigned internalformat, |
104 int32* id) OVERRIDE; | 98 int32* id) OVERRIDE; |
105 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; | 99 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; |
106 virtual uint32 InsertSyncPoint() OVERRIDE; | 100 virtual uint32 InsertSyncPoint() OVERRIDE; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 154 |
161 // Try to read an updated copy of the state from shared memory. | 155 // Try to read an updated copy of the state from shared memory. |
162 void TryUpdateState(); | 156 void TryUpdateState(); |
163 | 157 |
164 // The shared memory area used to update state. | 158 // The shared memory area used to update state. |
165 gpu::CommandBufferSharedState* shared_state() const { | 159 gpu::CommandBufferSharedState* shared_state() const { |
166 return reinterpret_cast<gpu::CommandBufferSharedState*>( | 160 return reinterpret_cast<gpu::CommandBufferSharedState*>( |
167 shared_state_shm_->memory()); | 161 shared_state_shm_->memory()); |
168 } | 162 } |
169 | 163 |
170 // Local cache of id to transfer buffer mapping. | |
171 TransferBufferMap transfer_buffers_; | |
172 | |
173 // Unowned list of DeletionObservers. | 164 // Unowned list of DeletionObservers. |
174 ObserverList<DeletionObserver> deletion_observers_; | 165 ObserverList<DeletionObserver> deletion_observers_; |
175 | 166 |
176 // The last cached state received from the service. | 167 // The last cached state received from the service. |
177 State last_state_; | 168 State last_state_; |
178 | 169 |
179 // The shared memory area used to update state. | 170 // The shared memory area used to update state. |
180 scoped_ptr<base::SharedMemory> shared_state_shm_; | 171 scoped_ptr<base::SharedMemory> shared_state_shm_; |
181 | 172 |
182 // |*this| is owned by |*channel_| and so is always outlived by it, so using a | 173 // |*this| is owned by |*channel_| and so is always outlived by it, so using a |
(...skipping 20 matching lines...) Expand all Loading... |
203 GpuMemoryBufferMap gpu_memory_buffers_; | 194 GpuMemoryBufferMap gpu_memory_buffers_; |
204 | 195 |
205 gpu::Capabilities capabilities_; | 196 gpu::Capabilities capabilities_; |
206 | 197 |
207 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 198 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
208 }; | 199 }; |
209 | 200 |
210 } // namespace content | 201 } // namespace content |
211 | 202 |
212 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 203 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
OLD | NEW |