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

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
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 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after
2389 // from the perspective of the audio renderer. 2389 // from the perspective of the audio renderer.
2390 audio_source_provider = new RenderAudioSourceProvider(); 2390 audio_source_provider = new RenderAudioSourceProvider();
2391 2391
2392 // Add the chrome specific audio renderer, using audio_source_provider 2392 // Add the chrome specific audio renderer, using audio_source_provider
2393 // as the sink. 2393 // as the sink.
2394 media::AudioRendererImpl* audio_renderer = 2394 media::AudioRendererImpl* audio_renderer =
2395 new media::AudioRendererImpl(audio_source_provider); 2395 new media::AudioRendererImpl(audio_source_provider);
2396 collection->AddAudioRenderer(audio_renderer); 2396 collection->AddAudioRenderer(audio_renderer);
2397 } 2397 }
2398 2398
2399 // Accelerated video decode is not enabled by default on Linux. 2399 if (!CommandLine::ForCurrentProcess()->HasSwitch(
2400 // crbug.com/137247 2400 switches::kDisableAcceleratedVideoDecode)) {
2401 bool use_accelerated_video_decode = false; 2401 WebGraphicsContext3DCommandBufferImpl* context3d =
Ami GONE FROM CHROMIUM 2012/08/17 17:51:03 You went too far :) context3d may still be NULL af
Zhenyao Mo 2012/08/17 20:08:17 Ah thanks for catching the bug. Fixed.
2402 #if defined(OS_CHROMEOS) 2402 RenderThreadImpl::current()->GetGpuVDAContext3D();
2403 use_accelerated_video_decode = true;
2404 #endif
2405 use_accelerated_video_decode &= !CommandLine::ForCurrentProcess()->HasSwitch(
2406 switches::kDisableAcceleratedVideoDecode);
2407 WebGraphicsContext3DCommandBufferImpl* context3d =
2408 use_accelerated_video_decode ?
2409 RenderThreadImpl::current()->GetGpuVDAContext3D() :
2410 NULL;
2411 if (context3d) {
2412 scoped_refptr<base::MessageLoopProxy> factories_loop = 2403 scoped_refptr<base::MessageLoopProxy> factories_loop =
2413 RenderThreadImpl::current()->compositor_thread() ? 2404 RenderThreadImpl::current()->compositor_thread() ?
2414 RenderThreadImpl::current()->compositor_thread()->GetWebThread() 2405 RenderThreadImpl::current()->compositor_thread()->GetWebThread()
2415 ->message_loop()->message_loop_proxy() : 2406 ->message_loop()->message_loop_proxy() :
2416 base::MessageLoopProxy::current(); 2407 base::MessageLoopProxy::current();
2417 GpuChannelHost* gpu_channel_host = 2408 GpuChannelHost* gpu_channel_host =
2418 RenderThreadImpl::current()->EstablishGpuChannelSync( 2409 RenderThreadImpl::current()->EstablishGpuChannelSync(
2419 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 2410 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
2420 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( 2411 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder(
2421 base::Bind(&media::MessageLoopFactory::GetMessageLoop, 2412 base::Bind(&media::MessageLoopFactory::GetMessageLoop,
(...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after
5795 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5786 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5796 return !!RenderThreadImpl::current()->compositor_thread(); 5787 return !!RenderThreadImpl::current()->compositor_thread();
5797 } 5788 }
5798 5789
5799 void RenderViewImpl::OnJavaBridgeInit() { 5790 void RenderViewImpl::OnJavaBridgeInit() {
5800 DCHECK(!java_bridge_dispatcher_); 5791 DCHECK(!java_bridge_dispatcher_);
5801 #if defined(ENABLE_JAVA_BRIDGE) 5792 #if defined(ENABLE_JAVA_BRIDGE)
5802 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5793 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5803 #endif 5794 #endif
5804 } 5795 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698