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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2360083004: Changed VRLayer's left/rightBounds to match the spec (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/vr/VRLayer.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
index 0b3d53df6e764a104f6e81ee0e8d7cf2e6417301..a4870e618ba4f50eef7f1c5b818c28c3baf9c063 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -211,6 +211,14 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* scriptState, const HeapVect
return promise;
}
+ if ((m_layer.leftBounds().size() != 0 && m_layer.leftBounds().size() != 4)
+ || (m_layer.rightBounds().size() != 0 && m_layer.rightBounds().size() != 4)) {
+ forceExitPresent();
+ DOMException* exception = DOMException::create(InvalidStateError, "Layer bounds must either be an empty array or have 4 values");
+ resolver->reject(exception);
+ return promise;
+ }
+
if (!m_capabilities->hasExternalDisplay()) {
// TODO: Need a proper VR compositor, but for the moment on mobile
// we'll just make the canvas fullscreen so that VrShell can pick it
@@ -295,7 +303,7 @@ void VRDisplay::updateLayerBounds()
device::blink::VRLayerBoundsPtr leftBounds = device::blink::VRLayerBounds::New();
device::blink::VRLayerBoundsPtr rightBounds = device::blink::VRLayerBounds::New();
- if (m_layer.hasLeftBounds()) {
+ if (m_layer.leftBounds().size() == 4) {
leftBounds->left = m_layer.leftBounds()[0];
leftBounds->top = m_layer.leftBounds()[1];
leftBounds->width = m_layer.leftBounds()[2];
@@ -308,7 +316,7 @@ void VRDisplay::updateLayerBounds()
leftBounds->height = 1.0f;
}
- if (m_layer.hasRightBounds()) {
+ if (m_layer.rightBounds().size() == 4) {
rightBounds->left = m_layer.rightBounds()[0];
rightBounds->top = m_layer.rightBounds()[1];
rightBounds->width = m_layer.rightBounds()[2];
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/vr/VRLayer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698