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 | 238 |
239 gpu::CommandBufferProxyImpl* share_buffer = NULL; | 239 gpu::CommandBufferProxyImpl* share_buffer = NULL; |
240 if (share_context) { | 240 if (share_context) { |
241 PPB_Graphics3D_Impl* share_graphics = | 241 PPB_Graphics3D_Impl* share_graphics = |
242 static_cast<PPB_Graphics3D_Impl*>(share_context); | 242 static_cast<PPB_Graphics3D_Impl*>(share_context); |
243 share_buffer = share_graphics->GetCommandBufferProxy(); | 243 share_buffer = share_graphics->GetCommandBufferProxy(); |
244 } | 244 } |
245 | 245 |
246 command_buffer_ = channel->CreateCommandBuffer( | 246 command_buffer_ = channel->CreateCommandBuffer( |
247 gpu::kNullSurfaceHandle, surface_size, share_buffer, | 247 gpu::kNullSurfaceHandle, surface_size, share_buffer, |
248 gpu::GpuChannelHost::kDefaultStreamId, | 248 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, attribs, |
249 gpu::GpuChannelHost::kDefaultStreamPriority, attribs, GURL::EmptyGURL(), | 249 GURL::EmptyGURL(), gpu_preference); |
250 gpu_preference); | |
251 if (!command_buffer_) | 250 if (!command_buffer_) |
252 return false; | 251 return false; |
253 | 252 |
254 command_buffer_->SetGpuControlClient(this); | 253 command_buffer_->SetGpuControlClient(this); |
255 | 254 |
256 if (shared_state_handle) | 255 if (shared_state_handle) |
257 *shared_state_handle = command_buffer_->GetSharedStateHandle(); | 256 *shared_state_handle = command_buffer_->GetSharedStateHandle(); |
258 if (capabilities) | 257 if (capabilities) |
259 *capabilities = command_buffer_->GetCapabilities(); | 258 *capabilities = command_buffer_->GetCapabilities(); |
260 if (command_buffer_id) | 259 if (command_buffer_id) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); | 334 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); |
336 // 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 |
337 // been deleted during GetPluginInterface(). Even the PluginModule could be | 336 // been deleted during GetPluginInterface(). Even the PluginModule could be |
338 // 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 |
339 // GetInstance check covers both cases. | 338 // GetInstance check covers both cases. |
340 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 339 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
341 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 340 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
342 } | 341 } |
343 | 342 |
344 } // namespace content | 343 } // namespace content |
OLD | NEW |