OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/vr/vr_device.h" | 5 #include "device/vr/vr_device.h" |
6 #include "device/vr/vr_device_provider.h" | 6 #include "device/vr/vr_device_provider.h" |
7 #include "device/vr/vr_display_impl.h" | 7 #include "device/vr/vr_display_impl.h" |
8 | 8 |
9 namespace device { | 9 namespace device { |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 bool VRDevice::IsAccessAllowed(VRDisplayImpl* display) { | 37 bool VRDevice::IsAccessAllowed(VRDisplayImpl* display) { |
38 return (!presenting_display_ || presenting_display_ == display); | 38 return (!presenting_display_ || presenting_display_ == display); |
39 } | 39 } |
40 | 40 |
41 bool VRDevice::CheckPresentingDisplay(VRDisplayImpl* display) { | 41 bool VRDevice::CheckPresentingDisplay(VRDisplayImpl* display) { |
42 return (presenting_display_ && presenting_display_ == display); | 42 return (presenting_display_ && presenting_display_ == display); |
43 } | 43 } |
44 | 44 |
45 void VRDevice::OnChanged() { | 45 void VRDevice::OnChanged() { |
| 46 VLOG(1) << __FUNCTION__; |
46 mojom::VRDisplayInfoPtr vr_device_info = GetVRDevice(); | 47 mojom::VRDisplayInfoPtr vr_device_info = GetVRDevice(); |
47 if (vr_device_info.is_null()) | 48 if (vr_device_info.is_null()) |
48 return; | 49 return; |
49 | 50 |
50 for (const auto& display : displays_) | 51 for (const auto& display : displays_) |
51 display->client()->OnChanged(vr_device_info.Clone()); | 52 display->client()->OnChanged(vr_device_info.Clone()); |
52 } | 53 } |
53 | 54 |
54 void VRDevice::OnExitPresent() { | 55 void VRDevice::OnExitPresent() { |
55 auto it = displays_.find(presenting_display_); | 56 auto it = displays_.find(presenting_display_); |
(...skipping 20 matching lines...) Expand all Loading... |
76 | 77 |
77 void VRDevice::OnDeactivate(mojom::VRDisplayEventReason reason) { | 78 void VRDevice::OnDeactivate(mojom::VRDisplayEventReason reason) { |
78 for (const auto& display : displays_) | 79 for (const auto& display : displays_) |
79 display->client()->OnDeactivate(reason); | 80 display->client()->OnDeactivate(reason); |
80 } | 81 } |
81 | 82 |
82 void VRDevice::SetPresentingDisplay(VRDisplayImpl* display) { | 83 void VRDevice::SetPresentingDisplay(VRDisplayImpl* display) { |
83 presenting_display_ = display; | 84 presenting_display_ = display; |
84 } | 85 } |
85 | 86 |
| 87 void VRDevice::GetSurfaceHandle(int32_t width, int32_t height, |
| 88 const mojom::VRDisplay::GetSurfaceHandleCallback
& callback) { |
| 89 callback.Run(0); |
| 90 }; |
| 91 |
86 } // namespace device | 92 } // namespace device |
OLD | NEW |