| 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/android/gvr/gvr_device.h" | 5 #include "device/vr/android/gvr/gvr_device.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 pose->position[2] = decomposed_transform.translate[2]; | 134 pose->position[2] = decomposed_transform.translate[2]; |
| 135 } | 135 } |
| 136 | 136 |
| 137 return pose; | 137 return pose; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void GvrDevice::ResetPose() { | 140 void GvrDevice::ResetPose() { |
| 141 delegate_->gvr_api()->ResetTracking(); | 141 delegate_->gvr_api()->ResetTracking(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void GvrDevice::RequestPresent() { | 144 bool GvrDevice::RequestPresent() { |
| 145 delegate_->RequestWebVRPresent(); | 145 delegate_->RequestWebVRPresent(); |
| 146 return true; |
| 146 } | 147 } |
| 147 | 148 |
| 148 void GvrDevice::ExitPresent() { | 149 void GvrDevice::ExitPresent() { |
| 149 delegate_->ExitWebVRPresent(); | 150 delegate_->ExitWebVRPresent(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 void GvrDevice::SubmitFrame() { | 153 void GvrDevice::SubmitFrame(VRPosePtr pose) { |
| 153 delegate_->SubmitWebVRFrame(); | 154 delegate_->SubmitWebVRFrame(); |
| 154 } | 155 } |
| 155 | 156 |
| 156 void GvrDevice::UpdateLayerBounds(VRLayerBoundsPtr leftBounds, | 157 void GvrDevice::UpdateLayerBounds(VRLayerBoundsPtr leftBounds, |
| 157 VRLayerBoundsPtr rightBounds) { | 158 VRLayerBoundsPtr rightBounds) { |
| 158 delegate_->UpdateWebVRTextureBounds(0, // Left eye | 159 delegate_->UpdateWebVRTextureBounds(0, // Left eye |
| 159 leftBounds->left, leftBounds->top, | 160 leftBounds->left, leftBounds->top, |
| 160 leftBounds->width, leftBounds->height); | 161 leftBounds->width, leftBounds->height); |
| 161 delegate_->UpdateWebVRTextureBounds(1, // Right eye | 162 delegate_->UpdateWebVRTextureBounds(1, // Right eye |
| 162 rightBounds->left, rightBounds->top, | 163 rightBounds->left, rightBounds->top, |
| 163 rightBounds->width, rightBounds->height); | 164 rightBounds->width, rightBounds->height); |
| 164 } | 165 } |
| 165 | 166 |
| 166 } // namespace device | 167 } // namespace device |
| OLD | NEW |