| 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 #include "chrome/browser/android/vr_shell/vr_shell.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell.h" |
| 6 | 6 |
| 7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 if (content_input_manager_) { | 586 if (content_input_manager_) { |
| 587 content_input_manager_->ProcessUpdatedGesture(std::move(event)); | 587 content_input_manager_->ProcessUpdatedGesture(std::move(event)); |
| 588 } else if (android_ui_gesture_target_) { | 588 } else if (android_ui_gesture_target_) { |
| 589 android_ui_gesture_target_->DispatchWebInputEvent(std::move(event)); | 589 android_ui_gesture_target_->DispatchWebInputEvent(std::move(event)); |
| 590 } | 590 } |
| 591 } | 591 } |
| 592 | 592 |
| 593 device::mojom::VRPosePtr VrShell::VRPosePtrFromGvrPose(gvr::Mat4f head_mat) { | 593 device::mojom::VRPosePtr VrShell::VRPosePtrFromGvrPose(gvr::Mat4f head_mat) { |
| 594 device::mojom::VRPosePtr pose = device::mojom::VRPose::New(); | 594 device::mojom::VRPosePtr pose = device::mojom::VRPose::New(); |
| 595 | 595 |
| 596 pose->timestamp = base::Time::Now().ToJsTime(); | |
| 597 pose->orientation.emplace(4); | 596 pose->orientation.emplace(4); |
| 598 | 597 |
| 599 gfx::Transform inv_transform( | 598 gfx::Transform inv_transform( |
| 600 head_mat.m[0][0], head_mat.m[0][1], head_mat.m[0][2], head_mat.m[0][3], | 599 head_mat.m[0][0], head_mat.m[0][1], head_mat.m[0][2], head_mat.m[0][3], |
| 601 head_mat.m[1][0], head_mat.m[1][1], head_mat.m[1][2], head_mat.m[1][3], | 600 head_mat.m[1][0], head_mat.m[1][1], head_mat.m[1][2], head_mat.m[1][3], |
| 602 head_mat.m[2][0], head_mat.m[2][1], head_mat.m[2][2], head_mat.m[2][3], | 601 head_mat.m[2][0], head_mat.m[2][1], head_mat.m[2][2], head_mat.m[2][3], |
| 603 head_mat.m[3][0], head_mat.m[3][1], head_mat.m[3][2], head_mat.m[3][3]); | 602 head_mat.m[3][0], head_mat.m[3][1], head_mat.m[3][2], head_mat.m[3][3]); |
| 604 | 603 |
| 605 gfx::Transform transform; | 604 gfx::Transform transform; |
| 606 if (inv_transform.GetInverse(&transform)) { | 605 if (inv_transform.GetInverse(&transform)) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 jboolean reprojected_rendering) { | 686 jboolean reprojected_rendering) { |
| 688 return reinterpret_cast<intptr_t>(new VrShell( | 687 return reinterpret_cast<intptr_t>(new VrShell( |
| 689 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), | 688 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), |
| 690 content::WebContents::FromJavaWebContents(ui_web_contents), | 689 content::WebContents::FromJavaWebContents(ui_web_contents), |
| 691 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, | 690 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, |
| 692 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 691 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 693 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 692 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 694 } | 693 } |
| 695 | 694 |
| 696 } // namespace vr_shell | 695 } // namespace vr_shell |
| OLD | NEW |