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

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

Issue 2880013: Free the resources used by a context group. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "app/gfx/gl/gl_context.h" 8 #include "app/gfx/gl/gl_context.h"
9 #include "gpu/command_buffer/service/gpu_processor.h" 9 #include "gpu/command_buffer/service/gpu_processor.h"
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 parent_decoder, 63 parent_decoder,
64 parent_texture_id)) { 64 parent_texture_id)) {
65 Destroy(); 65 Destroy();
66 return false; 66 return false;
67 } 67 }
68 68
69 return true; 69 return true;
70 } 70 }
71 71
72 void GPUProcessor::DestroyCommon() { 72 void GPUProcessor::DestroyCommon() {
73 bool have_context = false;
73 if (decoder_.get()) { 74 if (decoder_.get()) {
75 have_context = decoder_->MakeCurrent();
74 decoder_->Destroy(); 76 decoder_->Destroy();
75 decoder_.reset(); 77 decoder_.reset();
76 } 78 }
77 79
80 group_.Destroy(have_context);
81
78 if (context_.get()) { 82 if (context_.get()) {
79 context_->Destroy(); 83 context_->Destroy();
80 context_.reset(); 84 context_.reset();
81 } 85 }
82 86
83 parser_.reset(); 87 parser_.reset();
84 } 88 }
85 89
86 void GPUProcessor::ProcessCommands() { 90 void GPUProcessor::ProcessCommands() {
87 CommandBuffer::State state = command_buffer_->GetState(); 91 CommandBuffer::State state = command_buffer_->GetState();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 145
142 void GPUProcessor::SetSwapBuffersCallback( 146 void GPUProcessor::SetSwapBuffersCallback(
143 Callback0::Type* callback) { 147 Callback0::Type* callback) {
144 wrapped_swap_buffers_callback_.reset(callback); 148 wrapped_swap_buffers_callback_.reset(callback);
145 decoder_->SetSwapBuffersCallback( 149 decoder_->SetSwapBuffersCallback(
146 NewCallback(this, 150 NewCallback(this,
147 &GPUProcessor::WillSwapBuffers)); 151 &GPUProcessor::WillSwapBuffers));
148 } 152 }
149 153
150 } // namespace gpu 154 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_processor.h ('k') | gpu/command_buffer/service/gpu_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698