mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #13711 - glennw:remove-old-renderer, r=larsbergstrom
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 for now 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. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13711) <!-- Reviewable:end -->
This commit is contained in:
commit
f96718d03d
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue