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

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

Issue 2763753002: gpu: Add callback for yielding command buffer execution. (Closed)
Patch Set: no need to !!pause Created 3 years, 8 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 | « gpu/command_buffer/service/command_executor.cc ('k') | gpu/ipc/service/gpu_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_PREEMPTION_FLAG_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_PREEMPTION_FLAG_H_
7
8 #include "base/atomic_ref_count.h"
9 #include "base/atomicops.h"
10 #include "base/memory/ref_counted.h"
11 #include "gpu/gpu_export.h"
12
13 namespace gpu {
14
15 class PreemptionFlag : public base::RefCountedThreadSafe<PreemptionFlag> {
16 public:
17 PreemptionFlag() : flag_(0) {}
18
19 bool IsSet() { return !base::AtomicRefCountIsZero(&flag_); }
20 void Set() { base::AtomicRefCountInc(&flag_); }
21 void Reset() { base::subtle::NoBarrier_Store(&flag_, 0); }
22
23 private:
24 base::AtomicRefCount flag_;
25
26 ~PreemptionFlag() {}
27
28 friend class base::RefCountedThreadSafe<PreemptionFlag>;
29 };
30
31 } // namespace gpu
32
33 #endif // GPU_COMMAND_BUFFER_SERVICE_PREEMPTION_FLAG_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/command_executor.cc ('k') | gpu/ipc/service/gpu_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698