| 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" |
| 11 #include "device/vr/vr_service.mojom-blink.h" | 11 #include "device/vr/vr_service.mojom-blink.h" |
| 12 #include "modules/vr/VRDisplayCapabilities.h" | 12 #include "modules/vr/VRDisplayCapabilities.h" |
| 13 #include "modules/vr/VRLayer.h" | 13 #include "modules/vr/VRLayerInit.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "platform/Timer.h" | 15 #include "platform/Timer.h" |
| 16 #include "platform/heap/Handle.h" | 16 #include "platform/heap/Handle.h" |
| 17 #include "public/platform/WebGraphicsContext3DProvider.h" | 17 #include "public/platform/WebGraphicsContext3DProvider.h" |
| 18 #include "wtf/Forward.h" | 18 #include "wtf/Forward.h" |
| 19 #include "wtf/text/WTFString.h" | 19 #include "wtf/text/WTFString.h" |
| 20 | 20 |
| 21 namespace gpu { | 21 namespace gpu { |
| 22 namespace gles2 { | 22 namespace gles2 { |
| 23 class GLES2Interface; | 23 class GLES2Interface; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 double depthFar() const { return m_depthFar; } | 67 double depthFar() const { return m_depthFar; } |
| 68 | 68 |
| 69 void setDepthNear(double value) { m_depthNear = value; } | 69 void setDepthNear(double value) { m_depthNear = value; } |
| 70 void setDepthFar(double value) { m_depthFar = value; } | 70 void setDepthFar(double value) { m_depthFar = value; } |
| 71 | 71 |
| 72 VREyeParameters* getEyeParameters(const String&); | 72 VREyeParameters* getEyeParameters(const String&); |
| 73 | 73 |
| 74 int requestAnimationFrame(FrameRequestCallback*); | 74 int requestAnimationFrame(FrameRequestCallback*); |
| 75 void cancelAnimationFrame(int id); | 75 void cancelAnimationFrame(int id); |
| 76 | 76 |
| 77 ScriptPromise requestPresent(ScriptState*, const HeapVector<VRLayer>& layers); | 77 ScriptPromise requestPresent(ScriptState*, |
| 78 const HeapVector<VRLayerInit>& layers); |
| 78 ScriptPromise exitPresent(ScriptState*); | 79 ScriptPromise exitPresent(ScriptState*); |
| 79 | 80 |
| 80 HeapVector<VRLayer> getLayers(); | 81 HeapVector<VRLayerInit> getLayers(); |
| 81 | 82 |
| 82 void submitFrame(); | 83 void submitFrame(); |
| 83 | 84 |
| 84 Document* document(); | 85 Document* document(); |
| 85 | 86 |
| 86 // EventTarget overrides: | 87 // EventTarget overrides: |
| 87 ExecutionContext* getExecutionContext() const override; | 88 ExecutionContext* getExecutionContext() const override; |
| 88 const AtomicString& interfaceName() const override; | 89 const AtomicString& interfaceName() const override; |
| 89 | 90 |
| 90 // ContextLifecycleObserver implementation. | 91 // ContextLifecycleObserver implementation. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 Member<VRDisplayCapabilities> m_capabilities; | 157 Member<VRDisplayCapabilities> m_capabilities; |
| 157 Member<VRStageParameters> m_stageParameters; | 158 Member<VRStageParameters> m_stageParameters; |
| 158 Member<VREyeParameters> m_eyeParametersLeft; | 159 Member<VREyeParameters> m_eyeParametersLeft; |
| 159 Member<VREyeParameters> m_eyeParametersRight; | 160 Member<VREyeParameters> m_eyeParametersRight; |
| 160 device::mojom::blink::VRPosePtr m_framePose; | 161 device::mojom::blink::VRPosePtr m_framePose; |
| 161 | 162 |
| 162 // This frame ID is vr-specific and is used to track when frames arrive at the | 163 // This frame ID is vr-specific and is used to track when frames arrive at the |
| 163 // VR compositor so that it knows which poses to use, when to apply bounds | 164 // VR compositor so that it knows which poses to use, when to apply bounds |
| 164 // updates, etc. | 165 // updates, etc. |
| 165 int16_t m_vrFrameId = -1; | 166 int16_t m_vrFrameId = -1; |
| 166 VRLayer m_layer; | 167 VRLayerInit m_layer; |
| 167 double m_depthNear = 0.01; | 168 double m_depthNear = 0.01; |
| 168 double m_depthFar = 10000.0; | 169 double m_depthFar = 10000.0; |
| 169 | 170 |
| 170 // Current dimensions of the WebVR source canvas. May be different from | 171 // Current dimensions of the WebVR source canvas. May be different from |
| 171 // the recommended renderWidth/Height if the client overrides dimensions. | 172 // the recommended renderWidth/Height if the client overrides dimensions. |
| 172 int m_sourceWidth = 0; | 173 int m_sourceWidth = 0; |
| 173 int m_sourceHeight = 0; | 174 int m_sourceHeight = 0; |
| 174 | 175 |
| 175 void dispose(); | 176 void dispose(); |
| 176 | 177 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 RequestDenied = 12, | 219 RequestDenied = 12, |
| 219 FullscreenNotEnabled = 13, | 220 FullscreenNotEnabled = 13, |
| 220 PresentationResultMax, // Must be last member of enum. | 221 PresentationResultMax, // Must be last member of enum. |
| 221 }; | 222 }; |
| 222 | 223 |
| 223 void ReportPresentationResult(PresentationResult); | 224 void ReportPresentationResult(PresentationResult); |
| 224 | 225 |
| 225 } // namespace blink | 226 } // namespace blink |
| 226 | 227 |
| 227 #endif // VRDisplay_h | 228 #endif // VRDisplay_h |
| OLD | NEW |