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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 *info = free_queries_.front(); | 48 *info = free_queries_.front(); |
49 info->sync->Reset(); | 49 info->sync->Reset(); |
50 free_queries_.pop(); | 50 free_queries_.pop(); |
51 return true; | 51 return true; |
52 } | 52 } |
53 | 53 |
54 void QuerySyncManager::Free(const QuerySyncManager::QueryInfo& info) { | 54 void QuerySyncManager::Free(const QuerySyncManager::QueryInfo& info) { |
55 free_queries_.push(info); | 55 free_queries_.push(info); |
56 } | 56 } |
57 | 57 |
| 58 QueryTracker::Query::Query(GLuint id, GLenum target, |
| 59 const QuerySyncManager::QueryInfo& info) |
| 60 : id_(id), |
| 61 target_(target), |
| 62 info_(info), |
| 63 state_(kUninitialized), |
| 64 submit_count_(0), |
| 65 token_(0), |
| 66 flushed_(false), |
| 67 result_(0) { |
| 68 } |
| 69 |
| 70 |
58 void QueryTracker::Query::Begin(GLES2Implementation* gl) { | 71 void QueryTracker::Query::Begin(GLES2Implementation* gl) { |
59 // init memory, inc count | 72 // init memory, inc count |
60 MarkAsActive(); | 73 MarkAsActive(); |
61 | 74 |
62 switch (target()) { | 75 switch (target()) { |
63 case GL_GET_ERROR_QUERY_CHROMIUM: | 76 case GL_GET_ERROR_QUERY_CHROMIUM: |
64 // To nothing on begin for error queries. | 77 // To nothing on begin for error queries. |
65 break; | 78 break; |
66 default: | 79 default: |
67 // tell service about id, shared memory and count | 80 // tell service about id, shared memory and count |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 Query* query = it->second; | 171 Query* query = it->second; |
159 GPU_DCHECK(context_lost || !query->Pending()); | 172 GPU_DCHECK(context_lost || !query->Pending()); |
160 query_sync_manager_.Free(query->info_); | 173 query_sync_manager_.Free(query->info_); |
161 queries_.erase(it); | 174 queries_.erase(it); |
162 delete query; | 175 delete query; |
163 } | 176 } |
164 } | 177 } |
165 | 178 |
166 } // namespace gles2 | 179 } // namespace gles2 |
167 } // namespace gpu | 180 } // namespace gpu |
168 | |
OLD | NEW |