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 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 std::string image_texture_target_string = | 1356 std::string image_texture_target_string = |
1357 cmd_line->GetSwitchValueASCII(switches::kVideoImageTextureTarget); | 1357 cmd_line->GetSwitchValueASCII(switches::kVideoImageTextureTarget); |
1358 unsigned image_texture_target = 0; | 1358 unsigned image_texture_target = 0; |
1359 bool parsed_image_texture_target = | 1359 bool parsed_image_texture_target = |
1360 base::StringToUint(image_texture_target_string, &image_texture_target); | 1360 base::StringToUint(image_texture_target_string, &image_texture_target); |
1361 DCHECK(parsed_image_texture_target); | 1361 DCHECK(parsed_image_texture_target); |
1362 CHECK(gpu_channel_.get()) << "Have gpu_va_context_provider but no " | 1362 CHECK(gpu_channel_.get()) << "Have gpu_va_context_provider but no " |
1363 "gpu_channel_. See crbug.com/495185."; | 1363 "gpu_channel_. See crbug.com/495185."; |
1364 CHECK(gpu_channel_host.get()) << "Have gpu_va_context_provider but lost " | 1364 CHECK(gpu_channel_host.get()) << "Have gpu_va_context_provider but lost " |
1365 "gpu_channel_. See crbug.com/495185."; | 1365 "gpu_channel_. See crbug.com/495185."; |
| 1366 media::VideoPixelFormat video_pixel_format = media::PIXEL_FORMAT_I420; |
| 1367 #if defined(OS_MACOSX) |
| 1368 // TODO(dcastagna): Check that the extension is available. |
| 1369 video_pixel_format = media::PIXEL_FORMAT_UYVY; |
| 1370 #endif |
1366 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( | 1371 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( |
1367 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_, | 1372 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_, |
1368 image_texture_target, enable_video_accelerator); | 1373 image_texture_target, video_pixel_format, enable_video_accelerator); |
1369 } | 1374 } |
1370 return gpu_factories; | 1375 return gpu_factories; |
1371 } | 1376 } |
1372 | 1377 |
1373 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 1378 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
1374 RenderThreadImpl::CreateOffscreenContext3d() { | 1379 RenderThreadImpl::CreateOffscreenContext3d() { |
1375 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); | 1380 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); |
1376 bool lose_context_when_out_of_memory = true; | 1381 bool lose_context_when_out_of_memory = true; |
1377 | 1382 |
1378 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( | 1383 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1957 } | 1962 } |
1958 | 1963 |
1959 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1964 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1960 size_t erased = | 1965 size_t erased = |
1961 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1966 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1962 routing_id_); | 1967 routing_id_); |
1963 DCHECK_EQ(1u, erased); | 1968 DCHECK_EQ(1u, erased); |
1964 } | 1969 } |
1965 | 1970 |
1966 } // namespace content | 1971 } // namespace content |
OLD | NEW |