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

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

Issue 2440093003: WIP GPU scheduler + delayed activation / tile draw
Patch Set: SignalSyncToken -> IsFenceSyncReleased Created 4 years 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/common/command_buffer_mock.h ('k') | gpu/command_buffer/common/sync_token.h » ('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) 2016 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_COMMON_PREEMPTION_FLAG_H_
6 #define GPU_COMMAND_BUFFER_COMMON_PREEMPTION_FLAG_H_
7
8 #include "base/atomic_ref_count.h"
9 #include "base/atomicops.h"
10 #include "base/memory/ref_counted.h"
11
12 namespace gpu {
13
14 class PreemptionFlag : public base::RefCountedThreadSafe<PreemptionFlag> {
15 public:
16 PreemptionFlag() : flag_(0) {}
17
18 bool IsSet() { return !base::AtomicRefCountIsZero(&flag_); }
19 void Set() { base::AtomicRefCountInc(&flag_); }
20 void Reset() { base::subtle::NoBarrier_Store(&flag_, 0); }
21
22 private:
23 base::AtomicRefCount flag_;
24
25 ~PreemptionFlag() {}
26
27 friend class base::RefCountedThreadSafe<PreemptionFlag>;
28 };
29
30 } // namespace gpu
31
32 #endif // GPU_COMMAND_BUFFER_COMMON_PREEMPTION_FLAG_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/command_buffer_mock.h ('k') | gpu/command_buffer/common/sync_token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698