| 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/FrameRequestCallback.h" | 9 #include "core/dom/FrameRequestCallback.h" |
| 10 #include "core/dom/ScriptedAnimationController.h" | 10 #include "core/dom/ScriptedAnimationController.h" |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 context_gl_ = nullptr; | 678 context_gl_ = nullptr; |
| 679 pending_submit_frame_ = false; | 679 pending_submit_frame_ = false; |
| 680 pending_previous_frame_render_ = false; | 680 pending_previous_frame_render_ = false; |
| 681 } | 681 } |
| 682 | 682 |
| 683 void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason, | 683 void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason, |
| 684 const OnActivateCallback& on_handled) { | 684 const OnActivateCallback& on_handled) { |
| 685 AutoReset<bool> activating(&in_display_activate_, true); | 685 AutoReset<bool> activating(&in_display_activate_, true); |
| 686 navigator_vr_->DispatchVREvent(VRDisplayEvent::Create( | 686 navigator_vr_->DispatchVREvent(VRDisplayEvent::Create( |
| 687 EventTypeNames::vrdisplayactivate, true, false, this, reason)); | 687 EventTypeNames::vrdisplayactivate, true, false, this, reason)); |
| 688 on_handled.Run(pending_present_request_); | 688 on_handled.Run(!pending_present_request_ && !is_presenting_); |
| 689 } | 689 } |
| 690 | 690 |
| 691 void VRDisplay::OnDeactivate( | 691 void VRDisplay::OnDeactivate( |
| 692 device::mojom::blink::VRDisplayEventReason reason) { | 692 device::mojom::blink::VRDisplayEventReason reason) { |
| 693 navigator_vr_->EnqueueVREvent(VRDisplayEvent::Create( | 693 navigator_vr_->EnqueueVREvent(VRDisplayEvent::Create( |
| 694 EventTypeNames::vrdisplaydeactivate, true, false, this, reason)); | 694 EventTypeNames::vrdisplaydeactivate, true, false, this, reason)); |
| 695 } | 695 } |
| 696 | 696 |
| 697 void VRDisplay::ProcessScheduledWindowAnimations(double timestamp) { | 697 void VRDisplay::ProcessScheduledWindowAnimations(double timestamp) { |
| 698 TRACE_EVENT1("gpu", "VRDisplay::window.rAF", "frame", vr_frame_id_); | 698 TRACE_EVENT1("gpu", "VRDisplay::window.rAF", "frame", vr_frame_id_); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 visitor->Trace(stage_parameters_); | 867 visitor->Trace(stage_parameters_); |
| 868 visitor->Trace(eye_parameters_left_); | 868 visitor->Trace(eye_parameters_left_); |
| 869 visitor->Trace(eye_parameters_right_); | 869 visitor->Trace(eye_parameters_right_); |
| 870 visitor->Trace(layer_); | 870 visitor->Trace(layer_); |
| 871 visitor->Trace(rendering_context_); | 871 visitor->Trace(rendering_context_); |
| 872 visitor->Trace(scripted_animation_controller_); | 872 visitor->Trace(scripted_animation_controller_); |
| 873 visitor->Trace(pending_present_resolvers_); | 873 visitor->Trace(pending_present_resolvers_); |
| 874 } | 874 } |
| 875 | 875 |
| 876 } // namespace blink | 876 } // namespace blink |
| OLD | NEW |