OLD | NEW |
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 Loading... |
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 |
OLD | NEW |