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

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

Issue 18340003: gpu: Fix removal of pending queries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
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>
11 #include <list>
12
11 #include "gles2_impl_export.h" 13 #include "gles2_impl_export.h"
12 #include "gpu/command_buffer/client/hash_tables.h" 14 #include "gpu/command_buffer/client/hash_tables.h"
13 #include "gpu/command_buffer/common/gles2_cmd_format.h" 15 #include "gpu/command_buffer/common/gles2_cmd_format.h"
14 16
15 namespace gpu { 17 namespace gpu {
16 18
17 class CommandBufferHelper; 19 class CommandBufferHelper;
18 class MappedMemoryManager; 20 class MappedMemoryManager;
19 21
20 namespace gles2 { 22 namespace gles2 {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 bool flushed_; 149 bool flushed_;
148 uint64 client_begin_time_us_; // Only used for latency query target. 150 uint64 client_begin_time_us_; // Only used for latency query target.
149 uint32 result_; 151 uint32 result_;
150 }; 152 };
151 153
152 QueryTracker(MappedMemoryManager* manager); 154 QueryTracker(MappedMemoryManager* manager);
153 ~QueryTracker(); 155 ~QueryTracker();
154 156
155 Query* CreateQuery(GLuint id, GLenum target); 157 Query* CreateQuery(GLuint id, GLenum target);
156 Query* GetQuery(GLuint id); 158 Query* GetQuery(GLuint id);
157 void RemoveQuery(GLuint id, bool context_lost); 159 void RemoveQuery(GLuint id);
158 void Shrink(); 160 void Shrink();
161 void FreeCompletedQueries();
159 162
160 private: 163 private:
161 typedef gpu::hash_map<GLuint, Query*> QueryMap; 164 typedef gpu::hash_map<GLuint, Query*> QueryMap;
165 typedef std::list<Query*> QueryList;
162 166
163 QueryMap queries_; 167 QueryMap queries_;
168 QueryList removed_queries_;
164 QuerySyncManager query_sync_manager_; 169 QuerySyncManager query_sync_manager_;
165 170
166 DISALLOW_COPY_AND_ASSIGN(QueryTracker); 171 DISALLOW_COPY_AND_ASSIGN(QueryTracker);
167 }; 172 };
168 173
169 } // namespace gles2 174 } // namespace gles2
170 } // namespace gpu 175 } // namespace gpu
171 176
172 #endif // GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_ 177 #endif // GPU_COMMAND_BUFFER_CLIENT_QUERY_TRACKER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | gpu/command_buffer/client/query_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698