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

Side by Side 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, 5 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 | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 #include "../common/command_buffer.h"
6 #include "../common/logging.h"
7
8 namespace gpu {
9
10 ReadWriteTokens::ReadWriteTokens()
11 : last_token_read(-1), last_token_written(-1) {
12 }
13
14 ReadWriteTokens::ReadWriteTokens(int32 read, int32 written)
15 : last_token_read(read), last_token_written(written) {
16 }
17
18 bool ReadWriteTokens::InRange(int32 token) const {
19 int32 min = last_token_read;
20 int32 max = last_token_written;
21 GPU_DCHECK_GE(min, 0);
22 GPU_DCHECK_GE(max, 0);
23 if (min <= max) {
24 // token should be in [min .. max)
25 return (token >= min) && (token < max);
26 }
27 // token should be in [0 .. max) or [min .. wrap token)
28 return (token >= min) || (token < max);
29 }
30
31 } // namespace gpu
OLDNEW
« 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