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

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

Issue 2742083002: Revert of Re-land WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: 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..c25da54458e04fc8f1922be5bb5c9247182402dd 100644
--- a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
+++ b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
@@ -20,11 +20,7 @@
: task_runner_(base::ThreadTaskRunnerHandle::Get()),
binding_(this),
weak_ptr_factory_(this) {
- // Context may be null, see VrShellDelegate#createNonPresentingNativeContext
- // for possible reasons a context could fail to be created. For example,
- // the user might uninstall apps or clear data after VR support was detected.
- if (context)
- gvr_api_ = gvr::GvrApi::WrapNonOwned(context);
+ gvr_api_ = gvr::GvrApi::WrapNonOwned(context);
}
NonPresentingGvrDelegate::~NonPresentingGvrDelegate() {
@@ -44,8 +40,7 @@
void NonPresentingGvrDelegate::Pause() {
vsync_task_.Cancel();
vsync_paused_ = true;
- if (gvr_api_)
- gvr_api_->PauseTracking();
+ gvr_api_->PauseTracking();
}
void NonPresentingGvrDelegate::Resume() {
@@ -65,14 +60,12 @@
void NonPresentingGvrDelegate::StopVSyncLoop() {
vsync_task_.Cancel();
- binding_.Close();
if (!callback_.is_null()) {
base::ResetAndReturn(&callback_)
.Run(nullptr, base::TimeDelta(), -1,
- device::mojom::VRVSyncProvider::Status::CLOSING);
+ device::mojom::VRVSyncProvider::Status::RETRY);
}
- if (gvr_api_)
- gvr_api_->PauseTracking();
+ gvr_api_->PauseTracking();
// If the loop is stopped, it's not considered to be paused.
vsync_paused_ = false;
}
@@ -80,10 +73,8 @@
void NonPresentingGvrDelegate::StartVSyncLoop() {
vsync_task_.Reset(
base::Bind(&NonPresentingGvrDelegate::OnVSync, base::Unretained(this)));
- if (gvr_api_) {
- gvr_api_->RefreshViewerProfile();
- gvr_api_->ResumeTracking();
- }
+ gvr_api_->RefreshViewerProfile();
+ gvr_api_->ResumeTracking();
OnVSync();
}
@@ -145,12 +136,6 @@
gvr::ClockTimePoint target_time = gvr::GvrApi::GetTimePointNow();
target_time.monotonic_system_time_nanos += kPredictionTimeWithoutVsyncNanos;
- if (!gvr_api_) {
- callback.Run(device::mojom::VRPosePtr(nullptr), time, -1,
- device::mojom::VRVSyncProvider::Status::SUCCESS);
- return;
- }
-
gvr::Mat4f head_mat = gvr_api_->ApplyNeckModel(
gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time), 1.0f);
callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1,
@@ -171,16 +156,8 @@
void NonPresentingGvrDelegate::CreateVRDisplayInfo(
const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback,
uint32_t device_id) {
- if (!gvr_api_) {
- callback.Run(device::mojom::VRDisplayInfoPtr(nullptr));
- return;
- }
-
- gvr::Sizei webvr_size = VrShell::GetRecommendedWebVrSize(gvr_api_.get());
- DVLOG(1) << __FUNCTION__ << ": resize recommended to " << webvr_size.width
- << "x" << webvr_size.height;
- callback.Run(
- VrShell::CreateVRDisplayInfo(gvr_api_.get(), webvr_size, device_id));
+ callback.Run(VrShell::CreateVRDisplayInfo(
+ gvr_api_.get(), device::kInvalidRenderTargetSize, device_id));
}
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698