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/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1443 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel(); | 1443 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel(); |
1444 if (shared_context_provider && gpu_channel_host) { | 1444 if (shared_context_provider && gpu_channel_host) { |
1445 const bool enable_video_accelerator = | 1445 const bool enable_video_accelerator = |
1446 !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | 1446 !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); |
1447 const bool enable_gpu_memory_buffer_video_frames = | 1447 const bool enable_gpu_memory_buffer_video_frames = |
1448 #if defined(OS_MACOSX) | 1448 #if defined(OS_MACOSX) |
1449 !cmd_line->HasSwitch(switches::kDisableGpuMemoryBufferVideoFrames); | 1449 !cmd_line->HasSwitch(switches::kDisableGpuMemoryBufferVideoFrames); |
1450 #else | 1450 #else |
1451 cmd_line->HasSwitch(switches::kEnableGpuMemoryBufferVideoFrames); | 1451 cmd_line->HasSwitch(switches::kEnableGpuMemoryBufferVideoFrames); |
1452 #endif | 1452 #endif |
1453 std::string image_texture_target_string = | 1453 std::vector<unsigned> image_texture_targets; |
| 1454 std::string video_frame_image_texture_target_string = |
1454 cmd_line->GetSwitchValueASCII(switches::kVideoImageTextureTarget); | 1455 cmd_line->GetSwitchValueASCII(switches::kVideoImageTextureTarget); |
1455 unsigned image_texture_target = 0; | 1456 StringToUintVector(video_frame_image_texture_target_string, |
1456 const bool parsed_image_texture_target = | 1457 &image_texture_targets); |
1457 base::StringToUint(image_texture_target_string, &image_texture_target); | 1458 |
1458 DCHECK(parsed_image_texture_target); | |
1459 gpu_factories_ = RendererGpuVideoAcceleratorFactories::Create( | 1459 gpu_factories_ = RendererGpuVideoAcceleratorFactories::Create( |
1460 gpu_channel_host.get(), base::ThreadTaskRunnerHandle::Get(), | 1460 gpu_channel_host.get(), base::ThreadTaskRunnerHandle::Get(), |
1461 media_task_runner, shared_context_provider, | 1461 media_task_runner, shared_context_provider, |
1462 enable_gpu_memory_buffer_video_frames, image_texture_target, | 1462 enable_gpu_memory_buffer_video_frames, image_texture_targets, |
1463 enable_video_accelerator); | 1463 enable_video_accelerator); |
1464 } | 1464 } |
1465 return gpu_factories_.get(); | 1465 return gpu_factories_.get(); |
1466 } | 1466 } |
1467 | 1467 |
1468 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 1468 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
1469 RenderThreadImpl::CreateOffscreenContext3d() { | 1469 RenderThreadImpl::CreateOffscreenContext3d() { |
1470 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); | 1470 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); |
1471 bool lose_context_when_out_of_memory = true; | 1471 bool lose_context_when_out_of_memory = true; |
1472 | 1472 |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 } | 2095 } |
2096 | 2096 |
2097 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2097 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
2098 size_t erased = | 2098 size_t erased = |
2099 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2099 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
2100 routing_id_); | 2100 routing_id_); |
2101 DCHECK_EQ(1u, erased); | 2101 DCHECK_EQ(1u, erased); |
2102 } | 2102 } |
2103 | 2103 |
2104 } // namespace content | 2104 } // namespace content |
OLD | NEW |