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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 void VRServiceImpl::ResetPose(uint32_t index) { | 61 void VRServiceImpl::ResetPose(uint32_t index) { |
62 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); | 62 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
63 VRDevice* device = device_manager->GetDevice(index); | 63 VRDevice* device = device_manager->GetDevice(index); |
64 if (device) | 64 if (device) |
65 device->ResetPose(); | 65 device->ResetPose(); |
66 } | 66 } |
67 | 67 |
| 68 void VRServiceImpl::RequestPresent(uint32_t index) { |
| 69 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
| 70 VRDevice* device = device_manager->GetDevice(index); |
| 71 if (device) |
| 72 device->RequestPresent(); |
| 73 } |
| 74 |
| 75 void VRServiceImpl::ExitPresent(uint32_t index) { |
| 76 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
| 77 VRDevice* device = device_manager->GetDevice(index); |
| 78 if (device) |
| 79 device->ExitPresent(); |
| 80 } |
| 81 |
| 82 void VRServiceImpl::SubmitFrame(uint32_t index) { |
| 83 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
| 84 VRDevice* device = device_manager->GetDevice(index); |
| 85 if (device) |
| 86 device->SubmitFrame(); |
| 87 } |
| 88 |
| 89 void VRServiceImpl::UpdateLayerBounds(uint32_t index, |
| 90 VRLayerBoundsPtr leftBounds, |
| 91 VRLayerBoundsPtr rightBounds) { |
| 92 VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
| 93 VRDevice* device = device_manager->GetDevice(index); |
| 94 if (device) |
| 95 device->UpdateLayerBounds(std::move(leftBounds), std::move(rightBounds)); |
| 96 } |
| 97 |
68 } // namespace device | 98 } // namespace device |
OLD | NEW |