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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 CommandBufferProxyImpl* share_buffer = NULL; | 286 CommandBufferProxyImpl* share_buffer = NULL; |
287 if (share_context) { | 287 if (share_context) { |
288 PPB_Graphics3D_Impl* share_graphics = | 288 PPB_Graphics3D_Impl* share_graphics = |
289 static_cast<PPB_Graphics3D_Impl*>(share_context); | 289 static_cast<PPB_Graphics3D_Impl*>(share_context); |
290 share_buffer = share_graphics->GetCommandBufferProxy(); | 290 share_buffer = share_graphics->GetCommandBufferProxy(); |
291 } | 291 } |
292 | 292 |
293 command_buffer_ = channel_->CreateOffscreenCommandBuffer( | 293 command_buffer_ = channel_->CreateOffscreenCommandBuffer( |
294 surface_size, share_buffer, GpuChannelHost::kDefaultStreamId, | 294 surface_size, share_buffer, GpuChannelHost::kDefaultStreamId, |
295 GpuChannelHost::kDefaultStreamPriority, attribs, GURL::EmptyGURL(), | 295 GpuChannelHost::kDefaultStreamPriority, attribs, std::string(), |
296 gpu_preference); | 296 gpu_preference); |
297 if (!command_buffer_) | 297 if (!command_buffer_) |
298 return false; | 298 return false; |
299 if (!command_buffer_->Initialize()) | 299 if (!command_buffer_->Initialize()) |
300 return false; | 300 return false; |
301 if (shared_state_handle) | 301 if (shared_state_handle) |
302 *shared_state_handle = command_buffer_->GetSharedStateHandle(); | 302 *shared_state_handle = command_buffer_->GetSharedStateHandle(); |
303 if (capabilities) | 303 if (capabilities) |
304 *capabilities = command_buffer_->GetCapabilities(); | 304 *capabilities = command_buffer_->GetCapabilities(); |
305 if (command_buffer_id) | 305 if (command_buffer_id) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); | 373 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); |
374 // We have to check *again* that the instance exists, because it could have | 374 // We have to check *again* that the instance exists, because it could have |
375 // been deleted during GetPluginInterface(). Even the PluginModule could be | 375 // been deleted during GetPluginInterface(). Even the PluginModule could be |
376 // deleted, but in that case, the instance should also be gone, so the | 376 // deleted, but in that case, the instance should also be gone, so the |
377 // GetInstance check covers both cases. | 377 // GetInstance check covers both cases. |
378 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 378 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
379 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 379 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
380 } | 380 } |
381 | 381 |
382 } // namespace content | 382 } // namespace content |
OLD | NEW |