aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/canvasrenderingcontext2d.rs12
-rw-r--r--components/script/dom/window.rs46
-rw-r--r--components/script/script_thread.rs2
3 files changed, 14 insertions, 46 deletions
diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs
index 5ddf6cda2ea..5b36249be59 100644
--- a/components/script/dom/canvasrenderingcontext2d.rs
+++ b/components/script/dom/canvasrenderingcontext2d.rs
@@ -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)
},
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 9a836b6d845..5ee70b8b068 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -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
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 335e65f2abf..73a3d1458d8 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -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,