mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Remove old rendering backend.
This removes paint threads, rust-layers dependency, and changes optional webrender types to be required. The use_webrender option has been removed, however I've left the "-w" command line option in place so that wpt runner can continue to pass that. Once it's removed from there we can also remove the -w option. Once this stage is complete, it should be fine to change the display list building code to generate webrender display lists directly and avoid the conversion step.
This commit is contained in:
parent
4af21e3ae1
commit
acfdfd2fa9
55 changed files with 422 additions and 3611 deletions
40
ports/cef/Cargo.lock
generated
40
ports/cef/Cargo.lock
generated
|
@ -6,9 +6,9 @@ dependencies = [
|
|||
"compositing 0.0.1",
|
||||
"devtools 0.0.1",
|
||||
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"gleam 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glutin_app 0.0.1",
|
||||
"layers 0.5.3 (git+https://github.com/servo/rust-layers)",
|
||||
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
|
@ -278,14 +278,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "compositing"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"azure 0.9.0 (git+https://github.com/servo/rust-azure)",
|
||||
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"gleam 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layers 0.5.3 (git+https://github.com/servo/rust-layers)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"net_traits 0.0.1",
|
||||
|
@ -316,7 +313,6 @@ dependencies = [
|
|||
"gfx 0.0.1",
|
||||
"gfx_traits 0.0.1",
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layers 0.5.3 (git+https://github.com/servo/rust-layers)",
|
||||
"layout_traits 0.0.1",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
|
@ -713,7 +709,6 @@ dependencies = [
|
|||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_plugin 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layers 0.5.3 (git+https://github.com/servo/rust-layers)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -722,8 +717,6 @@ dependencies = [
|
|||
"net_traits 0.0.1",
|
||||
"ordered-float 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"plugins 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"range 0.0.1",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -748,13 +741,9 @@ name = "gfx_traits"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"azure 0.9.0 (git+https://github.com/servo/rust-azure)",
|
||||
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_plugin 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layers 0.5.3 (git+https://github.com/servo/rust-layers)",
|
||||
"msg 0.0.1",
|
||||
"plugins 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"range 0.0.1",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -801,8 +790,8 @@ dependencies = [
|
|||
"compositing 0.0.1",
|
||||
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"gleam 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layers 0.5.3 (git+https://github.com/servo/rust-layers)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"net_traits 0.0.1",
|
||||
|
@ -1048,26 +1037,6 @@ name = "language-tags"
|
|||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "layers"
|
||||
version = "0.5.3"
|
||||
source = "git+https://github.com/servo/rust-layers#b064de859b2cf3f4e07b29ee11a34543f1671ac0"
|
||||
dependencies = [
|
||||
"cgl 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glx 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"io-surface 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo-skia 0.20130412.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"x11 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "layout"
|
||||
version = "0.0.1"
|
||||
|
@ -1151,7 +1120,6 @@ dependencies = [
|
|||
"profile_traits 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"util 0.0.1",
|
||||
"webrender_traits 0.6.0 (git+https://github.com/servo/webrender)",
|
||||
]
|
||||
|
||||
|
@ -1901,7 +1869,6 @@ dependencies = [
|
|||
"string_cache 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"style 0.0.1",
|
||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"util 0.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1918,7 +1885,6 @@ dependencies = [
|
|||
"heapsize_plugin 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layers 0.5.3 (git+https://github.com/servo/rust-layers)",
|
||||
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"net_traits 0.0.1",
|
||||
|
@ -1931,7 +1897,6 @@ dependencies = [
|
|||
"style_traits 0.0.1",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"util 0.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2769,7 +2734,6 @@ dependencies = [
|
|||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
||||
"checksum khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "09c9d3760673c427d46f91a0350f0a84a52e6bc5a84adf26dc610b6c52436630"
|
||||
"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
|
||||
"checksum layers 0.5.3 (git+https://github.com/servo/rust-layers)" = "<none>"
|
||||
"checksum lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417"
|
||||
"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f"
|
||||
"checksum leak 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bd100e01f1154f2908dfa7d02219aeab25d0b9c7fa955164192e3245255a0c73"
|
||||
|
|
|
@ -18,9 +18,9 @@ opt-level = 3
|
|||
compositing = {path = "../../components/compositing"}
|
||||
devtools = {path = "../../components/devtools"}
|
||||
euclid = "0.10.1"
|
||||
gfx_traits = {path = "../../components/gfx_traits"}
|
||||
gleam = "0.2.8"
|
||||
glutin_app = {path = "../glutin"}
|
||||
layers = {git = "https://github.com/servo/rust-layers"}
|
||||
libc = "0.2"
|
||||
log = {version = "0.3.5", features = ["release_max_level_info"]}
|
||||
msg = {path = "../../components/msg"}
|
||||
|
|
|
@ -19,9 +19,9 @@ extern crate servo;
|
|||
extern crate compositing;
|
||||
|
||||
extern crate euclid;
|
||||
extern crate gfx_traits;
|
||||
extern crate gleam;
|
||||
extern crate glutin_app;
|
||||
extern crate layers;
|
||||
extern crate rustc_unicode;
|
||||
extern crate script_traits;
|
||||
|
||||
|
|
|
@ -23,9 +23,8 @@ use compositing::windowing::{WindowEvent, WindowMethods};
|
|||
use euclid::point::Point2D;
|
||||
use euclid::scale_factor::ScaleFactor;
|
||||
use euclid::size::{Size2D, TypedSize2D};
|
||||
use gfx_traits::DevicePixel;
|
||||
use gleam::gl;
|
||||
use layers::geometry::DevicePixel;
|
||||
use layers::platform::surface::NativeDisplay;
|
||||
use msg::constellation_msg::{Key, KeyModifiers};
|
||||
use net_traits::net_error_list::NetError;
|
||||
use std::cell::RefCell;
|
||||
|
@ -284,19 +283,6 @@ impl WindowMethods for Window {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
fn native_display(&self) -> NativeDisplay {
|
||||
use x11::xlib;
|
||||
unsafe {
|
||||
NativeDisplay::new(DISPLAY as *mut xlib::Display)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="linux"))]
|
||||
fn native_display(&self) -> NativeDisplay {
|
||||
NativeDisplay::new()
|
||||
}
|
||||
|
||||
fn create_compositor_channel(&self)
|
||||
-> (Box<CompositorProxy+Send>, Box<CompositorReceiver>) {
|
||||
let (sender, receiver) = channel();
|
||||
|
|
|
@ -12,8 +12,8 @@ path = "lib.rs"
|
|||
bitflags = "0.7"
|
||||
compositing = {path = "../../components/compositing"}
|
||||
euclid = "0.10.1"
|
||||
gfx_traits = {path = "../../components/gfx_traits"}
|
||||
gleam = "0.2.8"
|
||||
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
|
||||
log = "0.3.5"
|
||||
msg = {path = "../../components/msg"}
|
||||
net_traits = {path = "../../components/net_traits"}
|
||||
|
|
|
@ -11,9 +11,9 @@ extern crate compositing;
|
|||
#[allow(unused_extern_crates)]
|
||||
#[cfg(target_os = "android")] extern crate egl;
|
||||
extern crate euclid;
|
||||
extern crate gfx_traits;
|
||||
extern crate gleam;
|
||||
extern crate glutin;
|
||||
extern crate layers;
|
||||
#[macro_use] extern crate log;
|
||||
extern crate msg;
|
||||
extern crate net_traits;
|
||||
|
@ -22,7 +22,6 @@ extern crate script_traits;
|
|||
extern crate style_traits;
|
||||
extern crate url;
|
||||
extern crate util;
|
||||
#[cfg(target_os = "linux")] extern crate x11;
|
||||
#[cfg(target_os = "windows")] extern crate winapi;
|
||||
#[cfg(target_os = "windows")] extern crate user32;
|
||||
#[cfg(target_os = "windows")] extern crate gdi32;
|
||||
|
|
|
@ -13,14 +13,13 @@ use euclid::scale_factor::ScaleFactor;
|
|||
use euclid::size::TypedSize2D;
|
||||
#[cfg(target_os = "windows")]
|
||||
use gdi32;
|
||||
use gfx_traits::DevicePixel;
|
||||
use gleam::gl;
|
||||
use glutin;
|
||||
use glutin::{Api, ElementState, Event, GlRequest, MouseButton, MouseScrollDelta, VirtualKeyCode};
|
||||
use glutin::{ScanCode, TouchPhase};
|
||||
#[cfg(target_os = "macos")]
|
||||
use glutin::os::macos::{ActivationPolicy, WindowBuilderExt};
|
||||
use layers::geometry::DevicePixel;
|
||||
use layers::platform::surface::NativeDisplay;
|
||||
use msg::constellation_msg::{self, Key};
|
||||
use msg::constellation_msg::{ALT, CONTROL, KeyState, NONE, SHIFT, SUPER};
|
||||
use net_traits::net_error_list::NetError;
|
||||
|
@ -42,8 +41,6 @@ use url::Url;
|
|||
use user32;
|
||||
use util::geometry::ScreenPx;
|
||||
use util::opts;
|
||||
#[cfg(not(target_os = "android"))]
|
||||
use util::opts::RenderApi;
|
||||
use util::prefs::PREFS;
|
||||
use util::resource_files;
|
||||
#[cfg(target_os = "windows")]
|
||||
|
@ -318,17 +315,7 @@ impl Window {
|
|||
|
||||
#[cfg(not(any(target_arch = "arm", target_arch = "aarch64")))]
|
||||
fn gl_version() -> GlRequest {
|
||||
if opts::get().use_webrender {
|
||||
return GlRequest::Specific(Api::OpenGl, (3, 2));
|
||||
}
|
||||
match opts::get().render_api {
|
||||
RenderApi::GL => {
|
||||
GlRequest::Specific(Api::OpenGl, (2, 1))
|
||||
}
|
||||
RenderApi::ES2 => {
|
||||
GlRequest::Specific(Api::OpenGlEs, (2, 0))
|
||||
}
|
||||
}
|
||||
return GlRequest::Specific(Api::OpenGl, (3, 2));
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
|
||||
|
@ -558,72 +545,28 @@ impl Window {
|
|||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
fn handle_next_event(&self) -> bool {
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
// WebRender can use the normal blocking event check and proper vsync,
|
||||
// because it doesn't call X11 functions from another thread, so doesn't
|
||||
// hit the same issues explained below.
|
||||
if opts::get().use_webrender {
|
||||
match self.kind {
|
||||
WindowKind::Window(ref window) => {
|
||||
let event = match window.wait_events().next() {
|
||||
None => {
|
||||
warn!("Window event stream closed.");
|
||||
return false;
|
||||
},
|
||||
Some(event) => event,
|
||||
};
|
||||
let mut close = self.handle_window_event(event);
|
||||
if !close {
|
||||
while let Some(event) = window.poll_events().next() {
|
||||
if self.handle_window_event(event) {
|
||||
close = true;
|
||||
break
|
||||
}
|
||||
match self.kind {
|
||||
WindowKind::Window(ref window) => {
|
||||
let event = match window.wait_events().next() {
|
||||
None => {
|
||||
warn!("Window event stream closed.");
|
||||
return false;
|
||||
},
|
||||
Some(event) => event,
|
||||
};
|
||||
let mut close = self.handle_window_event(event);
|
||||
if !close {
|
||||
while let Some(event) = window.poll_events().next() {
|
||||
if self.handle_window_event(event) {
|
||||
close = true;
|
||||
break
|
||||
}
|
||||
}
|
||||
close
|
||||
}
|
||||
WindowKind::Headless(..) => {
|
||||
false
|
||||
}
|
||||
close
|
||||
}
|
||||
} else {
|
||||
// TODO(gw): This is an awful hack to work around the
|
||||
// broken way we currently call X11 from multiple threads.
|
||||
//
|
||||
// On some (most?) X11 implementations, blocking here
|
||||
// with XPeekEvent results in the paint thread getting stuck
|
||||
// in XGetGeometry randomly. When this happens the result
|
||||
// is that until you trigger the XPeekEvent to return
|
||||
// (by moving the mouse over the window) the paint thread
|
||||
// never completes and you don't see the most recent
|
||||
// results.
|
||||
//
|
||||
// For now, poll events and sleep for ~1 frame if there
|
||||
// are no events. This means we don't spin the CPU at
|
||||
// 100% usage, but is far from ideal!
|
||||
//
|
||||
// See https://github.com/servo/servo/issues/5780
|
||||
//
|
||||
match self.kind {
|
||||
WindowKind::Window(ref window) => {
|
||||
let first_event = window.poll_events().next();
|
||||
|
||||
match first_event {
|
||||
Some(event) => {
|
||||
self.handle_window_event(event)
|
||||
}
|
||||
None => {
|
||||
thread::sleep(Duration::from_millis(16));
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
WindowKind::Headless(..) => {
|
||||
false
|
||||
}
|
||||
WindowKind::Headless(..) => {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1031,33 +974,6 @@ impl WindowMethods for Window {
|
|||
true
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn native_display(&self) -> NativeDisplay {
|
||||
use x11::xlib;
|
||||
unsafe {
|
||||
match opts::get().render_api {
|
||||
RenderApi::GL => {
|
||||
match self.kind {
|
||||
WindowKind::Window(ref window) => {
|
||||
NativeDisplay::new(window.platform_display() as *mut xlib::Display)
|
||||
}
|
||||
WindowKind::Headless(..) => {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
},
|
||||
RenderApi::ES2 => {
|
||||
NativeDisplay::new_egl_display()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
fn native_display(&self) -> NativeDisplay {
|
||||
NativeDisplay::new()
|
||||
}
|
||||
|
||||
/// Helper function to handle keyboard events.
|
||||
fn handle_key(&self, ch: Option<char>, key: Key, mods: constellation_msg::KeyModifiers) {
|
||||
match (mods, ch, key) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue