Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Side by Side Diff: gpu/command_buffer/service/gpu_scheduler.h

Issue 1336623004: content/gpu: Simplify gpu channel message handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng's final comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 void SetCommandProcessedCallback(const base::Closure& callback); 92 void SetCommandProcessedCallback(const base::Closure& callback);
93 93
94 bool HasMoreIdleWork(); 94 bool HasMoreIdleWork();
95 void PerformIdleWork(); 95 void PerformIdleWork();
96 96
97 CommandParser* parser() const { 97 CommandParser* parser() const {
98 return parser_.get(); 98 return parser_.get();
99 } 99 }
100 100
101 bool IsPreempted();
102
103 private: 101 private:
104 // Artificially reschedule if the scheduler is still unscheduled after a 102 // Artificially reschedule if the scheduler is still unscheduled after a
105 // timeout. 103 // timeout.
106 void RescheduleTimeOut(); 104 void RescheduleTimeOut();
107 105
106 bool IsPreempted();
107
108 // The GpuScheduler holds a weak reference to the CommandBuffer. The 108 // The GpuScheduler holds a weak reference to the CommandBuffer. The
109 // CommandBuffer owns the GpuScheduler and holds a strong reference to it 109 // CommandBuffer owns the GpuScheduler and holds a strong reference to it
110 // through the ProcessCommands callback. 110 // through the ProcessCommands callback.
111 CommandBufferServiceBase* command_buffer_; 111 CommandBufferServiceBase* command_buffer_;
112 112
113 // The parser uses this to execute commands. 113 // The parser uses this to execute commands.
114 AsyncAPIInterface* handler_; 114 AsyncAPIInterface* handler_;
115 115
116 // Does not own decoder. TODO(apatrick): The GpuScheduler shouldn't need a 116 // Does not own decoder. TODO(apatrick): The GpuScheduler shouldn't need a
117 // pointer to the decoder, it is only used to initialize the CommandParser, 117 // pointer to the decoder, it is only used to initialize the CommandParser,
(...skipping 23 matching lines...) Expand all
141 // A factory for outstanding rescheduling tasks that is invalidated whenever 141 // A factory for outstanding rescheduling tasks that is invalidated whenever
142 // the scheduler is rescheduled. 142 // the scheduler is rescheduled.
143 base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_; 143 base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_;
144 144
145 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); 145 DISALLOW_COPY_AND_ASSIGN(GpuScheduler);
146 }; 146 };
147 147
148 } // namespace gpu 148 } // namespace gpu
149 149
150 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ 150 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698