| 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 // Force SW rendering for keyframe extraction to avoid pixel reads from VRAM. | 238 // Force SW rendering for keyframe extraction to avoid pixel reads from VRAM. |
| 239 PluginInstanceThrottlerImpl* throttler = plugin_instance->throttler(); | 239 PluginInstanceThrottlerImpl* throttler = plugin_instance->throttler(); |
| 240 if (throttler && throttler->needs_representative_keyframe()) | 240 if (throttler && throttler->needs_representative_keyframe()) |
| 241 return false; | 241 return false; |
| 242 | 242 |
| 243 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 243 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 244 if (!render_thread) | 244 if (!render_thread) |
| 245 return false; | 245 return false; |
| 246 | 246 |
| 247 channel_ = render_thread->EstablishGpuChannelSync( | 247 channel_ = render_thread->EstablishGpuChannelSync( |
| 248 CAUSE_FOR_GPU_LAUNCH_PEPPERPLATFORMCONTEXT3DIMPL_INITIALIZE); | 248 gpu::CAUSE_FOR_GPU_LAUNCH_PEPPERPLATFORMCONTEXT3DIMPL_INITIALIZE); |
| 249 if (!channel_.get()) | 249 if (!channel_.get()) |
| 250 return false; | 250 return false; |
| 251 | 251 |
| 252 gfx::Size surface_size; | 252 gfx::Size surface_size; |
| 253 std::vector<int32_t> attribs; | 253 std::vector<int32_t> attribs; |
| 254 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; | 254 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
| 255 // TODO(alokp): Change GpuChannelHost::CreateCommandBuffer() | 255 // TODO(alokp): Change GpuChannelHost::CreateCommandBuffer() |
| 256 // interface to accept width and height in the attrib_list so that | 256 // interface to accept width and height in the attrib_list so that |
| 257 // we do not need to filter for width and height here. | 257 // we do not need to filter for width and height here. |
| 258 if (attrib_list) { | 258 if (attrib_list) { |
| (...skipping 114 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 |