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

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

Issue 2317483002: Add support of vrdisplayconnect and vrdisplaydisconnect event (Closed)
Patch Set: fix missing brace 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplay.h ('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/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/Fullscreen.h" 8 #include "core/dom/Fullscreen.h"
9 #include "core/frame/UseCounter.h" 9 #include "core/frame/UseCounter.h"
10 #include "core/inspector/ConsoleMessage.h" 10 #include "core/inspector/ConsoleMessage.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 if (!display->stageParameters.is_null()) { 77 if (!display->stageParameters.is_null()) {
78 if (!m_stageParameters) 78 if (!m_stageParameters)
79 m_stageParameters = new VRStageParameters(); 79 m_stageParameters = new VRStageParameters();
80 m_stageParameters->update(display->stageParameters); 80 m_stageParameters->update(display->stageParameters);
81 } else { 81 } else {
82 m_stageParameters = nullptr; 82 m_stageParameters = nullptr;
83 } 83 }
84 } 84 }
85 85
86 void VRDisplay::disconnected()
87 {
88 if (m_isConnected)
89 m_isConnected = !m_isConnected;
90 }
91
86 bool VRDisplay::getFrameData(VRFrameData* frameData) 92 bool VRDisplay::getFrameData(VRFrameData* frameData)
87 { 93 {
88 updatePose(); 94 updatePose();
89 95
90 if (!frameData) 96 if (!frameData)
91 return false; 97 return false;
92 98
93 if (m_depthNear == m_depthFar) 99 if (m_depthNear == m_depthFar)
94 return false; 100 return false;
95 101
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 { 360 {
355 visitor->trace(m_navigatorVR); 361 visitor->trace(m_navigatorVR);
356 visitor->trace(m_capabilities); 362 visitor->trace(m_capabilities);
357 visitor->trace(m_stageParameters); 363 visitor->trace(m_stageParameters);
358 visitor->trace(m_eyeParametersLeft); 364 visitor->trace(m_eyeParametersLeft);
359 visitor->trace(m_eyeParametersRight); 365 visitor->trace(m_eyeParametersRight);
360 visitor->trace(m_layer); 366 visitor->trace(m_layer);
361 } 367 }
362 368
363 } // namespace blink 369 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698