Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1280)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10832356: Use GPU blacklist to control accelerated video decode. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 // from the perspective of the audio renderer. 2396 // from the perspective of the audio renderer.
2397 audio_source_provider = new RenderAudioSourceProvider(); 2397 audio_source_provider = new RenderAudioSourceProvider();
2398 2398
2399 // Add the chrome specific audio renderer, using audio_source_provider 2399 // Add the chrome specific audio renderer, using audio_source_provider
2400 // as the sink. 2400 // as the sink.
2401 media::AudioRendererImpl* audio_renderer = 2401 media::AudioRendererImpl* audio_renderer =
2402 new media::AudioRendererImpl(audio_source_provider); 2402 new media::AudioRendererImpl(audio_source_provider);
2403 collection->AddAudioRenderer(audio_renderer); 2403 collection->AddAudioRenderer(audio_renderer);
2404 } 2404 }
2405 2405
2406 // Accelerated video decode is not enabled by default on Linux. 2406 WebGraphicsContext3DCommandBufferImpl* context3d = NULL;
2407 // crbug.com/137247 2407 if (!CommandLine::ForCurrentProcess()->HasSwitch(
2408 bool use_accelerated_video_decode = false; 2408 switches::kDisableAcceleratedVideoDecode))
2409 #if defined(OS_CHROMEOS) || defined(OS_WIN) 2409 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D();
2410 use_accelerated_video_decode = true;
2411 #endif
2412 use_accelerated_video_decode &= !CommandLine::ForCurrentProcess()->HasSwitch(
2413 switches::kDisableAcceleratedVideoDecode);
2414 WebGraphicsContext3DCommandBufferImpl* context3d =
2415 use_accelerated_video_decode ?
2416 RenderThreadImpl::current()->GetGpuVDAContext3D() :
2417 NULL;
2418 if (context3d) { 2410 if (context3d) {
2419 scoped_refptr<base::MessageLoopProxy> factories_loop = 2411 scoped_refptr<base::MessageLoopProxy> factories_loop =
2420 RenderThreadImpl::current()->compositor_thread() ? 2412 RenderThreadImpl::current()->compositor_thread() ?
2421 RenderThreadImpl::current()->compositor_thread()->GetWebThread() 2413 RenderThreadImpl::current()->compositor_thread()->GetWebThread()
2422 ->message_loop()->message_loop_proxy() : 2414 ->message_loop()->message_loop_proxy() :
2423 base::MessageLoopProxy::current(); 2415 base::MessageLoopProxy::current();
2424 GpuChannelHost* gpu_channel_host = 2416 GpuChannelHost* gpu_channel_host =
2425 RenderThreadImpl::current()->EstablishGpuChannelSync( 2417 RenderThreadImpl::current()->EstablishGpuChannelSync(
2426 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 2418 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
2427 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( 2419 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder(
(...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after
5806 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5798 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5807 return !!RenderThreadImpl::current()->compositor_thread(); 5799 return !!RenderThreadImpl::current()->compositor_thread();
5808 } 5800 }
5809 5801
5810 void RenderViewImpl::OnJavaBridgeInit() { 5802 void RenderViewImpl::OnJavaBridgeInit() {
5811 DCHECK(!java_bridge_dispatcher_); 5803 DCHECK(!java_bridge_dispatcher_);
5812 #if defined(ENABLE_JAVA_BRIDGE) 5804 #if defined(ENABLE_JAVA_BRIDGE)
5813 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5805 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5814 #endif 5806 #endif
5815 } 5807 }
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698