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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 | 286 |
287 CommandBufferProxyImpl* share_buffer = NULL; | 287 CommandBufferProxyImpl* share_buffer = NULL; |
288 if (share_context) { | 288 if (share_context) { |
289 PPB_Graphics3D_Impl* share_graphics = | 289 PPB_Graphics3D_Impl* share_graphics = |
290 static_cast<PPB_Graphics3D_Impl*>(share_context); | 290 static_cast<PPB_Graphics3D_Impl*>(share_context); |
291 share_buffer = share_graphics->GetCommandBufferProxy(); | 291 share_buffer = share_graphics->GetCommandBufferProxy(); |
292 } | 292 } |
293 | 293 |
294 command_buffer_ = channel_->CreateOffscreenCommandBuffer( | 294 command_buffer_ = channel_->CreateOffscreenCommandBuffer( |
295 surface_size, share_buffer, GpuChannelHost::kDefaultStreamId, | 295 surface_size, share_buffer, GpuChannelHost::kDefaultStreamId, |
296 GpuChannelHost::kDefaultStreamPriority, attribs, GURL::EmptyGURL(), | 296 GpuChannelHost::kDefaultStreamPriority, attribs, "", gpu_preference); |
piman
2016/02/18 18:29:28
nit: std::string()
Mark Dittmer
2016/02/18 21:10:25
Done.
| |
297 gpu_preference); | |
298 if (!command_buffer_) | 297 if (!command_buffer_) |
299 return false; | 298 return false; |
300 if (!command_buffer_->Initialize()) | 299 if (!command_buffer_->Initialize()) |
301 return false; | 300 return false; |
302 if (shared_state_handle) | 301 if (shared_state_handle) |
303 *shared_state_handle = command_buffer_->GetSharedStateHandle(); | 302 *shared_state_handle = command_buffer_->GetSharedStateHandle(); |
304 if (capabilities) | 303 if (capabilities) |
305 *capabilities = command_buffer_->GetCapabilities(); | 304 *capabilities = command_buffer_->GetCapabilities(); |
306 if (command_buffer_id) | 305 if (command_buffer_id) |
307 *command_buffer_id = command_buffer_->GetCommandBufferID(); | 306 *command_buffer_id = command_buffer_->GetCommandBufferID(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); | 373 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); |
375 // 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 |
376 // been deleted during GetPluginInterface(). Even the PluginModule could be | 375 // been deleted during GetPluginInterface(). Even the PluginModule could be |
377 // 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 |
378 // GetInstance check covers both cases. | 377 // GetInstance check covers both cases. |
379 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 378 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
380 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 379 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
381 } | 380 } |
382 | 381 |
383 } // namespace content | 382 } // namespace content |
OLD | NEW |