OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/vr_shell/vr_gl_thread.h" |
| 6 |
| 7 #include "chrome/browser/android/vr_shell/vr_input_manager.h" |
| 8 #include "chrome/browser/android/vr_shell/vr_shell.h" |
| 9 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" |
| 10 |
| 11 namespace vr_shell { |
| 12 |
| 13 VrGLThread::VrGLThread( |
| 14 const base::WeakPtr<VrShell>& weak_vr_shell, |
| 15 const base::WeakPtr<VrInputManager>& content_input_manager, |
| 16 const base::WeakPtr<VrInputManager>& ui_input_manager, |
| 17 const base::WeakPtr<VrShellDelegate>& delegate_provider, |
| 18 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, |
| 19 gvr_context* gvr_api, |
| 20 bool initially_web_vr, |
| 21 bool reprojected_rendering) |
| 22 : base::Thread("VrShellGL"), |
| 23 weak_vr_shell_(weak_vr_shell), |
| 24 content_input_manager_(content_input_manager), |
| 25 ui_input_manager_(ui_input_manager), |
| 26 delegate_provider_(delegate_provider), |
| 27 main_thread_task_runner_(std::move(main_thread_task_runner)), |
| 28 gvr_api_(gvr_api), |
| 29 initially_web_vr_(initially_web_vr), |
| 30 reprojected_rendering_(reprojected_rendering) {} |
| 31 |
| 32 VrGLThread::~VrGLThread() { |
| 33 Stop(); |
| 34 } |
| 35 |
| 36 void VrGLThread::Init() { |
| 37 vr_shell_gl_.reset(new VrShellGl(std::move(weak_vr_shell_), |
| 38 std::move(content_input_manager_), |
| 39 std::move(ui_input_manager_), |
| 40 std::move(delegate_provider_), |
| 41 std::move(main_thread_task_runner_), |
| 42 gvr_api_, |
| 43 initially_web_vr_, |
| 44 reprojected_rendering_)); |
| 45 weak_vr_shell_gl_ = vr_shell_gl_->GetWeakPtr(); |
| 46 vr_shell_gl_->Initialize(); |
| 47 } |
| 48 |
| 49 void VrGLThread::CleanUp() { |
| 50 vr_shell_gl_.reset(); |
| 51 } |
| 52 |
| 53 } // namespace vr_shell |
OLD | NEW |