| 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 86942922c54574e22cf950dbc1176e68c3c68086..02d8c439daf0f46f356fd8285537cfd31bd87b97 100644
|
| --- a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
|
| +++ b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h"
|
|
|
| #include "chrome/browser/android/vr_shell/vr_shell.h"
|
| +#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h"
|
|
|
| namespace vr_shell {
|
|
|
| @@ -12,25 +13,17 @@ namespace {
|
| static constexpr long kPredictionTimeWithoutVsyncNanos = 50000000;
|
| } // namespace
|
|
|
| -NonPresentingGvrDelegate::NonPresentingGvrDelegate(long context)
|
| +NonPresentingGvrDelegate::NonPresentingGvrDelegate(gvr_context* context)
|
| : task_runner_(base::ThreadTaskRunnerHandle::Get()),
|
| binding_(this),
|
| weak_ptr_factory_(this) {
|
| - gvr_api_ = gvr::GvrApi::WrapNonOwned(reinterpret_cast<gvr_context*>(context));
|
| + gvr_api_ = gvr::GvrApi::WrapNonOwned(context);
|
| }
|
|
|
| NonPresentingGvrDelegate::~NonPresentingGvrDelegate() {
|
| StopVSyncLoop();
|
| }
|
|
|
| -gvr::Sizei NonPresentingGvrDelegate::GetWebVRCompositorSurfaceSize() {
|
| - return device::kInvalidRenderTargetSize;
|
| -}
|
| -
|
| -gvr::GvrApi* NonPresentingGvrDelegate::gvr_api() {
|
| - return gvr_api_.get();
|
| -}
|
| -
|
| void NonPresentingGvrDelegate::OnVRVsyncProviderRequest(
|
| device::mojom::VRVSyncProviderRequest request) {
|
| binding_.Close();
|
| @@ -144,4 +137,22 @@ void NonPresentingGvrDelegate::SendVSync(base::TimeDelta time,
|
| callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1);
|
| }
|
|
|
| +bool NonPresentingGvrDelegate::SupportsPresentation() {
|
| + return false;
|
| +}
|
| +
|
| +void NonPresentingGvrDelegate::ResetPose() {
|
| + // Should never call RecenterTracking when using with Daydream viewers. On
|
| + // those devices recentering should only be done via the controller.
|
| + if (gvr_api_ && gvr_api_->GetViewerType() == GVR_VIEWER_TYPE_CARDBOARD)
|
| + gvr_api_->RecenterTracking();
|
| +}
|
| +
|
| +void NonPresentingGvrDelegate::CreateVRDisplayInfo(
|
| + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback,
|
| + uint32_t device_id) {
|
| + callback.Run(VrShell::CreateVRDisplayInfo(
|
| + gvr_api_.get(), device::kInvalidRenderTargetSize, device_id));
|
| +}
|
| +
|
| } // namespace vr_shell
|
|
|