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 "device/vr/vr_service_impl.h" | 5 #include "device/vr/vr_service_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "device/vr/vr_device.h" | 10 #include "device/vr/vr_device.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 void VRServiceImpl::ResetPose(uint32_t index) { | 60 void VRServiceImpl::ResetPose(uint32_t index) { |
61 VRDevice* device = VRDeviceManager::GetAllowedDevice(this, index); | 61 VRDevice* device = VRDeviceManager::GetAllowedDevice(this, index); |
62 if (device) | 62 if (device) |
63 device->ResetPose(); | 63 device->ResetPose(); |
64 } | 64 } |
65 | 65 |
66 void VRServiceImpl::RequestPresent(uint32_t index, | 66 void VRServiceImpl::RequestPresent(uint32_t index, |
| 67 bool secureOrigin, |
67 const RequestPresentCallback& callback) { | 68 const RequestPresentCallback& callback) { |
68 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); | 69 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
69 callback.Run(device_manager->RequestPresent(this, index)); | 70 callback.Run(device_manager->RequestPresent(this, index, secureOrigin)); |
70 } | 71 } |
71 | 72 |
72 void VRServiceImpl::ExitPresent(uint32_t index) { | 73 void VRServiceImpl::ExitPresent(uint32_t index) { |
73 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); | 74 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
74 device_manager->ExitPresent(this, index); | 75 device_manager->ExitPresent(this, index); |
75 } | 76 } |
76 | 77 |
77 void VRServiceImpl::SubmitFrame(uint32_t index, VRPosePtr pose) { | 78 void VRServiceImpl::SubmitFrame(uint32_t index, VRPosePtr pose) { |
78 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); | 79 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
79 device_manager->SubmitFrame(this, index, std::move(pose)); | 80 device_manager->SubmitFrame(this, index, std::move(pose)); |
80 } | 81 } |
81 | 82 |
82 void VRServiceImpl::UpdateLayerBounds(uint32_t index, | 83 void VRServiceImpl::UpdateLayerBounds(uint32_t index, |
83 VRLayerBoundsPtr leftBounds, | 84 VRLayerBoundsPtr leftBounds, |
84 VRLayerBoundsPtr rightBounds) { | 85 VRLayerBoundsPtr rightBounds) { |
85 VRDevice* device = VRDeviceManager::GetAllowedDevice(this, index); | 86 VRDevice* device = VRDeviceManager::GetAllowedDevice(this, index); |
86 if (device) | 87 if (device) |
87 device->UpdateLayerBounds(std::move(leftBounds), std::move(rightBounds)); | 88 device->UpdateLayerBounds(std::move(leftBounds), std::move(rightBounds)); |
88 } | 89 } |
89 | 90 |
90 } // namespace device | 91 } // namespace device |
OLD | NEW |