| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef VRDisplay_h | 5 #ifndef VRDisplay_h |
| 6 #define VRDisplay_h | 6 #define VRDisplay_h |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/FrameRequestCallback.h" | 9 #include "core/dom/FrameRequestCallback.h" |
| 10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace blink { | 27 namespace blink { |
| 28 | 28 |
| 29 class NavigatorVR; | 29 class NavigatorVR; |
| 30 class ScriptedAnimationController; | 30 class ScriptedAnimationController; |
| 31 class VRController; | 31 class VRController; |
| 32 class VREyeParameters; | 32 class VREyeParameters; |
| 33 class VRFrameData; | 33 class VRFrameData; |
| 34 class VRStageParameters; | 34 class VRStageParameters; |
| 35 class VRPose; | |
| 36 | 35 |
| 37 class WebGLRenderingContextBase; | 36 class WebGLRenderingContextBase; |
| 38 | 37 |
| 39 enum VREye { VREyeNone, VREyeLeft, VREyeRight }; | 38 enum VREye { VREyeNone, VREyeLeft, VREyeRight }; |
| 40 | 39 |
| 41 class VRDisplay final : public EventTargetWithInlineData, | 40 class VRDisplay final : public EventTargetWithInlineData, |
| 42 public ActiveScriptWrappable<VRDisplay>, | 41 public ActiveScriptWrappable<VRDisplay>, |
| 43 public ContextLifecycleObserver, | 42 public ContextLifecycleObserver, |
| 44 public device::mojom::blink::VRDisplayClient, | 43 public device::mojom::blink::VRDisplayClient, |
| 45 public device::mojom::blink::VRSubmitFrameClient { | 44 public device::mojom::blink::VRSubmitFrameClient { |
| 46 DEFINE_WRAPPERTYPEINFO(); | 45 DEFINE_WRAPPERTYPEINFO(); |
| 47 USING_GARBAGE_COLLECTED_MIXIN(VRDisplay); | 46 USING_GARBAGE_COLLECTED_MIXIN(VRDisplay); |
| 48 USING_PRE_FINALIZER(VRDisplay, dispose); | 47 USING_PRE_FINALIZER(VRDisplay, dispose); |
| 49 | 48 |
| 50 public: | 49 public: |
| 51 ~VRDisplay(); | 50 ~VRDisplay(); |
| 52 | 51 |
| 53 unsigned displayId() const { return m_displayId; } | 52 unsigned displayId() const { return m_displayId; } |
| 54 const String& displayName() const { return m_displayName; } | 53 const String& displayName() const { return m_displayName; } |
| 55 | 54 |
| 56 VRDisplayCapabilities* capabilities() const { return m_capabilities; } | 55 VRDisplayCapabilities* capabilities() const { return m_capabilities; } |
| 57 VRStageParameters* stageParameters() const { return m_stageParameters; } | 56 VRStageParameters* stageParameters() const { return m_stageParameters; } |
| 58 | 57 |
| 59 bool isConnected() const { return m_isConnected; } | |
| 60 bool isPresenting() const { return m_isPresenting; } | 58 bool isPresenting() const { return m_isPresenting; } |
| 61 | 59 |
| 62 bool getFrameData(VRFrameData*); | 60 bool getFrameData(VRFrameData*); |
| 63 VRPose* getPose(); | |
| 64 void resetPose(); | |
| 65 | 61 |
| 66 double depthNear() const { return m_depthNear; } | 62 double depthNear() const { return m_depthNear; } |
| 67 double depthFar() const { return m_depthFar; } | 63 double depthFar() const { return m_depthFar; } |
| 68 | 64 |
| 69 void setDepthNear(double value) { m_depthNear = value; } | 65 void setDepthNear(double value) { m_depthNear = value; } |
| 70 void setDepthFar(double value) { m_depthFar = value; } | 66 void setDepthFar(double value) { m_depthFar = value; } |
| 71 | 67 |
| 72 VREyeParameters* getEyeParameters(const String&); | 68 VREyeParameters* getEyeParameters(const String&); |
| 73 | 69 |
| 74 int requestAnimationFrame(FrameRequestCallback*); | 70 int requestAnimationFrame(FrameRequestCallback*); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 105 device::mojom::blink::VRDisplayClientRequest); | 101 device::mojom::blink::VRDisplayClientRequest); |
| 106 | 102 |
| 107 void update(const device::mojom::blink::VRDisplayInfoPtr&); | 103 void update(const device::mojom::blink::VRDisplayInfoPtr&); |
| 108 | 104 |
| 109 void updatePose(); | 105 void updatePose(); |
| 110 | 106 |
| 111 void beginPresent(); | 107 void beginPresent(); |
| 112 void forceExitPresent(); | 108 void forceExitPresent(); |
| 113 | 109 |
| 114 void updateLayerBounds(); | 110 void updateLayerBounds(); |
| 115 void disconnected(); | |
| 116 | 111 |
| 117 VRController* controller(); | 112 VRController* controller(); |
| 118 | 113 |
| 119 private: | 114 private: |
| 120 void onPresentComplete(bool); | 115 void onPresentComplete(bool); |
| 121 | 116 |
| 122 void onConnected(); | 117 void onConnected(); |
| 123 void onDisconnected(); | 118 void onDisconnected(); |
| 124 | 119 |
| 125 void stopPresenting(); | 120 void stopPresenting(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 RequestDenied = 12, | 215 RequestDenied = 12, |
| 221 FullscreenNotEnabled = 13, | 216 FullscreenNotEnabled = 13, |
| 222 PresentationResultMax, // Must be last member of enum. | 217 PresentationResultMax, // Must be last member of enum. |
| 223 }; | 218 }; |
| 224 | 219 |
| 225 void ReportPresentationResult(PresentationResult); | 220 void ReportPresentationResult(PresentationResult); |
| 226 | 221 |
| 227 } // namespace blink | 222 } // namespace blink |
| 228 | 223 |
| 229 #endif // VRDisplay_h | 224 #endif // VRDisplay_h |
| OLD | NEW |