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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRDisplay.h

Issue 2668003003: Provide WebVR pose data only to the focused frame. (Closed)
Patch Set: Address comments Created 3 years, 10 months 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
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // EventTarget overrides: 85 // EventTarget overrides:
86 ExecutionContext* getExecutionContext() const override; 86 ExecutionContext* getExecutionContext() const override;
87 const AtomicString& interfaceName() const override; 87 const AtomicString& interfaceName() const override;
88 88
89 // ContextLifecycleObserver implementation. 89 // ContextLifecycleObserver implementation.
90 void contextDestroyed(ExecutionContext*) override; 90 void contextDestroyed(ExecutionContext*) override;
91 91
92 // ScriptWrappable implementation. 92 // ScriptWrappable implementation.
93 bool hasPendingActivity() const final; 93 bool hasPendingActivity() const final;
94 94
95 void focusChanged(bool focused);
96
95 DECLARE_VIRTUAL_TRACE(); 97 DECLARE_VIRTUAL_TRACE();
96 98
97 protected: 99 protected:
98 friend class VRController; 100 friend class VRController;
99 101
100 VRDisplay(NavigatorVR*, 102 VRDisplay(NavigatorVR*,
101 device::mojom::blink::VRDisplayPtr, 103 device::mojom::blink::VRDisplayPtr,
102 device::mojom::blink::VRDisplayClientRequest); 104 device::mojom::blink::VRDisplayClientRequest);
103 105
104 void update(const device::mojom::blink::VRDisplayInfoPtr&); 106 void update(const device::mojom::blink::VRDisplayInfoPtr&);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 unsigned m_displayId = 0; 143 unsigned m_displayId = 0;
142 String m_displayName; 144 String m_displayName;
143 bool m_isConnected = false; 145 bool m_isConnected = false;
144 bool m_isPresenting = false; 146 bool m_isPresenting = false;
145 bool m_isValidDeviceForPresenting = true; 147 bool m_isValidDeviceForPresenting = true;
146 Member<VRDisplayCapabilities> m_capabilities; 148 Member<VRDisplayCapabilities> m_capabilities;
147 Member<VRStageParameters> m_stageParameters; 149 Member<VRStageParameters> m_stageParameters;
148 Member<VREyeParameters> m_eyeParametersLeft; 150 Member<VREyeParameters> m_eyeParametersLeft;
149 Member<VREyeParameters> m_eyeParametersRight; 151 Member<VREyeParameters> m_eyeParametersRight;
150 device::mojom::blink::VRPosePtr m_framePose; 152 device::mojom::blink::VRPosePtr m_framePose;
151 int16_t m_frameId; 153 int16_t m_frameId = -1;
152 VRLayer m_layer; 154 VRLayer m_layer;
153 double m_depthNear = 0.01; 155 double m_depthNear = 0.01;
154 double m_depthFar = 10000.0; 156 double m_depthFar = 10000.0;
155 157
156 void dispose(); 158 void dispose();
157 159
158 TaskRunnerTimer<VRDisplay> m_fullscreenCheckTimer; 160 TaskRunnerTimer<VRDisplay> m_fullscreenCheckTimer;
159 String m_fullscreenOrigWidth; 161 String m_fullscreenOrigWidth;
160 String m_fullscreenOrigHeight; 162 String m_fullscreenOrigHeight;
161 gpu::gles2::GLES2Interface* m_contextGL = nullptr; 163 gpu::gles2::GLES2Interface* m_contextGL = nullptr;
162 Member<WebGLRenderingContextBase> m_renderingContext; 164 Member<WebGLRenderingContextBase> m_renderingContext;
163 165
164 Member<ScriptedAnimationController> m_scriptedAnimationController; 166 Member<ScriptedAnimationController> m_scriptedAnimationController;
165 bool m_pendingRaf = false; 167 bool m_pendingRaf = false;
166 bool m_inAnimationFrame = false; 168 bool m_inAnimationFrame = false;
167 bool m_displayBlurred = false; 169 bool m_displayBlurred = false;
168 bool m_reenteredFullscreen = false; 170 bool m_reenteredFullscreen = false;
169 double m_timebase = -1; 171 double m_timebase = -1;
172 bool m_focused = false;
haraken 2017/02/03 04:21:47 It looks a bit weird that we have to introduce the
mthiesse 2017/02/03 15:54:20 Yes, done.
170 173
171 device::mojom::blink::VRDisplayPtr m_display; 174 device::mojom::blink::VRDisplayPtr m_display;
172 175
173 mojo::Binding<device::mojom::blink::VRDisplayClient> m_displayClientBinding; 176 mojo::Binding<device::mojom::blink::VRDisplayClient> m_displayClientBinding;
174 device::mojom::blink::VRVSyncProviderPtr m_vrVSyncProvider; 177 device::mojom::blink::VRVSyncProviderPtr m_vrVSyncProvider;
175 178
176 HeapDeque<Member<ScriptPromiseResolver>> m_pendingPresentResolvers; 179 HeapDeque<Member<ScriptPromiseResolver>> m_pendingPresentResolvers;
177 }; 180 };
178 181
179 using VRDisplayVector = HeapVector<Member<VRDisplay>>; 182 using VRDisplayVector = HeapVector<Member<VRDisplay>>;
(...skipping 14 matching lines...) Expand all
194 RequestDenied = 12, 197 RequestDenied = 12,
195 FullscreenNotEnabled = 13, 198 FullscreenNotEnabled = 13,
196 PresentationResultMax, // Must be last member of enum. 199 PresentationResultMax, // Must be last member of enum.
197 }; 200 };
198 201
199 void ReportPresentationResult(PresentationResult); 202 void ReportPresentationResult(PresentationResult);
200 203
201 } // namespace blink 204 } // namespace blink
202 205
203 #endif // VRDisplay_h 206 #endif // VRDisplay_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRController.cpp ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698