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

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

Issue 2770353002: WebVR: add angular velocity estimate to pose (Closed)
Patch Set: Review feedback, move constants to vr_shell.h Created 3 years, 9 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/non_presenting_gvr_delegate.cc
diff --git a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
index c2457ba4176e627bc8351dec29fdc59ff6924d6c..ce299f6646595a78277cf1c0398a0ef31dc60037 100644
--- a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
+++ b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
@@ -12,10 +12,6 @@
namespace vr_shell {
-namespace {
-static constexpr int64_t kPredictionTimeWithoutVsyncNanos = 50000000;
-} // namespace
-
NonPresentingGvrDelegate::NonPresentingGvrDelegate(gvr_context* context)
: task_runner_(base::ThreadTaskRunnerHandle::Get()),
binding_(this),
@@ -143,7 +139,8 @@ void NonPresentingGvrDelegate::UpdateVSyncInterval(int64_t timebase_nanos,
void NonPresentingGvrDelegate::SendVSync(base::TimeDelta time,
const GetVSyncCallback& callback) {
gvr::ClockTimePoint target_time = gvr::GvrApi::GetTimePointNow();
- target_time.monotonic_system_time_nanos += kPredictionTimeWithoutVsyncNanos;
+ target_time.monotonic_system_time_nanos +=
+ VrShell::kPredictionTimeWithoutVsyncNanos;
if (!gvr_api_) {
callback.Run(device::mojom::VRPosePtr(nullptr), time, -1,
@@ -153,8 +150,15 @@ void NonPresentingGvrDelegate::SendVSync(base::TimeDelta time,
gvr::Mat4f head_mat = gvr_api_->ApplyNeckModel(
gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time), 1.0f);
- callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1,
- device::mojom::VRVSyncProvider::Status::SUCCESS);
+
+ target_time.monotonic_system_time_nanos +=
+ VrShell::kAngularVelocityEpsilonNanos;
+ gvr::Mat4f head_mat_2 =
+ gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time);
+
+ callback.Run(VrShell::VRPosePtrFromGvrPose(
+ head_mat, head_mat_2, VrShell::kAngularVelocityEpsilonNanos),
+ time, -1, device::mojom::VRVSyncProvider::Status::SUCCESS);
}
bool NonPresentingGvrDelegate::SupportsPresentation() {
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_controller.cc » ('j') | chrome/browser/android/vr_shell/vr_shell_gl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698