| 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 <stdint.h> |
| 9 |
| 8 #include <queue> | 10 #include <queue> |
| 9 | 11 |
| 10 #include "base/atomic_ref_count.h" | 12 #include "base/atomic_ref_count.h" |
| 11 #include "base/atomicops.h" | 13 #include "base/atomicops.h" |
| 12 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" |
| 13 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/shared_memory.h" | 19 #include "base/memory/shared_memory.h" |
| 17 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 18 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 21 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 19 #include "gpu/command_buffer/service/cmd_parser.h" | 22 #include "gpu/command_buffer/service/cmd_parser.h" |
| 20 #include "gpu/command_buffer/service/command_buffer_service.h" | 23 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 21 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 24 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 22 #include "gpu/gpu_export.h" | 25 #include "gpu/gpu_export.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // determine if there's more pending queries after this has been called. | 81 // determine if there's more pending queries after this has been called. |
| 79 void ProcessPendingQueries(); | 82 void ProcessPendingQueries(); |
| 80 | 83 |
| 81 typedef base::Callback<void(bool /* scheduled */)> SchedulingChangedCallback; | 84 typedef base::Callback<void(bool /* scheduled */)> SchedulingChangedCallback; |
| 82 | 85 |
| 83 // Sets a callback that is invoked just before scheduler is rescheduled | 86 // Sets a callback that is invoked just before scheduler is rescheduled |
| 84 // or descheduled. Takes ownership of callback object. | 87 // or descheduled. Takes ownership of callback object. |
| 85 void SetSchedulingChangedCallback(const SchedulingChangedCallback& callback); | 88 void SetSchedulingChangedCallback(const SchedulingChangedCallback& callback); |
| 86 | 89 |
| 87 // Implementation of CommandBufferEngine. | 90 // Implementation of CommandBufferEngine. |
| 88 scoped_refptr<Buffer> GetSharedMemoryBuffer(int32 shm_id) override; | 91 scoped_refptr<Buffer> GetSharedMemoryBuffer(int32_t shm_id) override; |
| 89 void set_token(int32 token) override; | 92 void set_token(int32_t token) override; |
| 90 bool SetGetBuffer(int32 transfer_buffer_id) override; | 93 bool SetGetBuffer(int32_t transfer_buffer_id) override; |
| 91 bool SetGetOffset(int32 offset) override; | 94 bool SetGetOffset(int32_t offset) override; |
| 92 int32 GetGetOffset() override; | 95 int32_t GetGetOffset() override; |
| 93 | 96 |
| 94 void SetCommandProcessedCallback(const base::Closure& callback); | 97 void SetCommandProcessedCallback(const base::Closure& callback); |
| 95 | 98 |
| 96 // Returns whether the scheduler needs to be polled again in the future to | 99 // Returns whether the scheduler needs to be polled again in the future to |
| 97 // process idle work. | 100 // process idle work. |
| 98 bool HasMoreIdleWork() const; | 101 bool HasMoreIdleWork() const; |
| 99 | 102 |
| 100 // Perform some idle work and return. HasMoreIdleWork() can be used to | 103 // Perform some idle work and return. HasMoreIdleWork() can be used to |
| 101 // determine if there's more idle work do be done after this has been called. | 104 // determine if there's more idle work do be done after this has been called. |
| 102 void PerformIdleWork(); | 105 void PerformIdleWork(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. | 139 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. |
| 137 scoped_refptr<PreemptionFlag> preemption_flag_; | 140 scoped_refptr<PreemptionFlag> preemption_flag_; |
| 138 bool was_preempted_; | 141 bool was_preempted_; |
| 139 | 142 |
| 140 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); | 143 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); |
| 141 }; | 144 }; |
| 142 | 145 |
| 143 } // namespace gpu | 146 } // namespace gpu |
| 144 | 147 |
| 145 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 148 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
| OLD | NEW |