| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::GpuChannelHost::kDefaultStreamId, | 247 gpu::GpuChannelHost::kDefaultStreamId, |
| 248 gpu::GpuChannelHost::kDefaultStreamPriority, attribs, GURL::EmptyGURL(), | 248 gpu::GpuChannelHost::kDefaultStreamPriority, attribs, GURL::EmptyGURL(), |
| 249 gpu_preference); | 249 gpu_preference, base::ThreadTaskRunnerHandle::Get()); |
| 250 if (!command_buffer_) | 250 if (!command_buffer_) |
| 251 return false; | 251 return false; |
| 252 | 252 |
| 253 command_buffer_->SetGpuControlClient(this); | 253 command_buffer_->SetGpuControlClient(this); |
| 254 | 254 |
| 255 if (shared_state_handle) | 255 if (shared_state_handle) |
| 256 *shared_state_handle = command_buffer_->GetSharedStateHandle(); | 256 *shared_state_handle = command_buffer_->GetSharedStateHandle(); |
| 257 if (capabilities) | 257 if (capabilities) |
| 258 *capabilities = command_buffer_->GetCapabilities(); | 258 *capabilities = command_buffer_->GetCapabilities(); |
| 259 if (command_buffer_id) | 259 if (command_buffer_id) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); | 334 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); |
| 335 // We have to check *again* that the instance exists, because it could have | 335 // We have to check *again* that the instance exists, because it could have |
| 336 // been deleted during GetPluginInterface(). Even the PluginModule could be | 336 // been deleted during GetPluginInterface(). Even the PluginModule could be |
| 337 // deleted, but in that case, the instance should also be gone, so the | 337 // deleted, but in that case, the instance should also be gone, so the |
| 338 // GetInstance check covers both cases. | 338 // GetInstance check covers both cases. |
| 339 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 339 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
| 340 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 340 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace content | 343 } // namespace content |
| OLD | NEW |