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

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

Issue 10832264: Fix lifecycle-vs-threads of GpuVDAContext3D. (Closed) Base URL: svn://svn.chromium.org/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 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
2413 } 2413 }
2414 2414
2415 // Accelerated video decode is not enabled by default on Linux. 2415 // Accelerated video decode is not enabled by default on Linux.
2416 // crbug.com/137247 2416 // crbug.com/137247
2417 bool use_accelerated_video_decode = false; 2417 bool use_accelerated_video_decode = false;
2418 #if defined(OS_CHROMEOS) || defined(OS_WIN) 2418 #if defined(OS_CHROMEOS) || defined(OS_WIN)
2419 use_accelerated_video_decode = true; 2419 use_accelerated_video_decode = true;
2420 #endif 2420 #endif
2421 use_accelerated_video_decode &= !CommandLine::ForCurrentProcess()->HasSwitch( 2421 use_accelerated_video_decode &= !CommandLine::ForCurrentProcess()->HasSwitch(
2422 switches::kDisableAcceleratedVideoDecode); 2422 switches::kDisableAcceleratedVideoDecode);
2423 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context3d = 2423 WebGraphicsContext3DCommandBufferImpl* context3d =
2424 use_accelerated_video_decode ? 2424 use_accelerated_video_decode ?
2425 RenderThreadImpl::current()->GetGpuVDAContext3D() : 2425 RenderThreadImpl::current()->GetGpuVDAContext3D() :
2426 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl>(); 2426 NULL;
2427 if (context3d) { 2427 if (context3d) {
2428 MessageLoop* factories_loop = 2428 MessageLoop* factories_loop =
2429 RenderThreadImpl::current()->compositor_thread() ? 2429 RenderThreadImpl::current()->compositor_thread() ?
2430 RenderThreadImpl::current()->compositor_thread()->GetWebThread() 2430 RenderThreadImpl::current()->compositor_thread()->GetWebThread()
2431 ->message_loop() : 2431 ->message_loop() :
2432 MessageLoop::current(); 2432 MessageLoop::current();
2433 GpuChannelHost* gpu_channel_host = 2433 GpuChannelHost* gpu_channel_host =
2434 RenderThreadImpl::current()->EstablishGpuChannelSync( 2434 RenderThreadImpl::current()->EstablishGpuChannelSync(
2435 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 2435 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
2436 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( 2436 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder(
(...skipping 3327 matching lines...) Expand 10 before | Expand all | Expand 10 after
5764 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5764 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5765 return !!RenderThreadImpl::current()->compositor_thread(); 5765 return !!RenderThreadImpl::current()->compositor_thread();
5766 } 5766 }
5767 5767
5768 void RenderViewImpl::OnJavaBridgeInit() { 5768 void RenderViewImpl::OnJavaBridgeInit() {
5769 DCHECK(!java_bridge_dispatcher_); 5769 DCHECK(!java_bridge_dispatcher_);
5770 #if defined(ENABLE_JAVA_BRIDGE) 5770 #if defined(ENABLE_JAVA_BRIDGE)
5771 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5771 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5772 #endif 5772 #endif
5773 } 5773 }
OLDNEW
« content/renderer/render_thread_impl.cc ('K') | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698