| Index: chrome/browser/android/vr_shell/vr_gl_thread.cc
|
| diff --git a/chrome/browser/android/vr_shell/vr_gl_thread.cc b/chrome/browser/android/vr_shell/vr_gl_thread.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d5ec593d5d13d01fc664201139588c688da6f105
|
| --- /dev/null
|
| +++ b/chrome/browser/android/vr_shell/vr_gl_thread.cc
|
| @@ -0,0 +1,53 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/android/vr_shell/vr_gl_thread.h"
|
| +
|
| +#include "chrome/browser/android/vr_shell/vr_input_manager.h"
|
| +#include "chrome/browser/android/vr_shell/vr_shell.h"
|
| +#include "chrome/browser/android/vr_shell/vr_shell_gl.h"
|
| +
|
| +namespace vr_shell {
|
| +
|
| +VrGLThread::VrGLThread(
|
| + const base::WeakPtr<VrShell>& weak_vr_shell,
|
| + const base::WeakPtr<VrInputManager>& content_input_manager,
|
| + const base::WeakPtr<VrInputManager>& ui_input_manager,
|
| + const base::WeakPtr<VrShellDelegate>& delegate_provider,
|
| + scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
|
| + gvr_context* gvr_api,
|
| + bool initially_web_vr,
|
| + bool reprojected_rendering)
|
| + : base::Thread("VrShellGL"),
|
| + weak_vr_shell_(weak_vr_shell),
|
| + content_input_manager_(content_input_manager),
|
| + ui_input_manager_(ui_input_manager),
|
| + delegate_provider_(delegate_provider),
|
| + main_thread_task_runner_(std::move(main_thread_task_runner)),
|
| + gvr_api_(gvr_api),
|
| + initially_web_vr_(initially_web_vr),
|
| + reprojected_rendering_(reprojected_rendering) {}
|
| +
|
| +VrGLThread::~VrGLThread() {
|
| + Stop();
|
| +}
|
| +
|
| +void VrGLThread::Init() {
|
| + vr_shell_gl_.reset(new VrShellGl(std::move(weak_vr_shell_),
|
| + std::move(content_input_manager_),
|
| + std::move(ui_input_manager_),
|
| + std::move(delegate_provider_),
|
| + std::move(main_thread_task_runner_),
|
| + gvr_api_,
|
| + initially_web_vr_,
|
| + reprojected_rendering_));
|
| + weak_vr_shell_gl_ = vr_shell_gl_->GetWeakPtr();
|
| + vr_shell_gl_->Initialize();
|
| +}
|
| +
|
| +void VrGLThread::CleanUp() {
|
| + vr_shell_gl_.reset();
|
| +}
|
| +
|
| +} // namespace vr_shell
|
|
|