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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2891243002: VR: Loading DD controller model after GL is initialized (Closed)
Patch Set: doing texture patching on background task Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_shell_gl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index db0123e8b4b3e6b3fad28fa193a8c02f8ad3145d..b28e5d0c085a0cdf0d9e1ad8476b68705720e463 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -85,17 +85,6 @@ void SetIsInVR(content::WebContents* contents, bool is_in_vr) {
}
}
-void LoadControllerModelTask(
- base::WeakPtr<VrShell> weak_vr_shell,
- scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
- auto controller_model = VrControllerModel::LoadFromComponent();
- if (controller_model) {
- main_thread_task_runner->PostTask(
- FROM_HERE, base::Bind(&VrShell::SubmitControllerModel, weak_vr_shell,
- base::Passed(&controller_model)));
- }
-}
-
} // namespace
VrShell::VrShell(JNIEnv* env,
@@ -121,18 +110,12 @@ VrShell::VrShell(JNIEnv* env,
gl_thread_ = base::MakeUnique<VrGLThread>(
weak_ptr_factory_.GetWeakPtr(), main_thread_task_runner_, gvr_api,
- for_web_vr, in_cct, reprojected_rendering_);
+ for_web_vr, in_cct, reprojected_rendering_, HasDaydreamSupport(env));
ui_ = gl_thread_.get();
base::Thread::Options options(base::MessageLoop::TYPE_DEFAULT, 0);
options.priority = base::ThreadPriority::DISPLAY;
gl_thread_->StartWithOptions(options);
-
-
- content::BrowserThread::PostTask(
- content::BrowserThread::FILE, FROM_HERE,
- base::Bind(LoadControllerModelTask, weak_ptr_factory_.GetWeakPtr(),
- main_thread_task_runner_));
}
void VrShell::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) {
@@ -374,13 +357,6 @@ void VrShell::SubmitWebVRFrame(int16_t frame_index,
gl_thread_->GetVrShellGl(), frame_index, mailbox));
}
-void VrShell::SubmitControllerModel(std::unique_ptr<VrControllerModel> model) {
- WaitForGlThread();
- PostToGlThread(FROM_HERE,
- base::Bind(&VrShellGl::SetControllerModel,
- gl_thread_->GetVrShellGl(), base::Passed(&model)));
-}
-
void VrShell::UpdateWebVRTextureBounds(int16_t frame_index,
const gfx::RectF& left_bounds,
const gfx::RectF& right_bounds,
@@ -637,6 +613,10 @@ void VrShell::RegisterGamepadDataFetcher(
gamepad_data_fetcher_ = fetcher;
}
+bool VrShell::HasDaydreamSupport(JNIEnv* env) {
+ return Java_VrShellImpl_hasDaydreamSupport(env, j_vr_shell_.obj());
+}
+
// ----------------------------------------------------------------------------
// Native JNI methods
// ----------------------------------------------------------------------------
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_shell_gl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698