| 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 "gpu/command_buffer/service/query_manager.h" | 5 #include "gpu/command_buffer/service/query_manager.h" |
| 6 | 6 |
| 7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 pending_transfer_queries_.clear(); | 325 pending_transfer_queries_.clear(); |
| 326 while (!queries_.empty()) { | 326 while (!queries_.empty()) { |
| 327 Query* query = queries_.begin()->second; | 327 Query* query = queries_.begin()->second; |
| 328 query->Destroy(have_context); | 328 query->Destroy(have_context); |
| 329 queries_.erase(queries_.begin()); | 329 queries_.erase(queries_.begin()); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 QueryManager::Query* QueryManager::CreateQuery( | 333 QueryManager::Query* QueryManager::CreateQuery( |
| 334 GLenum target, GLuint client_id, int32 shm_id, uint32 shm_offset) { | 334 GLenum target, GLuint client_id, int32 shm_id, uint32 shm_offset) { |
| 335 Query::Ref query; | 335 scoped_refptr<Query> query; |
| 336 switch (target) { | 336 switch (target) { |
| 337 case GL_COMMANDS_ISSUED_CHROMIUM: | 337 case GL_COMMANDS_ISSUED_CHROMIUM: |
| 338 query = new CommandsIssuedQuery(this, target, shm_id, shm_offset); | 338 query = new CommandsIssuedQuery(this, target, shm_id, shm_offset); |
| 339 break; | 339 break; |
| 340 case GL_LATENCY_QUERY_CHROMIUM: | 340 case GL_LATENCY_QUERY_CHROMIUM: |
| 341 query = new CommandLatencyQuery(this, target, shm_id, shm_offset); | 341 query = new CommandLatencyQuery(this, target, shm_id, shm_offset); |
| 342 break; | 342 break; |
| 343 case GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM: | 343 case GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM: |
| 344 query = new AsyncPixelTransfersCompletedQuery( | 344 query = new AsyncPixelTransfersCompletedQuery( |
| 345 this, target, shm_id, shm_offset); | 345 this, target, shm_id, shm_offset); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 if (!RemovePendingQuery(query)) { | 556 if (!RemovePendingQuery(query)) { |
| 557 return false; | 557 return false; |
| 558 } | 558 } |
| 559 return query->End(submit_count); | 559 return query->End(submit_count); |
| 560 } | 560 } |
| 561 | 561 |
| 562 } // namespace gles2 | 562 } // namespace gles2 |
| 563 } // namespace gpu | 563 } // namespace gpu |
| 564 | 564 |
| 565 | 565 |
| OLD | NEW |