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<VrShellDelegate>& delegate_provider, |
| 16 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, |
| 17 gvr_context* gvr_api, |
| 18 bool initially_web_vr, |
| 19 bool reprojected_rendering) |
| 20 : base::Thread("VrShellGL"), |
| 21 weak_vr_shell_(weak_vr_shell), |
| 22 delegate_provider_(delegate_provider), |
| 23 main_thread_task_runner_(std::move(main_thread_task_runner)), |
| 24 gvr_api_(gvr_api), |
| 25 initially_web_vr_(initially_web_vr), |
| 26 reprojected_rendering_(reprojected_rendering) {} |
| 27 |
| 28 VrGLThread::~VrGLThread() { |
| 29 Stop(); |
| 30 } |
| 31 |
| 32 void VrGLThread::Init() { |
| 33 vr_shell_gl_.reset(new VrShellGl(std::move(weak_vr_shell_), |
| 34 std::move(delegate_provider_), |
| 35 std::move(main_thread_task_runner_), |
| 36 gvr_api_, |
| 37 initially_web_vr_, |
| 38 reprojected_rendering_)); |
| 39 weak_vr_shell_gl_ = vr_shell_gl_->GetWeakPtr(); |
| 40 vr_shell_gl_->Initialize(); |
| 41 } |
| 42 |
| 43 void VrGLThread::CleanUp() { |
| 44 vr_shell_gl_.reset(); |
| 45 } |
| 46 |
| 47 } // namespace vr_shell |
OLD | NEW |