Remove WebVR

This commit is contained in:
Alan Jeffrey 2020-04-07 16:05:36 -05:00
parent d8781c1054
commit c611e46381
74 changed files with 97 additions and 3178 deletions

View file

@ -32,7 +32,6 @@ net_traits = {path = "../net_traits"}
num-traits = "0.2"
pixels = {path = "../pixels", optional = true}
profile_traits = {path = "../profile_traits"}
rust-webvr = {version = "0.19", features = ["mock", "openvr", "vrexternal"]}
script_traits = {path = "../script_traits"}
servo_geometry = {path = "../geometry"}
servo-media = {git = "https://github.com/servo/media"}
@ -41,7 +40,6 @@ style_traits = {path = "../style_traits"}
time = "0.1.17"
webrender = {git = "https://github.com/servo/webrender", features = ["capture"]}
webrender_api = {git = "https://github.com/servo/webrender"}
webvr_traits = {path = "../webvr_traits"}
webxr = {git = "https://github.com/servo/webxr"}
[build-dependencies]

View file

@ -46,7 +46,6 @@ use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
use time::{now, precise_time_ns, precise_time_s};
use webrender_api::units::{DeviceIntPoint, DeviceIntSize, DevicePoint, LayoutVector2D};
use webrender_api::{self, HitTestFlags, HitTestResult, ScrollLocation};
use webvr_traits::WebVRMainThreadHeartbeat;
#[derive(Debug, PartialEq)]
enum UnableToComposite {
@ -179,9 +178,6 @@ pub struct IOCompositor<Window: WindowMethods + ?Sized> {
/// The webrender interface, if enabled.
webrender_api: webrender_api::RenderApi,
/// Some VR displays want to be sent a heartbeat from the main thread.
webvr_heartbeats: Vec<Box<dyn WebVRMainThreadHeartbeat>>,
/// Some XR devices want to run on the main thread.
pub webxr_main_thread: webxr::MainThreadRegistry,
@ -320,7 +316,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
webrender: state.webrender,
webrender_document: state.webrender_document,
webrender_api: state.webrender_api,
webvr_heartbeats: state.webvr_heartbeats,
webxr_main_thread: state.webxr_main_thread,
pending_paint_metrics: HashMap::new(),
cursor: Cursor::None,
@ -1017,10 +1012,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
pipeline_ids.push(*pipeline_id);
}
}
let animation_state = if pipeline_ids.is_empty() &&
!self.webvr_heartbeats_racing() &&
!self.webxr_main_thread.running()
{
let animation_state = if pipeline_ids.is_empty() && !self.webxr_main_thread.running() {
windowing::AnimationState::Idle
} else {
windowing::AnimationState::Animating
@ -1031,10 +1023,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
}
}
fn webvr_heartbeats_racing(&self) -> bool {
self.webvr_heartbeats.iter().any(|hb| hb.heart_racing())
}
fn tick_animations_for_pipeline(&mut self, pipeline_id: PipelineId) {
let animation_callbacks_running = self
.pipeline_details(pipeline_id)
@ -1499,11 +1487,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
CompositionRequest::CompositeNow(_) => self.composite(),
}
// Send every VR display that wants one a main-thread heartbeat
for webvr_heartbeat in &mut self.webvr_heartbeats {
webvr_heartbeat.heartbeat();
}
// Run the WebXR main thread
self.webxr_main_thread.run_one_frame();

View file

@ -23,7 +23,6 @@ use style_traits::viewport::ViewportConstraints;
use style_traits::CSSPixel;
use webrender_api;
use webrender_api::units::{DeviceIntPoint, DeviceIntSize};
use webvr_traits::WebVRMainThreadHeartbeat;
/// Sends messages to the compositor.
pub struct CompositorProxy {
@ -167,7 +166,6 @@ pub struct InitialCompositorState {
pub webrender: webrender::Renderer,
pub webrender_document: webrender_api::DocumentId,
pub webrender_api: webrender_api::RenderApi,
pub webvr_heartbeats: Vec<Box<dyn WebVRMainThreadHeartbeat>>,
pub webxr_main_thread: webxr::MainThreadRegistry,
pub pending_wr_frame: Arc<AtomicBool>,
}

View file

@ -28,7 +28,6 @@ use servo_url::ServoUrl;
use std::collections::HashMap;
use std::fmt;
use std::time::Duration;
use webvr_traits::WebVREvent;
mod compositor;
pub mod compositor_thread;
@ -88,8 +87,6 @@ pub enum ConstellationMsg {
Reload(TopLevelBrowsingContextId),
/// A log entry, with the top-level browsing context id and thread name
LogEntry(Option<TopLevelBrowsingContextId>, Option<String>, LogEntry),
/// Dispatch WebVR events to the subscribed script threads.
WebVREvents(Vec<PipelineId>, Vec<WebVREvent>),
/// Create a new top level browsing context.
NewBrowser(ServoUrl, TopLevelBrowsingContextId),
/// Close a top level browsing context.
@ -132,7 +129,6 @@ impl fmt::Debug for ConstellationMsg {
WebDriverCommand(..) => "WebDriverCommand",
Reload(..) => "Reload",
LogEntry(..) => "LogEntry",
WebVREvents(..) => "WebVREvents",
NewBrowser(..) => "NewBrowser",
CloseBrowser(..) => "CloseBrowser",
SendError(..) => "SendError",

View file

@ -21,11 +21,9 @@ use std::rc::Rc;
use std::time::Duration;
use style_traits::DevicePixel;
use rust_webvr::VRServiceManager;
use webrender_api::units::DevicePoint;
use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
use webrender_api::ScrollLocation;
use webvr_traits::WebVRMainThreadHeartbeat;
#[derive(Clone)]
pub enum MouseWindowEvent {
@ -176,13 +174,6 @@ pub trait WindowMethods {
pub trait EmbedderMethods {
/// Returns a thread-safe object to wake up the window's event loop.
fn create_event_loop_waker(&mut self) -> Box<dyn EventLoopWaker>;
/// Register services with a VRServiceManager.
fn register_vr_services(
&mut self,
_: &mut VRServiceManager,
_: &mut Vec<Box<dyn WebVRMainThreadHeartbeat>>,
) {
}
/// Register services with a WebXR Registry.
fn register_webxr(