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

Side by Side Diff: device/vr/vr_display_impl.cc

Issue 2494733002: Reland of mojo VR interface simpified. (Closed)
Patch Set: Fix Werror Created 4 years, 1 month 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
« no previous file with comments | « device/vr/vr_display_impl.h ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <utility>
6
7 #include "base/bind.h"
8 #include "device/vr/vr_device.h"
9 #include "device/vr/vr_service_impl.h"
10
11 namespace device {
12
13 VRDisplayImpl::VRDisplayImpl(device::VRDevice* device, VRServiceImpl* service)
14 : binding_(this), device_(device), service_(service) {
15 mojom::VRDisplayInfoPtr display_info = device->GetVRDevice();
16 service->client()->OnDisplayConnected(binding_.CreateInterfacePtrAndBind(),
17 mojo::GetProxy(&client_),
18 std::move(display_info));
19 }
20
21 VRDisplayImpl::~VRDisplayImpl() {}
22
23 void VRDisplayImpl::GetPose(const GetPoseCallback& callback) {
24 callback.Run(device_->GetPose(service_.get()));
25 }
26
27 void VRDisplayImpl::ResetPose() {
28 device_->ResetPose(service_.get());
29 }
30
31 void VRDisplayImpl::RequestPresent(bool secureOrigin,
32 const RequestPresentCallback& callback) {
33 callback.Run(device_->RequestPresent(service_.get(), secureOrigin));
34 }
35
36 void VRDisplayImpl::ExitPresent() {
37 device_->ExitPresent(service_.get());
38 }
39
40 void VRDisplayImpl::SubmitFrame(mojom::VRPosePtr pose) {
41 device_->SubmitFrame(service_.get(), std::move(pose));
42 }
43
44 void VRDisplayImpl::UpdateLayerBounds(mojom::VRLayerBoundsPtr leftBounds,
45 mojom::VRLayerBoundsPtr rightBounds) {
46 device_->UpdateLayerBounds(service_.get(), std::move(leftBounds),
47 std::move(rightBounds));
48 }
49 }
OLDNEW
« no previous file with comments | « device/vr/vr_display_impl.h ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698