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_GPU_COMMAND_BUFFER_STUB_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 | 90 |
91 // IPC::Listener implementation: | 91 // IPC::Listener implementation: |
92 bool OnMessageReceived(const IPC::Message& message) override; | 92 bool OnMessageReceived(const IPC::Message& message) override; |
93 | 93 |
94 // IPC::Sender implementation: | 94 // IPC::Sender implementation: |
95 bool Send(IPC::Message* msg) override; | 95 bool Send(IPC::Message* msg) override; |
96 | 96 |
97 // GpuMemoryManagerClient implementation: | 97 // GpuMemoryManagerClient implementation: |
98 gfx::Size GetSurfaceSize() const override; | 98 gfx::Size GetSurfaceSize() const override; |
99 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; | 99 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; |
100 void SetMemoryAllocation(const gpu::MemoryAllocation& allocation) override; | |
101 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; | 100 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; |
102 bool GetTotalGpuMemory(uint64* bytes) override; | 101 bool GetTotalGpuMemory(uint64* bytes) override; |
103 | 102 |
104 // Whether this command buffer can currently handle IPC messages. | 103 // Whether this command buffer can currently handle IPC messages. |
105 bool IsScheduled(); | 104 bool IsScheduled(); |
106 | 105 |
107 // If the command buffer is pre-empted and cannot process commands. | 106 // If the command buffer is pre-empted and cannot process commands. |
108 bool IsPreempted() const { | 107 bool IsPreempted() const { |
109 return scheduler_.get() && scheduler_->IsPreempted(); | 108 return scheduler_.get() && scheduler_->IsPreempted(); |
110 } | 109 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 | 202 |
204 void OnEnsureBackbuffer(); | 203 void OnEnsureBackbuffer(); |
205 | 204 |
206 void OnRetireSyncPoint(uint32 sync_point); | 205 void OnRetireSyncPoint(uint32 sync_point); |
207 bool OnWaitSyncPoint(uint32 sync_point); | 206 bool OnWaitSyncPoint(uint32 sync_point); |
208 void OnWaitSyncPointCompleted(uint32 sync_point); | 207 void OnWaitSyncPointCompleted(uint32 sync_point); |
209 void OnSignalSyncPoint(uint32 sync_point, uint32 id); | 208 void OnSignalSyncPoint(uint32 sync_point, uint32 id); |
210 void OnSignalSyncPointAck(uint32 id); | 209 void OnSignalSyncPointAck(uint32 id); |
211 void OnSignalQuery(uint32 query, uint32 id); | 210 void OnSignalQuery(uint32 query, uint32 id); |
212 | 211 |
213 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback); | |
214 | |
215 void OnCreateImage(int32 id, | 212 void OnCreateImage(int32 id, |
216 gfx::GpuMemoryBufferHandle handle, | 213 gfx::GpuMemoryBufferHandle handle, |
217 gfx::Size size, | 214 gfx::Size size, |
218 gfx::BufferFormat format, | 215 gfx::BufferFormat format, |
219 uint32 internalformat); | 216 uint32 internalformat); |
220 void OnDestroyImage(int32 id); | 217 void OnDestroyImage(int32 id); |
221 | 218 |
222 void OnCommandProcessed(); | 219 void OnCommandProcessed(); |
223 void OnParseError(); | 220 void OnParseError(); |
224 void OnCreateStreamTexture( | 221 void OnCreateStreamTexture( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 | 264 |
268 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 265 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
269 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 266 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
270 scoped_ptr<gpu::GpuScheduler> scheduler_; | 267 scoped_ptr<gpu::GpuScheduler> scheduler_; |
271 scoped_refptr<gfx::GLSurface> surface_; | 268 scoped_refptr<gfx::GLSurface> surface_; |
272 | 269 |
273 scoped_ptr<GpuMemoryManagerClientState> memory_manager_client_state_; | 270 scoped_ptr<GpuMemoryManagerClientState> memory_manager_client_state_; |
274 // The last memory allocation received from the GpuMemoryManager (used to | 271 // The last memory allocation received from the GpuMemoryManager (used to |
275 // elide redundant work). | 272 // elide redundant work). |
276 bool last_memory_allocation_valid_; | 273 bool last_memory_allocation_valid_; |
277 gpu::MemoryAllocation last_memory_allocation_; | 274 gpu::MemoryAllocation last_memory_allocation_; |
piman
2015/09/24 21:34:08
nit: remove those 3 fields.
sohanjg
2015/09/28 07:35:49
Done.
| |
278 | 275 |
279 GpuWatchdog* watchdog_; | 276 GpuWatchdog* watchdog_; |
280 | 277 |
281 base::ObserverList<DestructionObserver> destruction_observers_; | 278 base::ObserverList<DestructionObserver> destruction_observers_; |
282 | 279 |
283 // A queue of sync points associated with this stub. | 280 // A queue of sync points associated with this stub. |
284 std::deque<uint32> sync_points_; | 281 std::deque<uint32> sync_points_; |
285 int sync_point_wait_count_; | 282 int sync_point_wait_count_; |
286 | 283 |
287 bool delayed_work_scheduled_; | 284 bool delayed_work_scheduled_; |
(...skipping 10 matching lines...) Expand all Loading... | |
298 size_t total_gpu_memory_; | 295 size_t total_gpu_memory_; |
299 scoped_ptr<WaitForCommandState> wait_for_token_; | 296 scoped_ptr<WaitForCommandState> wait_for_token_; |
300 scoped_ptr<WaitForCommandState> wait_for_get_offset_; | 297 scoped_ptr<WaitForCommandState> wait_for_get_offset_; |
301 | 298 |
302 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 299 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
303 }; | 300 }; |
304 | 301 |
305 } // namespace content | 302 } // namespace content |
306 | 303 |
307 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 304 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |