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

Unified Diff: gpu/command_buffer/common/command_buffer.cc

Issue 7260008: Implement proper synchronization between HW video decode IPC and CommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/common/command_buffer.h ('k') | gpu/command_buffer/service/gpu_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/command_buffer.cc
diff --git a/gpu/command_buffer/common/command_buffer.cc b/gpu/command_buffer/common/command_buffer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5a12ed1f958e399383c1eb17030d935f4d294e9f
--- /dev/null
+++ b/gpu/command_buffer/common/command_buffer.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2011 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.
+
+#include "../common/command_buffer.h"
+#include "../common/logging.h"
+
+namespace gpu {
+
+ReadWriteTokens::ReadWriteTokens()
+ : last_token_read(-1), last_token_written(-1) {
+}
+
+ReadWriteTokens::ReadWriteTokens(int32 read, int32 written)
+ : last_token_read(read), last_token_written(written) {
+}
+
+bool ReadWriteTokens::InRange(int32 token) const {
+ int32 min = last_token_read;
+ int32 max = last_token_written;
+ GPU_DCHECK_GE(min, 0);
+ GPU_DCHECK_GE(max, 0);
+ if (min <= max) {
+ // token should be in [min .. max)
+ return (token >= min) && (token < max);
+ }
+ // token should be in [0 .. max) or [min .. wrap token)
+ return (token >= min) || (token < max);
+}
+
+} // namespace gpu
« no previous file with comments | « gpu/command_buffer/common/command_buffer.h ('k') | gpu/command_buffer/service/gpu_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698