| 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 #include "modules/vr/VRDisplay.h" | 5 #include "modules/vr/VRDisplay.h" |
| 6 | 6 |
| 7 #include "core/css/StylePropertySet.h" | 7 #include "core/css/StylePropertySet.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/dom/DocumentUserGestureToken.h" | 9 #include "core/dom/DocumentUserGestureToken.h" |
| 10 #include "core/dom/FrameRequestCallback.h" | 10 #include "core/dom/FrameRequestCallback.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 rightBounds->width = m_layer.rightBounds()[2]; | 566 rightBounds->width = m_layer.rightBounds()[2]; |
| 567 rightBounds->height = m_layer.rightBounds()[3]; | 567 rightBounds->height = m_layer.rightBounds()[3]; |
| 568 } else { | 568 } else { |
| 569 // Right eye defaults | 569 // Right eye defaults |
| 570 rightBounds->left = 0.5f; | 570 rightBounds->left = 0.5f; |
| 571 rightBounds->top = 0.0f; | 571 rightBounds->top = 0.0f; |
| 572 rightBounds->width = 0.5f; | 572 rightBounds->width = 0.5f; |
| 573 rightBounds->height = 1.0f; | 573 rightBounds->height = 1.0f; |
| 574 } | 574 } |
| 575 | 575 |
| 576 m_display->UpdateLayerBounds(std::move(leftBounds), std::move(rightBounds)); | 576 // TODO(klausw): Tie updating layer bounds to when we render the correct |
| 577 // frame. |
| 578 // Specify a frame index of 0 for now, meaning to update immediately. |
| 579 m_display->UpdateLayerBounds(0, std::move(leftBounds), |
| 580 std::move(rightBounds)); |
| 577 } | 581 } |
| 578 | 582 |
| 579 HeapVector<VRLayer> VRDisplay::getLayers() { | 583 HeapVector<VRLayer> VRDisplay::getLayers() { |
| 580 HeapVector<VRLayer> layers; | 584 HeapVector<VRLayer> layers; |
| 581 | 585 |
| 582 if (m_isPresenting) { | 586 if (m_isPresenting) { |
| 583 layers.append(m_layer); | 587 layers.append(m_layer); |
| 584 } | 588 } |
| 585 | 589 |
| 586 return layers; | 590 return layers; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 visitor->trace(m_stageParameters); | 770 visitor->trace(m_stageParameters); |
| 767 visitor->trace(m_eyeParametersLeft); | 771 visitor->trace(m_eyeParametersLeft); |
| 768 visitor->trace(m_eyeParametersRight); | 772 visitor->trace(m_eyeParametersRight); |
| 769 visitor->trace(m_layer); | 773 visitor->trace(m_layer); |
| 770 visitor->trace(m_renderingContext); | 774 visitor->trace(m_renderingContext); |
| 771 visitor->trace(m_scriptedAnimationController); | 775 visitor->trace(m_scriptedAnimationController); |
| 772 visitor->trace(m_pendingPresentResolvers); | 776 visitor->trace(m_pendingPresentResolvers); |
| 773 } | 777 } |
| 774 | 778 |
| 775 } // namespace blink | 779 } // namespace blink |
| OLD | NEW |