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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/preemption_flag.h
diff --git a/gpu/command_buffer/common/preemption_flag.h b/gpu/command_buffer/common/preemption_flag.h
new file mode 100644
index 0000000000000000000000000000000000000000..b2994aa906b8e89eadeaa3fc94b0683d871d6adc
--- /dev/null
+++ b/gpu/command_buffer/common/preemption_flag.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_COMMAND_BUFFER_COMMON_PREEMPTION_FLAG_H_
+#define GPU_COMMAND_BUFFER_COMMON_PREEMPTION_FLAG_H_
+
+#include "base/atomic_ref_count.h"
+#include "base/atomicops.h"
+#include "base/memory/ref_counted.h"
+
+namespace gpu {
+
+class PreemptionFlag : public base::RefCountedThreadSafe<PreemptionFlag> {
+ public:
+ PreemptionFlag() : flag_(0) {}
+
+ bool IsSet() { return !base::AtomicRefCountIsZero(&flag_); }
+ void Set() { base::AtomicRefCountInc(&flag_); }
+ void Reset() { base::subtle::NoBarrier_Store(&flag_, 0); }
+
+ private:
+ base::AtomicRefCount flag_;
+
+ ~PreemptionFlag() {}
+
+ friend class base::RefCountedThreadSafe<PreemptionFlag>;
+};
+
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_COMMON_PREEMPTION_FLAG_H_
« 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