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 <vector> | 10 #include <vector> |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1349 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), | 1349 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
1350 NULL)), | 1350 NULL)), |
1351 GPU_VIDEO_ACCELERATOR_CONTEXT); | 1351 GPU_VIDEO_ACCELERATOR_CONTEXT); |
1352 } | 1352 } |
1353 if (gpu_va_context_provider_.get()) { | 1353 if (gpu_va_context_provider_.get()) { |
1354 const bool enable_video_accelerator = | 1354 const bool enable_video_accelerator = |
1355 !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | 1355 !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); |
1356 const bool enable_gpu_memory_buffer_video_frames = | 1356 const bool enable_gpu_memory_buffer_video_frames = |
1357 cmd_line->HasSwitch(switches::kEnableGpuMemoryBufferVideoFrames); | 1357 cmd_line->HasSwitch(switches::kEnableGpuMemoryBufferVideoFrames); |
1358 std::string image_texture_target_string = | 1358 std::string image_texture_target_string = |
1359 cmd_line->GetSwitchValueASCII(switches::kVideoImageTextureTarget); | 1359 cmd_line->GetSwitchValueASCII(switches::kVideoImageTextureTarget); |
reveman
2015/08/21 21:53:02
How can we know what the correct image target is w
Daniele Castagna
2015/08/21 22:46:04
Good point. Now we're lucky because on Mac is alwa
| |
1360 unsigned image_texture_target = 0; | 1360 unsigned image_texture_target = 0; |
1361 const bool parsed_image_texture_target = | 1361 const bool parsed_image_texture_target = |
1362 base::StringToUint(image_texture_target_string, &image_texture_target); | 1362 base::StringToUint(image_texture_target_string, &image_texture_target); |
1363 DCHECK(parsed_image_texture_target); | 1363 DCHECK(parsed_image_texture_target); |
1364 CHECK(gpu_channel_.get()) << "Have gpu_va_context_provider but no " | 1364 CHECK(gpu_channel_.get()) << "Have gpu_va_context_provider but no " |
1365 "gpu_channel_. See crbug.com/495185."; | 1365 "gpu_channel_. See crbug.com/495185."; |
1366 CHECK(gpu_channel_host.get()) << "Have gpu_va_context_provider but lost " | 1366 CHECK(gpu_channel_host.get()) << "Have gpu_va_context_provider but lost " |
1367 "gpu_channel_. See crbug.com/495185."; | 1367 "gpu_channel_. See crbug.com/495185."; |
1368 media::VideoPixelFormat video_pixel_format = media::PIXEL_FORMAT_I420; | |
1369 #if defined(OS_MACOSX) | |
1370 // TODO(dcastagna): Check that the extension is available. | |
1371 video_pixel_format = media::PIXEL_FORMAT_UYVY; | |
reveman
2015/08/21 21:53:02
why is this not decided where we check if RG exten
| |
1372 #endif | |
1368 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( | 1373 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( |
1369 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_, | 1374 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_, |
1370 enable_gpu_memory_buffer_video_frames, image_texture_target, | 1375 enable_gpu_memory_buffer_video_frames, image_texture_target, |
1371 enable_video_accelerator); | 1376 video_pixel_format, enable_video_accelerator); |
1372 } | 1377 } |
1373 return gpu_factories; | 1378 return gpu_factories; |
1374 } | 1379 } |
1375 | 1380 |
1376 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 1381 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
1377 RenderThreadImpl::CreateOffscreenContext3d() { | 1382 RenderThreadImpl::CreateOffscreenContext3d() { |
1378 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); | 1383 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); |
1379 bool lose_context_when_out_of_memory = true; | 1384 bool lose_context_when_out_of_memory = true; |
1380 | 1385 |
1381 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( | 1386 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1960 } | 1965 } |
1961 | 1966 |
1962 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1967 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1963 size_t erased = | 1968 size_t erased = |
1964 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1969 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1965 routing_id_); | 1970 routing_id_); |
1966 DCHECK_EQ(1u, erased); | 1971 DCHECK_EQ(1u, erased); |
1967 } | 1972 } |
1968 | 1973 |
1969 } // namespace content | 1974 } // namespace content |
OLD | NEW |