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

Side by Side Diff: gpu/command_buffer/service/query_manager.cc

Issue 17948002: Update Linux to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 #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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 359 }
360 std::pair<QueryMap::iterator, bool> result = 360 std::pair<QueryMap::iterator, bool> result =
361 queries_.insert(std::make_pair(client_id, query)); 361 queries_.insert(std::make_pair(client_id, query));
362 DCHECK(result.second); 362 DCHECK(result.second);
363 return query.get(); 363 return query.get();
364 } 364 }
365 365
366 QueryManager::Query* QueryManager::GetQuery( 366 QueryManager::Query* QueryManager::GetQuery(
367 GLuint client_id) { 367 GLuint client_id) {
368 QueryMap::iterator it = queries_.find(client_id); 368 QueryMap::iterator it = queries_.find(client_id);
369 return it != queries_.end() ? it->second : NULL; 369 return it != queries_.end() ? it->second.get() : NULL;
370 } 370 }
371 371
372 void QueryManager::RemoveQuery(GLuint client_id) { 372 void QueryManager::RemoveQuery(GLuint client_id) {
373 QueryMap::iterator it = queries_.find(client_id); 373 QueryMap::iterator it = queries_.find(client_id);
374 if (it != queries_.end()) { 374 if (it != queries_.end()) {
375 Query* query = it->second.get(); 375 Query* query = it->second.get();
376 RemovePendingQuery(query); 376 RemovePendingQuery(query);
377 query->MarkAsDeleted(); 377 query->MarkAsDeleted();
378 queries_.erase(it); 378 queries_.erase(it);
379 } 379 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 bool QueryManager::EndQuery(Query* query, uint32 submit_count) { 576 bool QueryManager::EndQuery(Query* query, uint32 submit_count) {
577 DCHECK(query); 577 DCHECK(query);
578 if (!RemovePendingQuery(query)) { 578 if (!RemovePendingQuery(query)) {
579 return false; 579 return false;
580 } 580 }
581 return query->End(submit_count); 581 return query->End(submit_count);
582 } 582 }
583 583
584 } // namespace gles2 584 } // namespace gles2
585 } // namespace gpu 585 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/renderbuffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698