| 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 "content/renderer/pepper/ppb_graphics_3d_impl.h" | 5 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 gpu::CommandBufferProxyImpl* share_buffer = NULL; | 238 gpu::CommandBufferProxyImpl* share_buffer = NULL; |
| 239 if (share_context) { | 239 if (share_context) { |
| 240 PPB_Graphics3D_Impl* share_graphics = | 240 PPB_Graphics3D_Impl* share_graphics = |
| 241 static_cast<PPB_Graphics3D_Impl*>(share_context); | 241 static_cast<PPB_Graphics3D_Impl*>(share_context); |
| 242 share_buffer = share_graphics->GetCommandBufferProxy(); | 242 share_buffer = share_graphics->GetCommandBufferProxy(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 command_buffer_ = channel->CreateCommandBuffer( | 245 command_buffer_ = channel->CreateCommandBuffer( |
| 246 gpu::kNullSurfaceHandle, surface_size, share_buffer, | 246 gpu::kNullSurfaceHandle, surface_size, share_buffer, |
| 247 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, attribs, | 247 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, attribs, |
| 248 GURL::EmptyGURL(), gpu_preference); | 248 GURL::EmptyGURL(), gpu_preference, base::ThreadTaskRunnerHandle::Get()); |
| 249 if (!command_buffer_) | 249 if (!command_buffer_) |
| 250 return false; | 250 return false; |
| 251 | 251 |
| 252 command_buffer_->SetGpuControlClient(this); | 252 command_buffer_->SetGpuControlClient(this); |
| 253 | 253 |
| 254 if (shared_state_handle) | 254 if (shared_state_handle) |
| 255 *shared_state_handle = command_buffer_->GetSharedStateHandle(); | 255 *shared_state_handle = command_buffer_->GetSharedStateHandle(); |
| 256 if (capabilities) | 256 if (capabilities) |
| 257 *capabilities = command_buffer_->GetCapabilities(); | 257 *capabilities = command_buffer_->GetCapabilities(); |
| 258 if (command_buffer_id) | 258 if (command_buffer_id) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); | 333 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); |
| 334 // We have to check *again* that the instance exists, because it could have | 334 // We have to check *again* that the instance exists, because it could have |
| 335 // been deleted during GetPluginInterface(). Even the PluginModule could be | 335 // been deleted during GetPluginInterface(). Even the PluginModule could be |
| 336 // deleted, but in that case, the instance should also be gone, so the | 336 // deleted, but in that case, the instance should also be gone, so the |
| 337 // GetInstance check covers both cases. | 337 // GetInstance check covers both cases. |
| 338 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 338 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
| 339 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 339 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace content | 342 } // namespace content |
| OLD | NEW |