Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 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) { | |
|
mdempsky
2015/05/11 19:25:01
Nit: Need explicit initialization for device_, sta
| |
| 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 | |
| 40 void FakeVRDevice::GetRenderTargetRects( | |
| 41 blink::WebVRFieldOfView leftFov, | |
| 42 blink::WebVRFieldOfView rightFov, | |
| 43 blink::WebVRVector4* leftRect, | |
| 44 blink::WebVRVector4* rightRect) { | |
| 45 leftRect->x = 0; | |
| 46 leftRect->y = 0; | |
| 47 leftRect->z = width_ / 2.0; | |
| 48 leftRect->w = height_; | |
| 49 | |
| 50 rightRect->x = width_ / 2.0; | |
| 51 rightRect->y = 0; | |
| 52 rightRect->z = width_ / 2.0; | |
| 53 rightRect->w = height_; | |
| 54 } | |
| 55 | |
| 56 } // namespace content | |
| OLD | NEW |