Index: third_party/WebKit/Source/modules/vr/VRDisplay.h |
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.h b/third_party/WebKit/Source/modules/vr/VRDisplay.h |
index af955c5091b8593e17a0810ed81e71b42581ee3a..07e169809c5cbda73d180302fc44ca6735a90156 100644 |
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.h |
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.h |
@@ -41,7 +41,8 @@ enum VREye { VREyeNone, VREyeLeft, VREyeRight }; |
class VRDisplay final : public EventTargetWithInlineData, |
public ActiveScriptWrappable<VRDisplay>, |
public ContextLifecycleObserver, |
- public device::mojom::blink::VRDisplayClient { |
+ public device::mojom::blink::VRDisplayClient, |
+ public device::mojom::blink::VRSubmitFrameClient { |
DEFINE_WRAPPERTYPEINFO(); |
USING_GARBAGE_COLLECTED_MIXIN(VRDisplay); |
USING_PRE_FINALIZER(VRDisplay, dispose); |
@@ -116,7 +117,6 @@ class VRDisplay final : public EventTargetWithInlineData, |
VRController* controller(); |
private: |
- void onFullscreenCheck(TimerBase*); |
void onPresentComplete(bool); |
void onConnected(); |
@@ -126,6 +126,10 @@ class VRDisplay final : public EventTargetWithInlineData, |
void OnPresentChange(); |
+ // VRSubmitFrameClient |
+ void OnSubmitFrameTransferred(); |
+ void OnSubmitFrameRendered(); |
+ |
// VRDisplayClient |
void OnChanged(device::mojom::blink::VRDisplayInfoPtr) override; |
void OnExitPresent() override; |
@@ -162,24 +166,33 @@ class VRDisplay final : public EventTargetWithInlineData, |
double m_depthNear = 0.01; |
double m_depthFar = 10000.0; |
+ // Current dimensions of the WebVR source canvas. May be different from |
+ // the recommended renderWidth/Height if the client overrides dimensions. |
+ int m_sourceWidth = 0; |
+ int m_sourceHeight = 0; |
+ |
void dispose(); |
- TaskRunnerTimer<VRDisplay> m_fullscreenCheckTimer; |
- String m_fullscreenOrigWidth; |
- String m_fullscreenOrigHeight; |
gpu::gles2::GLES2Interface* m_contextGL = nullptr; |
Member<WebGLRenderingContextBase> m_renderingContext; |
+ // Used to keep the image alive until the next frame if using |
+ // waitForPreviousTransferToFinish. |
+ RefPtr<Image> m_previousImage; |
+ |
Member<ScriptedAnimationController> m_scriptedAnimationController; |
bool m_pendingRaf = false; |
bool m_pendingVsync = false; |
bool m_inAnimationFrame = false; |
bool m_displayBlurred = false; |
- bool m_reenteredFullscreen = false; |
double m_timebase = -1; |
+ bool m_pendingPreviousFrameRender = false; |
+ bool m_pendingSubmitFrame = false; |
device::mojom::blink::VRDisplayPtr m_display; |
+ mojo::Binding<device::mojom::blink::VRSubmitFrameClient> |
+ m_submit_frame_client_binding; |
mojo::Binding<device::mojom::blink::VRDisplayClient> m_displayClientBinding; |
device::mojom::blink::VRVSyncProviderPtr m_vrVSyncProvider; |