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> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
11 | 11 |
12 #include "base/atomic_ref_count.h" | 12 #include "base/atomic_ref_count.h" |
13 #include "base/atomicops.h" | 13 #include "base/atomicops.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/memory/shared_memory.h" | 19 #include "base/memory/shared_memory.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 21 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
22 #include "gpu/command_buffer/service/cmd_parser.h" | 22 #include "gpu/command_buffer/service/cmd_parser.h" |
23 #include "gpu/command_buffer/service/command_buffer_service.h" | 23 #include "gpu/command_buffer/service/command_buffer_service.h" |
24 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 24 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
25 #include "gpu/gpu_export.h" | 25 #include "gpu/gpu_export.h" |
26 | 26 |
27 namespace gfx { | |
28 class GLFence; | |
29 } | |
30 | |
31 namespace gpu { | 27 namespace gpu { |
32 | 28 |
33 class PreemptionFlag | 29 class PreemptionFlag |
34 : public base::RefCountedThreadSafe<PreemptionFlag> { | 30 : public base::RefCountedThreadSafe<PreemptionFlag> { |
35 public: | 31 public: |
36 PreemptionFlag() : flag_(0) {} | 32 PreemptionFlag() : flag_(0) {} |
37 | 33 |
38 bool IsSet() { return !base::AtomicRefCountIsZero(&flag_); } | 34 bool IsSet() { return !base::AtomicRefCountIsZero(&flag_); } |
39 void Set() { base::AtomicRefCountInc(&flag_); } | 35 void Set() { base::AtomicRefCountInc(&flag_); } |
40 void Reset() { base::subtle::NoBarrier_Store(&flag_, 0); } | 36 void Reset() { base::subtle::NoBarrier_Store(&flag_, 0); } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. | 135 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. |
140 scoped_refptr<PreemptionFlag> preemption_flag_; | 136 scoped_refptr<PreemptionFlag> preemption_flag_; |
141 bool was_preempted_; | 137 bool was_preempted_; |
142 | 138 |
143 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); | 139 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); |
144 }; | 140 }; |
145 | 141 |
146 } // namespace gpu | 142 } // namespace gpu |
147 | 143 |
148 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 144 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
OLD | NEW |