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

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

Issue 2623613002: Reland 2617183002 without offending tests (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/vr/stageParameters_match.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 leftBounds->left = m_layer.leftBounds()[0]; 551 leftBounds->left = m_layer.leftBounds()[0];
552 leftBounds->top = m_layer.leftBounds()[1]; 552 leftBounds->top = m_layer.leftBounds()[1];
553 leftBounds->width = m_layer.leftBounds()[2]; 553 leftBounds->width = m_layer.leftBounds()[2];
554 leftBounds->height = m_layer.leftBounds()[3]; 554 leftBounds->height = m_layer.leftBounds()[3];
555 } else { 555 } else {
556 // Left eye defaults 556 // Left eye defaults
557 leftBounds->left = 0.0f; 557 leftBounds->left = 0.0f;
558 leftBounds->top = 0.0f; 558 leftBounds->top = 0.0f;
559 leftBounds->width = 0.5f; 559 leftBounds->width = 0.5f;
560 leftBounds->height = 1.0f; 560 leftBounds->height = 1.0f;
561 m_layer.setLeftBounds({0.0f, 0.0f, 0.5f, 1.0f});
561 } 562 }
562 563
563 if (m_layer.rightBounds().size() == 4) { 564 if (m_layer.rightBounds().size() == 4) {
564 rightBounds->left = m_layer.rightBounds()[0]; 565 rightBounds->left = m_layer.rightBounds()[0];
565 rightBounds->top = m_layer.rightBounds()[1]; 566 rightBounds->top = m_layer.rightBounds()[1];
566 rightBounds->width = m_layer.rightBounds()[2]; 567 rightBounds->width = m_layer.rightBounds()[2];
567 rightBounds->height = m_layer.rightBounds()[3]; 568 rightBounds->height = m_layer.rightBounds()[3];
568 } else { 569 } else {
569 // Right eye defaults 570 // Right eye defaults
570 rightBounds->left = 0.5f; 571 rightBounds->left = 0.5f;
571 rightBounds->top = 0.0f; 572 rightBounds->top = 0.0f;
572 rightBounds->width = 0.5f; 573 rightBounds->width = 0.5f;
573 rightBounds->height = 1.0f; 574 rightBounds->height = 1.0f;
575 m_layer.setRightBounds({0.5f, 0.0f, 0.5f, 1.0f});
574 } 576 }
575 577
576 m_display->UpdateLayerBounds(std::move(leftBounds), std::move(rightBounds)); 578 m_display->UpdateLayerBounds(std::move(leftBounds), std::move(rightBounds));
577 } 579 }
578 580
579 HeapVector<VRLayer> VRDisplay::getLayers() { 581 HeapVector<VRLayer> VRDisplay::getLayers() {
580 HeapVector<VRLayer> layers; 582 HeapVector<VRLayer> layers;
581 583
582 if (m_isPresenting) { 584 if (m_isPresenting) {
583 layers.push_back(m_layer); 585 layers.push_back(m_layer);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 visitor->trace(m_stageParameters); 768 visitor->trace(m_stageParameters);
767 visitor->trace(m_eyeParametersLeft); 769 visitor->trace(m_eyeParametersLeft);
768 visitor->trace(m_eyeParametersRight); 770 visitor->trace(m_eyeParametersRight);
769 visitor->trace(m_layer); 771 visitor->trace(m_layer);
770 visitor->trace(m_renderingContext); 772 visitor->trace(m_renderingContext);
771 visitor->trace(m_scriptedAnimationController); 773 visitor->trace(m_scriptedAnimationController);
772 visitor->trace(m_pendingPresentResolvers); 774 visitor->trace(m_pendingPresentResolvers);
773 } 775 }
774 776
775 } // namespace blink 777 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/vr/stageParameters_match.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698