Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Side by Side Diff: content/browser/vr/test/fake_vr_device.cc

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the rest of sievers@ input Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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(
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698