OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/browser/vr/test/fake_vr_device.h" | |
6 | |
7 namespace content { | |
8 | |
9 FakeVRDevice::FakeVRDevice(VRDeviceProvider* provider) | |
10 : VRDevice(provider) { | |
11 } | |
12 | |
13 FakeVRDevice::~FakeVRDevice() { | |
14 | |
15 } | |
16 | |
17 void FakeVRDevice::SetVRDevice(const blink::WebVRDevice& device) { | |
18 device_ = device; | |
19 } | |
20 | |
21 void FakeVRDevice::SetSensorState(const blink::WebHMDSensorState& state) { | |
22 state_ = state; | |
23 } | |
24 | |
25 void FakeVRDevice::SetRenderTargetSize( | |
26 unsigned int width, | |
27 unsigned int height) { | |
28 width_ = width; | |
29 height_ = height; | |
30 } | |
31 | |
32 void FakeVRDevice::GetVRDevice(blink::WebVRDevice* device) { | |
33 *device = device_; | |
34 } | |
35 | |
36 void FakeVRDevice::GetSensorState(blink::WebHMDSensorState* state) { | |
37 *state = state_; | |
38 } | |
39 void FakeVRDevice::GetRenderTargetRects( | |
Ted C
2015/04/24 01:06:06
blank line above.
| |
40 blink::WebVRFieldOfView leftFov, | |
41 blink::WebVRFieldOfView rightFov, | |
42 blink::WebVRVector4* leftRect, | |
43 blink::WebVRVector4* rightRect) { | |
44 leftRect->x = 0; | |
45 leftRect->y = 0; | |
46 leftRect->z = width_ / 2.0; | |
47 leftRect->w = height_; | |
48 | |
49 rightRect->x = width_ / 2.0; | |
50 rightRect->y = 0; | |
51 rightRect->z = width_ / 2.0; | |
52 rightRect->w = height_; | |
53 } | |
54 | |
55 } // namespace content | |
OLD | NEW |