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

Side by Side Diff: chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc

Issue 2608163003: Change single-interface mojo bindings to use SequencedTaskRunner. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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/non_presenting_gvr_delegate.h" 5 #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/threading/thread_task_runner_handle.h"
8 #include "chrome/browser/android/vr_shell/vr_shell.h" 9 #include "chrome/browser/android/vr_shell/vr_shell.h"
9 10
10 namespace vr_shell { 11 namespace vr_shell {
11 12
12 namespace { 13 namespace {
13 static constexpr long kPredictionTimeWithoutVsyncNanos = 50000000; 14 static constexpr long kPredictionTimeWithoutVsyncNanos = 50000000;
14 } // namespace 15 } // namespace
15 16
16 NonPresentingGvrDelegate::NonPresentingGvrDelegate(long context) 17 NonPresentingGvrDelegate::NonPresentingGvrDelegate(long context)
17 : task_runner_(base::ThreadTaskRunnerHandle::Get()), 18 : task_runner_(base::ThreadTaskRunnerHandle::Get()),
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 const GetVSyncCallback& callback) { 137 const GetVSyncCallback& callback) {
137 gvr::ClockTimePoint target_time = gvr::GvrApi::GetTimePointNow(); 138 gvr::ClockTimePoint target_time = gvr::GvrApi::GetTimePointNow();
138 target_time.monotonic_system_time_nanos += kPredictionTimeWithoutVsyncNanos; 139 target_time.monotonic_system_time_nanos += kPredictionTimeWithoutVsyncNanos;
139 140
140 gvr::Mat4f head_mat = gvr_api_->ApplyNeckModel( 141 gvr::Mat4f head_mat = gvr_api_->ApplyNeckModel(
141 gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time), 1.0f); 142 gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time), 1.0f);
142 callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1); 143 callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1);
143 } 144 }
144 145
145 } // namespace vr_shell 146 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h ('k') | chrome/test/base/mojo_test_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698