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

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

Issue 1188013004: Added support for Time Elapsed queries through the command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed extra line Created 5 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
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 <bitset> 10 #include <bitset>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 bool Active() const { 128 bool Active() const {
129 return state_ == kActive; 129 return state_ == kActive;
130 } 130 }
131 131
132 bool Pending() const { 132 bool Pending() const {
133 return state_ == kPending; 133 return state_ == kPending;
134 } 134 }
135 135
136 bool CheckResultsAvailable(CommandBufferHelper* helper); 136 bool CheckResultsAvailable(CommandBufferHelper* helper);
137 137
138 uint32 GetResult() const; 138 uint64 GetResult() const;
139 139
140 private: 140 private:
141 friend class QueryTracker; 141 friend class QueryTracker;
142 friend class QueryTrackerTest; 142 friend class QueryTrackerTest;
143 143
144 void Begin(GLES2Implementation* gl); 144 void Begin(GLES2Implementation* gl);
145 void End(GLES2Implementation* gl); 145 void End(GLES2Implementation* gl);
146 146
147 GLuint id_; 147 GLuint id_;
148 GLenum target_; 148 GLenum target_;
149 QuerySyncManager::QueryInfo info_; 149 QuerySyncManager::QueryInfo info_;
150 State state_; 150 State state_;
151 base::subtle::Atomic32 submit_count_; 151 base::subtle::Atomic32 submit_count_;
152 int32 token_; 152 int32 token_;
153 uint32 flush_count_; 153 uint32 flush_count_;
154 uint64 client_begin_time_us_; // Only used for latency query target. 154 uint64 client_begin_time_us_; // Only used for latency query target.
155 uint32 result_; 155 uint64 result_;
156 }; 156 };
157 157
158 QueryTracker(MappedMemoryManager* manager); 158 QueryTracker(MappedMemoryManager* manager);
159 ~QueryTracker(); 159 ~QueryTracker();
160 160
161 Query* CreateQuery(GLuint id, GLenum target); 161 Query* CreateQuery(GLuint id, GLenum target);
162 Query* GetQuery(GLuint id); 162 Query* GetQuery(GLuint id);
163 Query* GetCurrentQuery(GLenum target); 163 Query* GetCurrentQuery(GLenum target);
164 void RemoveQuery(GLuint id); 164 void RemoveQuery(GLuint id);
165 void Shrink(); 165 void Shrink();
(...skipping 12 matching lines...) Expand all
178 QueryList removed_queries_; 178 QueryList removed_queries_;
179 QuerySyncManager query_sync_manager_; 179 QuerySyncManager query_sync_manager_;
180 180
181 DISALLOW_COPY_AND_ASSIGN(QueryTracker); 181 DISALLOW_COPY_AND_ASSIGN(QueryTracker);
182 }; 182 };
183 183
184 } // namespace gles2 184 } // namespace gles2
185 } // namespace gpu 185 } // namespace gpu
186 186
187 #endif // GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_ 187 #endif // GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698