| OLD | NEW |
| 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 #ifndef DEVICE_VR_ANDROID_GVR_DELEGATE_H | 5 #ifndef DEVICE_VR_ANDROID_GVR_DELEGATE_H |
| 6 #define DEVICE_VR_ANDROID_GVR_DELEGATE_H | 6 #define DEVICE_VR_ANDROID_GVR_DELEGATE_H |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "device/vr/vr_export.h" | 10 #include "device/vr/vr_export.h" |
| 11 #include "device/vr/vr_service.mojom.h" | 11 #include "device/vr/vr_service.mojom.h" |
| 12 #include "device/vr/vr_types.h" | 12 #include "device/vr/vr_types.h" |
| 13 #include "gpu/command_buffer/common/mailbox_holder.h" | 13 #include "gpu/command_buffer/common/mailbox_holder.h" |
| 14 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/
gvr_types.h" | 14 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/
gvr_types.h" |
| 15 | 15 |
| 16 namespace gvr { | 16 namespace gvr { |
| 17 class GvrApi; | 17 class GvrApi; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace device { | 20 namespace device { |
| 21 | 21 |
| 22 class DEVICE_VR_EXPORT GvrDelegate { | 22 class DEVICE_VR_EXPORT GvrDelegate { |
| 23 public: | 23 public: |
| 24 static mojom::VRPosePtr VRPosePtrFromGvrPose(const vr::Mat4f& head_mat); | 24 static mojom::VRPosePtr VRPosePtrFromGvrPose(const vr::Mat4f& head_mat); |
| 25 static void GetGvrPoseWithNeckModel(gvr::GvrApi* gvr_api, |
| 26 vr::Mat4f* out, |
| 27 int64_t prediction_time); |
| 25 static void GetGvrPoseWithNeckModel(gvr::GvrApi* gvr_api, vr::Mat4f* out); | 28 static void GetGvrPoseWithNeckModel(gvr::GvrApi* gvr_api, vr::Mat4f* out); |
| 26 static mojom::VRPosePtr GetVRPosePtrWithNeckModel(gvr::GvrApi* gvr_api, | 29 static mojom::VRPosePtr GetVRPosePtrWithNeckModel(gvr::GvrApi* gvr_api, |
| 30 vr::Mat4f* head_mat_out, |
| 31 int64_t prediction_time); |
| 32 static mojom::VRPosePtr GetVRPosePtrWithNeckModel(gvr::GvrApi* gvr_api, |
| 27 vr::Mat4f* head_mat_out); | 33 vr::Mat4f* head_mat_out); |
| 28 static gfx::Size GetRecommendedWebVrSize(gvr::GvrApi* gvr_api); | 34 static gfx::Size GetRecommendedWebVrSize(gvr::GvrApi* gvr_api); |
| 29 static mojom::VRDisplayInfoPtr CreateVRDisplayInfo(gvr::GvrApi* gvr_api, | 35 static mojom::VRDisplayInfoPtr CreateVRDisplayInfo(gvr::GvrApi* gvr_api, |
| 30 gfx::Size recommended_size, | 36 gfx::Size recommended_size, |
| 31 uint32_t device_id); | 37 uint32_t device_id); |
| 32 | 38 |
| 33 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; | 39 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; |
| 34 virtual void SubmitWebVRFrame(int16_t frame_index, | 40 virtual void SubmitWebVRFrame(int16_t frame_index, |
| 35 const gpu::MailboxHolder& mailbox) = 0; | 41 const gpu::MailboxHolder& mailbox) = 0; |
| 36 virtual void UpdateWebVRTextureBounds(int16_t frame_index, | 42 virtual void UpdateWebVRTextureBounds(int16_t frame_index, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 52 // GvrDelegate, which allows WebVR presentation. | 58 // GvrDelegate, which allows WebVR presentation. |
| 53 class DEVICE_VR_EXPORT PresentingGvrDelegate : public GvrDelegate { | 59 class DEVICE_VR_EXPORT PresentingGvrDelegate : public GvrDelegate { |
| 54 public: | 60 public: |
| 55 virtual void SetSubmitClient( | 61 virtual void SetSubmitClient( |
| 56 device::mojom::VRSubmitFrameClientPtr submit_client) = 0; | 62 device::mojom::VRSubmitFrameClientPtr submit_client) = 0; |
| 57 }; | 63 }; |
| 58 | 64 |
| 59 } // namespace device | 65 } // namespace device |
| 60 | 66 |
| 61 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H | 67 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H |
| OLD | NEW |