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

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

Issue 16207005: Fix remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/context_group.h" 5 #include "gpu/command_buffer/service/context_group.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 } // namespace anonymous 245 } // namespace anonymous
246 246
247 bool ContextGroup::HaveContexts() { 247 bool ContextGroup::HaveContexts() {
248 decoders_.erase(std::remove_if(decoders_.begin(), decoders_.end(), IsNull), 248 decoders_.erase(std::remove_if(decoders_.begin(), decoders_.end(), IsNull),
249 decoders_.end()); 249 decoders_.end());
250 return !decoders_.empty(); 250 return !decoders_.empty();
251 } 251 }
252 252
253 void ContextGroup::Destroy(GLES2Decoder* decoder, bool have_context) { 253 void ContextGroup::Destroy(GLES2Decoder* decoder, bool have_context) {
254 decoders_.erase(std::remove(decoders_.begin(), decoders_.end(), decoder), 254 decoders_.erase(std::remove(decoders_.begin(), decoders_.end(),
255 decoder->AsWeakPtr()),
255 decoders_.end()); 256 decoders_.end());
256 // If we still have contexts do nothing. 257 // If we still have contexts do nothing.
257 if (HaveContexts()) { 258 if (HaveContexts()) {
258 return; 259 return;
259 } 260 }
260 261
261 if (buffer_manager_ != NULL) { 262 if (buffer_manager_ != NULL) {
262 buffer_manager_->Destroy(have_context); 263 buffer_manager_->Destroy(have_context);
263 buffer_manager_.reset(); 264 buffer_manager_.reset();
264 } 265 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 GLenum pname, GLint min_required, uint32* v) { 354 GLenum pname, GLint min_required, uint32* v) {
354 uint32 value = 0; 355 uint32 value = 0;
355 GetIntegerv(pname, &value); 356 GetIntegerv(pname, &value);
356 bool result = CheckGLFeatureU(min_required, &value); 357 bool result = CheckGLFeatureU(min_required, &value);
357 *v = value; 358 *v = value;
358 return result; 359 return result;
359 } 360 }
360 361
361 } // namespace gles2 362 } // namespace gles2
362 } // namespace gpu 363 } // namespace gpu
OLDNEW
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | media/audio/audio_output_dispatcher_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698