| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 // IPC::Listener implementation: | 92 // IPC::Listener implementation: |
| 93 bool OnMessageReceived(const IPC::Message& message) override; | 93 bool OnMessageReceived(const IPC::Message& message) override; |
| 94 | 94 |
| 95 // IPC::Sender implementation: | 95 // IPC::Sender implementation: |
| 96 bool Send(IPC::Message* msg) override; | 96 bool Send(IPC::Message* msg) override; |
| 97 | 97 |
| 98 // GpuMemoryManagerClient implementation: | 98 // GpuMemoryManagerClient implementation: |
| 99 gfx::Size GetSurfaceSize() const override; | 99 gfx::Size GetSurfaceSize() const override; |
| 100 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; | 100 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; |
| 101 void SetMemoryAllocation(const gpu::MemoryAllocation& allocation) override; | |
| 102 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; | 101 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; |
| 103 bool GetTotalGpuMemory(uint64* bytes) override; | 102 bool GetTotalGpuMemory(uint64* bytes) override; |
| 104 | 103 |
| 105 // Whether this command buffer can currently handle IPC messages. | 104 // Whether this command buffer can currently handle IPC messages. |
| 106 bool IsScheduled(); | 105 bool IsScheduled(); |
| 107 | 106 |
| 108 // Whether there are commands in the buffer that haven't been processed. | 107 // Whether there are commands in the buffer that haven't been processed. |
| 109 bool HasUnprocessedCommands(); | 108 bool HasUnprocessedCommands(); |
| 110 | 109 |
| 111 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 110 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 195 |
| 197 void OnEnsureBackbuffer(); | 196 void OnEnsureBackbuffer(); |
| 198 | 197 |
| 199 void OnRetireSyncPoint(uint32 sync_point); | 198 void OnRetireSyncPoint(uint32 sync_point); |
| 200 bool OnWaitSyncPoint(uint32 sync_point); | 199 bool OnWaitSyncPoint(uint32 sync_point); |
| 201 void OnWaitSyncPointCompleted(uint32 sync_point); | 200 void OnWaitSyncPointCompleted(uint32 sync_point); |
| 202 void OnSignalSyncPoint(uint32 sync_point, uint32 id); | 201 void OnSignalSyncPoint(uint32 sync_point, uint32 id); |
| 203 void OnSignalSyncPointAck(uint32 id); | 202 void OnSignalSyncPointAck(uint32 id); |
| 204 void OnSignalQuery(uint32 query, uint32 id); | 203 void OnSignalQuery(uint32 query, uint32 id); |
| 205 | 204 |
| 206 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback); | |
| 207 | |
| 208 void OnCreateImage(int32 id, | 205 void OnCreateImage(int32 id, |
| 209 gfx::GpuMemoryBufferHandle handle, | 206 gfx::GpuMemoryBufferHandle handle, |
| 210 gfx::Size size, | 207 gfx::Size size, |
| 211 gfx::BufferFormat format, | 208 gfx::BufferFormat format, |
| 212 uint32 internalformat); | 209 uint32 internalformat); |
| 213 void OnDestroyImage(int32 id); | 210 void OnDestroyImage(int32 id); |
| 214 void OnCreateStreamTexture(uint32 texture_id, | 211 void OnCreateStreamTexture(uint32 texture_id, |
| 215 int32 stream_id, | 212 int32 stream_id, |
| 216 bool* succeeded); | 213 bool* succeeded); |
| 217 | 214 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 const int32 route_id_; | 258 const int32 route_id_; |
| 262 const bool offscreen_; | 259 const bool offscreen_; |
| 263 uint32 last_flush_count_; | 260 uint32 last_flush_count_; |
| 264 | 261 |
| 265 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 262 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
| 266 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 263 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
| 267 scoped_ptr<gpu::GpuScheduler> scheduler_; | 264 scoped_ptr<gpu::GpuScheduler> scheduler_; |
| 268 scoped_ptr<gpu::SyncPointClient> sync_point_client_; | 265 scoped_ptr<gpu::SyncPointClient> sync_point_client_; |
| 269 scoped_refptr<gfx::GLSurface> surface_; | 266 scoped_refptr<gfx::GLSurface> surface_; |
| 270 | 267 |
| 271 scoped_ptr<GpuMemoryManagerClientState> memory_manager_client_state_; | |
| 272 // The last memory allocation received from the GpuMemoryManager (used to | |
| 273 // elide redundant work). | |
| 274 bool last_memory_allocation_valid_; | |
| 275 gpu::MemoryAllocation last_memory_allocation_; | |
| 276 | |
| 277 GpuWatchdog* watchdog_; | 268 GpuWatchdog* watchdog_; |
| 278 | 269 |
| 279 base::ObserverList<DestructionObserver> destruction_observers_; | 270 base::ObserverList<DestructionObserver> destruction_observers_; |
| 280 | 271 |
| 281 // A queue of sync points associated with this stub. | 272 // A queue of sync points associated with this stub. |
| 282 std::deque<uint32> sync_points_; | 273 std::deque<uint32> sync_points_; |
| 283 bool waiting_for_sync_point_; | 274 bool waiting_for_sync_point_; |
| 284 | 275 |
| 285 base::TimeTicks process_delayed_work_time_; | 276 base::TimeTicks process_delayed_work_time_; |
| 286 uint32_t previous_processed_num_; | 277 uint32_t previous_processed_num_; |
| 287 base::TimeTicks last_idle_time_; | 278 base::TimeTicks last_idle_time_; |
| 288 | 279 |
| 289 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; | 280 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; |
| 290 | 281 |
| 291 LatencyInfoCallback latency_info_callback_; | 282 LatencyInfoCallback latency_info_callback_; |
| 292 | 283 |
| 293 GURL active_url_; | 284 GURL active_url_; |
| 294 size_t active_url_hash_; | 285 size_t active_url_hash_; |
| 295 | 286 |
| 296 size_t total_gpu_memory_; | 287 size_t total_gpu_memory_; |
| 297 scoped_ptr<WaitForCommandState> wait_for_token_; | 288 scoped_ptr<WaitForCommandState> wait_for_token_; |
| 298 scoped_ptr<WaitForCommandState> wait_for_get_offset_; | 289 scoped_ptr<WaitForCommandState> wait_for_get_offset_; |
| 299 | 290 |
| 300 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 291 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
| 301 }; | 292 }; |
| 302 | 293 |
| 303 } // namespace content | 294 } // namespace content |
| 304 | 295 |
| 305 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 296 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| OLD | NEW |