OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/android/vr_shell/vr_shell.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell.h" |
6 | 6 |
7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 VrShell::VrShell(JNIEnv* env, | 82 VrShell::VrShell(JNIEnv* env, |
83 jobject obj, | 83 jobject obj, |
84 ui::WindowAndroid* window, | 84 ui::WindowAndroid* window, |
85 bool for_web_vr, | 85 bool for_web_vr, |
86 VrShellDelegate* delegate, | 86 VrShellDelegate* delegate, |
87 gvr_context* gvr_api, | 87 gvr_context* gvr_api, |
88 bool reprojected_rendering) | 88 bool reprojected_rendering) |
89 : vr_shell_enabled_(base::FeatureList::IsEnabled(features::kVrShell)), | 89 : vr_shell_enabled_(base::FeatureList::IsEnabled(features::kVrShell)), |
90 window_(window), | 90 window_(window), |
91 compositor_(base::MakeUnique<VrCompositor>(window_, false)), | 91 compositor_(base::MakeUnique<VrCompositor>(window_)), |
92 delegate_provider_(delegate), | 92 delegate_provider_(delegate), |
93 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), | 93 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
94 reprojected_rendering_(reprojected_rendering), | 94 reprojected_rendering_(reprojected_rendering), |
95 gvr_api_(gvr_api), | 95 gvr_api_(gvr_api), |
96 weak_ptr_factory_(this) { | 96 weak_ptr_factory_(this) { |
97 DVLOG(1) << __FUNCTION__ << "=" << this; | 97 DVLOG(1) << __FUNCTION__ << "=" << this; |
98 DCHECK(g_instance == nullptr); | 98 DCHECK(g_instance == nullptr); |
99 g_instance = this; | 99 g_instance = this; |
100 j_vr_shell_.Reset(env, obj); | 100 j_vr_shell_.Reset(env, obj); |
101 | 101 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 jboolean for_web_vr, | 565 jboolean for_web_vr, |
566 jlong gvr_api, | 566 jlong gvr_api, |
567 jboolean reprojected_rendering) { | 567 jboolean reprojected_rendering) { |
568 return reinterpret_cast<intptr_t>(new VrShell( | 568 return reinterpret_cast<intptr_t>(new VrShell( |
569 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 569 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
570 for_web_vr, VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 570 for_web_vr, VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
571 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 571 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
572 } | 572 } |
573 | 573 |
574 } // namespace vr_shell | 574 } // namespace vr_shell |
OLD | NEW |