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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2414 } | 2414 } |
2415 | 2415 |
2416 // Accelerated video decode is not enabled by default on Linux. | 2416 // Accelerated video decode is not enabled by default on Linux. |
2417 // crbug.com/137247 | 2417 // crbug.com/137247 |
2418 bool use_accelerated_video_decode = false; | 2418 bool use_accelerated_video_decode = false; |
2419 #if defined(OS_CHROMEOS) || defined(OS_WIN) | 2419 #if defined(OS_CHROMEOS) || defined(OS_WIN) |
2420 use_accelerated_video_decode = true; | 2420 use_accelerated_video_decode = true; |
2421 #endif | 2421 #endif |
2422 use_accelerated_video_decode &= !CommandLine::ForCurrentProcess()->HasSwitch( | 2422 use_accelerated_video_decode &= !CommandLine::ForCurrentProcess()->HasSwitch( |
2423 switches::kDisableAcceleratedVideoDecode); | 2423 switches::kDisableAcceleratedVideoDecode); |
2424 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context3d = | 2424 WebGraphicsContext3DCommandBufferImpl* context3d = |
2425 use_accelerated_video_decode ? | 2425 use_accelerated_video_decode ? |
2426 RenderThreadImpl::current()->GetGpuVDAContext3D() : | 2426 RenderThreadImpl::current()->GetGpuVDAContext3D() : |
2427 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl>(); | 2427 NULL; |
2428 if (context3d) { | 2428 if (context3d) { |
2429 scoped_refptr<base::MessageLoopProxy> factories_loop = | 2429 scoped_refptr<base::MessageLoopProxy> factories_loop = |
2430 RenderThreadImpl::current()->compositor_thread() ? | 2430 RenderThreadImpl::current()->compositor_thread() ? |
2431 RenderThreadImpl::current()->compositor_thread()->GetWebThread() | 2431 RenderThreadImpl::current()->compositor_thread()->GetWebThread() |
2432 ->message_loop()->message_loop_proxy() : | 2432 ->message_loop()->message_loop_proxy() : |
2433 base::MessageLoopProxy::current(); | 2433 base::MessageLoopProxy::current(); |
2434 GpuChannelHost* gpu_channel_host = | 2434 GpuChannelHost* gpu_channel_host = |
2435 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2435 RenderThreadImpl::current()->EstablishGpuChannelSync( |
2436 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2436 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
2437 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( | 2437 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( |
(...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5767 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5767 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5768 return !!RenderThreadImpl::current()->compositor_thread(); | 5768 return !!RenderThreadImpl::current()->compositor_thread(); |
5769 } | 5769 } |
5770 | 5770 |
5771 void RenderViewImpl::OnJavaBridgeInit() { | 5771 void RenderViewImpl::OnJavaBridgeInit() { |
5772 DCHECK(!java_bridge_dispatcher_); | 5772 DCHECK(!java_bridge_dispatcher_); |
5773 #if defined(ENABLE_JAVA_BRIDGE) | 5773 #if defined(ENABLE_JAVA_BRIDGE) |
5774 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5774 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5775 #endif | 5775 #endif |
5776 } | 5776 } |
OLD | NEW |