mirror of
https://github.com/servo/servo.git
synced 2025-06-18 22:34:30 +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
|
@ -5,7 +5,7 @@
|
|||
use canvas_traits::{Canvas2dMsg, CanvasCommonMsg, CanvasMsg};
|
||||
use canvas_traits::{CompositionOrBlending, FillOrStrokeStyle, FillRule};
|
||||
use canvas_traits::{LineCapStyle, LineJoinStyle, LinearGradientStyle};
|
||||
use canvas_traits::{RadialGradientStyle, RepetitionStyle, byte_swap, byte_swap_and_premultiply};
|
||||
use canvas_traits::{RadialGradientStyle, RepetitionStyle, byte_swap_and_premultiply};
|
||||
use cssparser::{Parser, RGBA};
|
||||
use cssparser::Color as CSSColor;
|
||||
use dom::bindings::cell::DOMRefCell;
|
||||
|
@ -47,7 +47,6 @@ use std::cell::Cell;
|
|||
use std::str::FromStr;
|
||||
use unpremultiplytable::UNPREMULTIPLY_TABLE;
|
||||
use url::Url;
|
||||
use util::opts;
|
||||
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
||||
|
@ -297,14 +296,7 @@ impl CanvasRenderingContext2D {
|
|||
Some((mut data, size)) => {
|
||||
// Pixels come from cache in BGRA order and drawImage expects RGBA so we
|
||||
// have to swap the color values
|
||||
if opts::get().use_webrender {
|
||||
// Webrender doesn't pre-multiply alpha when decoding
|
||||
// images, but canvas expects the images to be
|
||||
// pre-multiplied alpha.
|
||||
byte_swap_and_premultiply(&mut data);
|
||||
} else {
|
||||
byte_swap(&mut data);
|
||||
}
|
||||
byte_swap_and_premultiply(&mut data);
|
||||
let size = Size2D::new(size.width as f64, size.height as f64);
|
||||
(data, size)
|
||||
},
|
||||
|
|
|
@ -1220,42 +1220,20 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn scroll_offset_query(&self, node: &Node) -> Point2D<f32> {
|
||||
// WebRender always keeps the scroll offsets up to date and stored here in the window. So,
|
||||
// if WR is in use, all we need to do is to check our list of scroll offsets and return the
|
||||
// result.
|
||||
if opts::get().use_webrender {
|
||||
let mut node = Root::from_ref(node);
|
||||
loop {
|
||||
if let Some(scroll_offset) = self.scroll_offsets
|
||||
.borrow()
|
||||
.get(&node.to_untrusted_node_address()) {
|
||||
return *scroll_offset
|
||||
}
|
||||
node = match node.GetParentNode() {
|
||||
Some(node) => node,
|
||||
None => break,
|
||||
}
|
||||
let mut node = Root::from_ref(node);
|
||||
loop {
|
||||
if let Some(scroll_offset) = self.scroll_offsets
|
||||
.borrow()
|
||||
.get(&node.to_untrusted_node_address()) {
|
||||
return *scroll_offset
|
||||
}
|
||||
node = match node.GetParentNode() {
|
||||
Some(node) => node,
|
||||
None => break,
|
||||
}
|
||||
let offset = self.current_viewport.get().origin;
|
||||
return Point2D::new(offset.x.to_f32_px(), offset.y.to_f32_px())
|
||||
}
|
||||
|
||||
let node = node.to_trusted_node_address();
|
||||
if !self.reflow(ReflowGoal::ForScriptQuery,
|
||||
ReflowQueryType::NodeLayerIdQuery(node),
|
||||
ReflowReason::Query) {
|
||||
return Point2D::zero();
|
||||
}
|
||||
|
||||
let layer_id = self.layout_rpc.node_layer_id().layer_id;
|
||||
|
||||
let (send, recv) = ipc::channel::<Point2D<f32>>().unwrap();
|
||||
let global_scope = self.upcast::<GlobalScope>();
|
||||
global_scope
|
||||
.constellation_chan()
|
||||
.send(ConstellationMsg::GetScrollOffset(global_scope.pipeline_id(), layer_id, send))
|
||||
.unwrap();
|
||||
recv.recv().unwrap_or(Point2D::zero())
|
||||
let offset = self.current_viewport.get().origin;
|
||||
Point2D::new(offset.x.to_f32_px(), offset.y.to_f32_px())
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-scroll
|
||||
|
|
|
@ -1143,7 +1143,6 @@ impl ScriptThread {
|
|||
new_pipeline_id,
|
||||
frame_type,
|
||||
load_data,
|
||||
paint_chan,
|
||||
pipeline_port,
|
||||
layout_to_constellation_chan,
|
||||
content_process_shutdown_chan,
|
||||
|
@ -1160,7 +1159,6 @@ impl ScriptThread {
|
|||
layout_pair: layout_pair,
|
||||
pipeline_port: pipeline_port,
|
||||
constellation_chan: layout_to_constellation_chan,
|
||||
paint_chan: paint_chan,
|
||||
script_chan: self.control_chan.clone(),
|
||||
image_cache_thread: self.image_cache_thread.clone(),
|
||||
content_process_shutdown_chan: content_process_shutdown_chan,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue