| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Returns whether the scheduler is currently scheduled to process commands. | 44 // Returns whether the scheduler is currently scheduled to process commands. |
| 45 bool IsScheduled(); | 45 bool IsScheduled(); |
| 46 | 46 |
| 47 // Sets a callback that is invoked just before scheduler is rescheduled. | 47 // Sets a callback that is invoked just before scheduler is rescheduled. |
| 48 // Takes ownership of callback object. | 48 // Takes ownership of callback object. |
| 49 void SetScheduledCallback(const base::Closure& scheduled_callback); | 49 void SetScheduledCallback(const base::Closure& scheduled_callback); |
| 50 | 50 |
| 51 // Implementation of CommandBufferEngine. | 51 // Implementation of CommandBufferEngine. |
| 52 virtual Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE; | 52 virtual Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE; |
| 53 virtual void set_token(int32 token) OVERRIDE; | 53 virtual void set_token(int32 token) OVERRIDE; |
| 54 virtual bool SetGetBuffer(int32 transfer_buffer_id) OVERRIDE; | |
| 55 virtual bool SetGetOffset(int32 offset) OVERRIDE; | 54 virtual bool SetGetOffset(int32 offset) OVERRIDE; |
| 56 virtual int32 GetGetOffset() OVERRIDE; | 55 virtual int32 GetGetOffset() OVERRIDE; |
| 57 | 56 |
| 58 void SetCommandProcessedCallback(const base::Closure& callback); | 57 void SetCommandProcessedCallback(const base::Closure& callback); |
| 59 | 58 |
| 60 void DeferToFence(base::Closure task); | 59 void DeferToFence(base::Closure task); |
| 61 | 60 |
| 62 private: | 61 private: |
| 63 | 62 |
| 64 // The GpuScheduler holds a weak reference to the CommandBuffer. The | 63 // The GpuScheduler holds a weak reference to the CommandBuffer. The |
| (...skipping 25 matching lines...) Expand all Loading... |
| 90 }; | 89 }; |
| 91 std::queue<UnscheduleFence> unschedule_fences_; | 90 std::queue<UnscheduleFence> unschedule_fences_; |
| 92 | 91 |
| 93 base::Closure scheduled_callback_; | 92 base::Closure scheduled_callback_; |
| 94 base::Closure command_processed_callback_; | 93 base::Closure command_processed_callback_; |
| 95 }; | 94 }; |
| 96 | 95 |
| 97 } // namespace gpu | 96 } // namespace gpu |
| 98 | 97 |
| 99 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 98 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
| OLD | NEW |