| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void SetScheduled(bool is_scheduled); | 42 void SetScheduled(bool is_scheduled); |
| 43 | 43 |
| 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(Callback0::Type* scheduled_callback); | 49 void SetScheduledCallback(Callback0::Type* scheduled_callback); |
| 50 | 50 |
| 51 // Implementation of CommandBufferEngine. | 51 // Implementation of CommandBufferEngine. |
| 52 virtual Buffer GetSharedMemoryBuffer(int32 shm_id); | 52 virtual Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE; |
| 53 virtual void set_token(int32 token); | 53 virtual void set_token(int32 token) OVERRIDE; |
| 54 virtual bool SetGetOffset(int32 offset); | 54 virtual bool SetGetOffset(int32 offset) OVERRIDE; |
| 55 virtual int32 GetGetOffset(); | 55 virtual int32 GetGetOffset() OVERRIDE; |
| 56 | 56 |
| 57 void SetCommandProcessedCallback(Callback0::Type* callback); | 57 void SetCommandProcessedCallback(Callback0::Type* callback); |
| 58 | 58 |
| 59 void DeferToFence(base::Closure task); | 59 void DeferToFence(base::Closure task); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 | 62 |
| 63 // The GpuScheduler holds a weak reference to the CommandBuffer. The | 63 // The GpuScheduler holds a weak reference to the CommandBuffer. The |
| 64 // CommandBuffer owns the GpuScheduler and holds a strong reference to it | 64 // CommandBuffer owns the GpuScheduler and holds a strong reference to it |
| 65 // through the ProcessCommands callback. | 65 // through the ProcessCommands callback. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 89 }; | 89 }; |
| 90 std::queue<UnscheduleFence> unschedule_fences_; | 90 std::queue<UnscheduleFence> unschedule_fences_; |
| 91 | 91 |
| 92 scoped_ptr<Callback0::Type> scheduled_callback_; | 92 scoped_ptr<Callback0::Type> scheduled_callback_; |
| 93 scoped_ptr<Callback0::Type> command_processed_callback_; | 93 scoped_ptr<Callback0::Type> command_processed_callback_; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace gpu | 96 } // namespace gpu |
| 97 | 97 |
| 98 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 98 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
| OLD | NEW |