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

Side by Side Diff: gpu/command_buffer/client/query_tracker.h

Issue 184223003: gpu: Use explicit atomics instead of assuming that 32bit read/writes are atomic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-upload Created 6 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_ 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_ 6 #define GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_
7 7
8 #include <GLES2/gl2.h> 8 #include <GLES2/gl2.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return info_.shm_id; 98 return info_.shm_id;
99 } 99 }
100 100
101 uint32 shm_offset() const { 101 uint32 shm_offset() const {
102 return info_.shm_offset; 102 return info_.shm_offset;
103 } 103 }
104 104
105 void MarkAsActive() { 105 void MarkAsActive() {
106 state_ = kActive; 106 state_ = kActive;
107 ++submit_count_; 107 ++submit_count_;
108 if (submit_count_ == INT_MAX)
109 submit_count_ = 1;
108 } 110 }
109 111
110 void MarkAsPending(int32 token) { 112 void MarkAsPending(int32 token) {
111 token_ = token; 113 token_ = token;
112 state_ = kPending; 114 state_ = kPending;
113 flushed_ = false; 115 flushed_ = false;
114 } 116 }
115 117
116 uint32 submit_count() const { 118 int32 submit_count() const {
117 return submit_count_; 119 return submit_count_;
118 } 120 }
119 121
120 int32 token() const { 122 int32 token() const {
121 return token_; 123 return token_;
122 } 124 }
123 125
124 bool NeverUsed() const { 126 bool NeverUsed() const {
125 return state_ == kUninitialized; 127 return state_ == kUninitialized;
126 } 128 }
(...skipping 10 matching lines...) Expand all
137 void End(GLES2Implementation* gl); 139 void End(GLES2Implementation* gl);
138 140
139 private: 141 private:
140 friend class QueryTracker; 142 friend class QueryTracker;
141 friend class QueryTrackerTest; 143 friend class QueryTrackerTest;
142 144
143 GLuint id_; 145 GLuint id_;
144 GLenum target_; 146 GLenum target_;
145 QuerySyncManager::QueryInfo info_; 147 QuerySyncManager::QueryInfo info_;
146 State state_; 148 State state_;
147 uint32 submit_count_; 149 int32 submit_count_;
148 int32 token_; 150 int32 token_;
149 bool flushed_; 151 bool flushed_;
150 uint64 client_begin_time_us_; // Only used for latency query target. 152 uint64 client_begin_time_us_; // Only used for latency query target.
151 uint32 result_; 153 uint32 result_;
152 }; 154 };
153 155
154 QueryTracker(MappedMemoryManager* manager); 156 QueryTracker(MappedMemoryManager* manager);
155 ~QueryTracker(); 157 ~QueryTracker();
156 158
157 Query* CreateQuery(GLuint id, GLenum target); 159 Query* CreateQuery(GLuint id, GLenum target);
(...skipping 10 matching lines...) Expand all
168 QueryList removed_queries_; 170 QueryList removed_queries_;
169 QuerySyncManager query_sync_manager_; 171 QuerySyncManager query_sync_manager_;
170 172
171 DISALLOW_COPY_AND_ASSIGN(QueryTracker); 173 DISALLOW_COPY_AND_ASSIGN(QueryTracker);
172 }; 174 };
173 175
174 } // namespace gles2 176 } // namespace gles2
175 } // namespace gpu 177 } // namespace gpu
176 178
177 #endif // GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_ 179 #endif // GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/query_tracker.cc » ('j') | gpu/command_buffer/common/gles2_cmd_format.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698