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

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

Issue 2624633002: Remove Sync GetPose VRService call, implement VRVSyncProvider (Closed)
Patch Set: Created 3 years, 11 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
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 ee4aa9843e6188d468b450677340af9e5b586d8b..a7afec9e705afde119bf90861f7964d572d58c36 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -268,15 +268,6 @@ void VrShell::SetWebVrMode(JNIEnv* env,
}
}
-void VrShell::SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) {
- GLThread* thread = static_cast<GLThread*>(gl_thread_.get());
- if (thread->IsRunning()) {
- thread->task_runner()->PostTask(
- FROM_HERE, base::Bind(&VrShellGl::SetGvrPoseForWebVr,
- thread->GetVrShellGl(), pose, pose_num));
- }
-}
-
void VrShell::SetWebVRRenderSurfaceSize(int width, int height) {
// TODO(klausw,crbug.com/655722): Change the GVR render size and set the WebVR
// render surface size.
@@ -451,6 +442,30 @@ void VrShell::ForceExitVr() {
delegate_->ForceExitVr();
}
+void VrShell::OnVRVsyncProviderReady() {
+ delegate_->device_provider()->OnVRVsyncProviderReady(
+ base::Bind(&VrShell::OnVRVSyncProviderClientConnected,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
+void VrShell::OnVRVSyncProviderClientConnected(
+ device::mojom::VRVSyncProviderClientPtr client) {
+ GLThread* thread = static_cast<GLThread*>(gl_thread_.get());
+ PostToGlThreadWhenReady(
+ base::Bind(&VrShellGl::OnVRVSyncProviderClientConnected,
+ thread->GetVrShellGl(),
+ base::Passed(std::move(client))));
+}
+
+void VrShell::UpdateVSyncInterval(JNIEnv* env, const JavaParamRef<jobject>& obj,
+ jlong timebase_nanos,
+ jdouble interval_seconds) {
+ GLThread* thread = static_cast<GLThread*>(gl_thread_.get());
+ PostToGlThreadWhenReady(
+ base::Bind(&VrShellGl::UpdateVSyncInterval,
+ thread->GetVrShellGl(), timebase_nanos, interval_seconds));
+}
+
void VrShell::SetContentCssSize(float width, float height, float dpr) {
JNIEnv* env = base::android::AttachCurrentThread();
Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height,

Powered by Google App Engine
This is Rietveld 408576698