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

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

Issue 10837105: Adjust Query code to handle context lost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 #include <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 7
8 #include "../client/query_tracker.h" 8 #include "../client/query_tracker.h"
9 9
10 #include "../client/atomicops.h" 10 #include "../client/atomicops.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 GPU_DCHECK(result.second); 144 GPU_DCHECK(result.second);
145 return query; 145 return query;
146 } 146 }
147 147
148 QueryTracker::Query* QueryTracker::GetQuery( 148 QueryTracker::Query* QueryTracker::GetQuery(
149 GLuint client_id) { 149 GLuint client_id) {
150 QueryMap::iterator it = queries_.find(client_id); 150 QueryMap::iterator it = queries_.find(client_id);
151 return it != queries_.end() ? it->second : NULL; 151 return it != queries_.end() ? it->second : NULL;
152 } 152 }
153 153
154 void QueryTracker::RemoveQuery(GLuint client_id) { 154 void QueryTracker::RemoveQuery(GLuint client_id, bool context_lost) {
155 (void)context_lost; // stop unused warning
155 QueryMap::iterator it = queries_.find(client_id); 156 QueryMap::iterator it = queries_.find(client_id);
156 if (it != queries_.end()) { 157 if (it != queries_.end()) {
157 Query* query = it->second; 158 Query* query = it->second;
158 GPU_DCHECK(!query->Pending()); 159 GPU_DCHECK(context_lost || !query->Pending());
159 query_sync_manager_.Free(query->info_); 160 query_sync_manager_.Free(query->info_);
160 queries_.erase(it); 161 queries_.erase(it);
161 delete query; 162 delete query;
162 } 163 }
163 } 164 }
164 165
165 } // namespace gles2 166 } // namespace gles2
166 } // namespace gpu 167 } // namespace gpu
167 168
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/query_tracker.h ('k') | gpu/command_buffer/client/query_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698