Chromium Code Reviews| 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/VRLayer.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 "platform/wtf/Forward.h" | 17 #include "platform/wtf/Forward.h" |
| 18 #include "platform/wtf/text/WTFString.h" | 18 #include "platform/wtf/text/WTFString.h" |
| 19 #include "public/platform/WebGraphicsContext3DProvider.h" | 19 #include "public/platform/WebGraphicsContext3DProvider.h" |
| 20 | 20 |
| 21 #include "core/dom/SuspendableObject.h" | |
|
billorr
2017/06/08 04:20:21
moving this up above...
| |
| 22 | |
| 21 namespace gpu { | 23 namespace gpu { |
| 22 namespace gles2 { | 24 namespace gles2 { |
| 23 class GLES2Interface; | 25 class GLES2Interface; |
| 24 } | 26 } |
| 25 } | 27 } |
| 26 | 28 |
| 27 namespace blink { | 29 namespace blink { |
| 28 | 30 |
| 29 class NavigatorVR; | 31 class NavigatorVR; |
| 30 class ScriptedAnimationController; | 32 class ScriptedAnimationController; |
| 31 class VRController; | 33 class VRController; |
| 32 class VREyeParameters; | 34 class VREyeParameters; |
| 33 class VRFrameData; | 35 class VRFrameData; |
| 34 class VRStageParameters; | 36 class VRStageParameters; |
| 35 | 37 |
| 36 class WebGLRenderingContextBase; | 38 class WebGLRenderingContextBase; |
| 37 | 39 |
| 38 enum VREye { kVREyeNone, kVREyeLeft, kVREyeRight }; | 40 enum VREye { kVREyeNone, kVREyeLeft, kVREyeRight }; |
| 39 | 41 |
| 40 class VRDisplay final : public EventTargetWithInlineData, | 42 class VRDisplay final : public EventTargetWithInlineData, |
| 41 public ActiveScriptWrappable<VRDisplay>, | 43 public ActiveScriptWrappable<VRDisplay>, |
| 42 public ContextLifecycleObserver, | 44 public SuspendableObject, |
| 43 public device::mojom::blink::VRDisplayClient, | 45 public device::mojom::blink::VRDisplayClient, |
| 44 public device::mojom::blink::VRSubmitFrameClient { | 46 public device::mojom::blink::VRSubmitFrameClient { |
| 45 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 46 USING_GARBAGE_COLLECTED_MIXIN(VRDisplay); | 48 USING_GARBAGE_COLLECTED_MIXIN(VRDisplay); |
| 47 USING_PRE_FINALIZER(VRDisplay, Dispose); | 49 USING_PRE_FINALIZER(VRDisplay, Dispose); |
| 48 | 50 |
| 49 public: | 51 public: |
| 50 ~VRDisplay(); | 52 ~VRDisplay(); |
| 51 | 53 |
| 52 unsigned displayId() const { return display_id_; } | 54 unsigned displayId() const { return display_id_; } |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 82 // EventTarget overrides: | 84 // EventTarget overrides: |
| 83 ExecutionContext* GetExecutionContext() const override; | 85 ExecutionContext* GetExecutionContext() const override; |
| 84 const AtomicString& InterfaceName() const override; | 86 const AtomicString& InterfaceName() const override; |
| 85 | 87 |
| 86 // ContextLifecycleObserver implementation. | 88 // ContextLifecycleObserver implementation. |
| 87 void ContextDestroyed(ExecutionContext*) override; | 89 void ContextDestroyed(ExecutionContext*) override; |
| 88 | 90 |
| 89 // ScriptWrappable implementation. | 91 // ScriptWrappable implementation. |
| 90 bool HasPendingActivity() const final; | 92 bool HasPendingActivity() const final; |
| 91 | 93 |
| 94 // SuspendableObject: | |
| 95 void Suspend() override; | |
| 96 void Resume() override; | |
| 97 | |
| 92 void FocusChanged(); | 98 void FocusChanged(); |
| 93 | 99 |
| 94 DECLARE_VIRTUAL_TRACE(); | 100 DECLARE_VIRTUAL_TRACE(); |
| 95 | 101 |
| 96 protected: | 102 protected: |
| 97 friend class VRController; | 103 friend class VRController; |
| 98 | 104 |
| 99 VRDisplay(NavigatorVR*, | 105 VRDisplay(NavigatorVR*, |
| 100 device::mojom::blink::VRDisplayPtr, | 106 device::mojom::blink::VRDisplayPtr, |
| 101 device::mojom::blink::VRDisplayClientRequest); | 107 device::mojom::blink::VRDisplayClientRequest); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 kRequestDenied = 12, | 235 kRequestDenied = 12, |
| 230 kFullscreenNotEnabled = 13, | 236 kFullscreenNotEnabled = 13, |
| 231 kPresentationResultMax, // Must be last member of enum. | 237 kPresentationResultMax, // Must be last member of enum. |
| 232 }; | 238 }; |
| 233 | 239 |
| 234 void ReportPresentationResult(PresentationResult); | 240 void ReportPresentationResult(PresentationResult); |
| 235 | 241 |
| 236 } // namespace blink | 242 } // namespace blink |
| 237 | 243 |
| 238 #endif // VRDisplay_h | 244 #endif // VRDisplay_h |
| OLD | NEW |