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

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

Issue 2420743003: mojo VR interface simplified (Closed)
Patch Set: address leon@ comments about name 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
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 VRDeviceClientImpl::VRDeviceClientImpl(mojo::InterfaceRequest<VRDevice> request,
14 device::VRDevice* device,
15 VRServiceImpl* service)
16 : binding_(this, std::move(request)) {
17 device_.reset(device);
18 service_.reset(service);
19 }
20
21 void VRDeviceClientImpl::GetPose(const GetPoseCallback& callback) {
22 callback.Run(device_->GetPose(service_.get()));
23 }
24
25 void VRDeviceClientImpl::ResetPose() {
26 device_->ResetPose(service_.get());
27 }
28
29 void VRDeviceClientImpl::RequestPresent(
30 bool secureOrigin,
31 const RequestPresentCallback& callback) {
32 callback.Run(device_->RequestPresent(service_.get(), secureOrigin));
33 }
34
35 void VRDeviceClientImpl::ExitPresent() {
36 device_->ExitPresent(service_.get());
37 }
38
39 void VRDeviceClientImpl::SubmitFrame(mojom::VRPosePtr pose) {
40 device_->SubmitFrame(service_.get(), std::move(pose));
41 }
42
43 void VRDeviceClientImpl::UpdateLayerBounds(
44 mojom::VRLayerBoundsPtr leftBounds,
45 mojom::VRLayerBoundsPtr rightBounds) {
46 device_->UpdateLayerBounds(service_.get(), std::move(leftBounds),
47 std::move(rightBounds));
48 }
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698