| Index: gpu/command_buffer/service/gpu_processor_mac.cc
|
| ===================================================================
|
| --- gpu/command_buffer/service/gpu_processor_mac.cc (revision 42644)
|
| +++ gpu/command_buffer/service/gpu_processor_mac.cc (working copy)
|
| @@ -8,7 +8,10 @@
|
|
|
| namespace gpu {
|
|
|
| -bool GPUProcessor::Initialize(gfx::PluginWindowHandle handle) {
|
| +bool GPUProcessor::Initialize(gfx::PluginWindowHandle handle,
|
| + GPUProcessor* parent,
|
| + const gfx::Size& size,
|
| + uint32 parent_texture_id) {
|
| // At this level we do not need the PluginWindowHandle. It is only
|
| // needed at the CommandBufferStub level to identify which GPU
|
| // plugin instance is creating a new backing store in response to a
|
| @@ -29,11 +32,25 @@
|
| }
|
|
|
| // Initialize GAPI.
|
| - return decoder_->Initialize();
|
| + gles2::GLES2Decoder* parent_decoder = parent ? parent->decoder_.get() : NULL;
|
| + if (!decoder_->Initialize(parent_decoder,
|
| + size,
|
| + parent_texture_id)) {
|
| + Destroy();
|
| + return false;
|
| + }
|
| +
|
| + return true;
|
| }
|
|
|
| void GPUProcessor::Destroy() {
|
| - decoder_->Destroy();
|
| + // Destroy decoder if initialized.
|
| + if (decoder_.get()) {
|
| + decoder_->Destroy();
|
| + decoder_.reset();
|
| + }
|
| +
|
| + parser_.reset();
|
| }
|
| } // namespace gpu
|
|
|
|
|