| 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 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/atomic_ref_count.h" | 10 #include "base/atomic_ref_count.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // Returns whether the scheduler needs to be polled again in the future. | 76 // Returns whether the scheduler needs to be polled again in the future. |
| 77 bool HasMoreWork(); | 77 bool HasMoreWork(); |
| 78 | 78 |
| 79 typedef base::Callback<void(bool /* scheduled */)> SchedulingChangedCallback; | 79 typedef base::Callback<void(bool /* scheduled */)> SchedulingChangedCallback; |
| 80 | 80 |
| 81 // Sets a callback that is invoked just before scheduler is rescheduled | 81 // Sets a callback that is invoked just before scheduler is rescheduled |
| 82 // or descheduled. Takes ownership of callback object. | 82 // or descheduled. Takes ownership of callback object. |
| 83 void SetSchedulingChangedCallback(const SchedulingChangedCallback& callback); | 83 void SetSchedulingChangedCallback(const SchedulingChangedCallback& callback); |
| 84 | 84 |
| 85 // Implementation of CommandBufferEngine. | 85 // Implementation of CommandBufferEngine. |
| 86 virtual scoped_refptr<Buffer> GetSharedMemoryBuffer(int32 shm_id) OVERRIDE; | 86 virtual scoped_refptr<Buffer> GetSharedMemoryBuffer(int32 shm_id) override; |
| 87 virtual void set_token(int32 token) OVERRIDE; | 87 virtual void set_token(int32 token) override; |
| 88 virtual bool SetGetBuffer(int32 transfer_buffer_id) OVERRIDE; | 88 virtual bool SetGetBuffer(int32 transfer_buffer_id) override; |
| 89 virtual bool SetGetOffset(int32 offset) OVERRIDE; | 89 virtual bool SetGetOffset(int32 offset) override; |
| 90 virtual int32 GetGetOffset() OVERRIDE; | 90 virtual int32 GetGetOffset() override; |
| 91 | 91 |
| 92 void SetCommandProcessedCallback(const base::Closure& callback); | 92 void SetCommandProcessedCallback(const base::Closure& callback); |
| 93 | 93 |
| 94 void DeferToFence(base::Closure task); | 94 void DeferToFence(base::Closure task); |
| 95 | 95 |
| 96 // Polls the fences, invoking callbacks that were waiting to be triggered | 96 // Polls the fences, invoking callbacks that were waiting to be triggered |
| 97 // by them and returns whether all fences were complete. | 97 // by them and returns whether all fences were complete. |
| 98 bool PollUnscheduleFences(); | 98 bool PollUnscheduleFences(); |
| 99 | 99 |
| 100 bool HasMoreIdleWork(); | 100 bool HasMoreIdleWork(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // A factory for outstanding rescheduling tasks that is invalidated whenever | 159 // A factory for outstanding rescheduling tasks that is invalidated whenever |
| 160 // the scheduler is rescheduled. | 160 // the scheduler is rescheduled. |
| 161 base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_; | 161 base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); | 163 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace gpu | 166 } // namespace gpu |
| 167 | 167 |
| 168 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 168 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
| OLD | NEW |