Auto merge of #18986 - glennw:update-wr-notifier, r=jdm

Update WR (render notifier API changes).

These changes fix #13480.

<!-- 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/18986)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-10-23 21:04:54 -05:00 committed by GitHub
commit 2bcb3b4ca9
23 changed files with 100 additions and 53 deletions

59
Cargo.lock generated
View file

@ -317,8 +317,8 @@ dependencies = [
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_config 0.0.1",
"webrender 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender 0.53.0 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -335,7 +335,7 @@ dependencies = [
"offscreen_gl_context 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_config 0.0.1",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -492,8 +492,8 @@ dependencies = [
"servo_url 0.0.1",
"style_traits 0.0.1",
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender 0.53.0 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -529,7 +529,7 @@ dependencies = [
"servo_remutex 0.0.1",
"servo_url 0.0.1",
"style_traits 0.0.1",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"webvr_traits 0.0.1",
]
@ -803,7 +803,7 @@ dependencies = [
"servo_geometry 0.0.1",
"servo_url 0.0.1",
"style_traits 0.0.1",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"x11 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1128,7 +1128,7 @@ dependencies = [
"truetype 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"xml5ever 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1209,7 +1209,7 @@ dependencies = [
"servo_url 0.0.1",
"style_traits 0.0.1",
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1553,7 +1553,7 @@ dependencies = [
"style_traits 0.0.1",
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1603,7 +1603,7 @@ dependencies = [
"servo_url 0.0.1",
"style 0.0.1",
"style_traits 0.0.1",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1618,7 +1618,7 @@ dependencies = [
"profile_traits 0.0.1",
"script_traits 0.0.1",
"servo_url 0.0.1",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1702,8 +1702,8 @@ dependencies = [
"style 0.0.1",
"style_traits 0.0.1",
"webdriver_server 0.0.1",
"webrender 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender 0.53.0 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"webvr 0.0.1",
"webvr_traits 0.0.1",
]
@ -1763,7 +1763,7 @@ dependencies = [
"smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"xml5ever 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1934,7 +1934,7 @@ dependencies = [
"malloc_size_of_derive 0.0.1",
"nonzero 0.0.1",
"serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1992,7 +1992,7 @@ dependencies = [
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -2049,7 +2049,7 @@ dependencies = [
"servo_url 0.0.1",
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -2674,7 +2674,7 @@ dependencies = [
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"utf-8 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"webvr_traits 0.0.1",
"xml5ever 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2707,7 +2707,7 @@ dependencies = [
"servo_atoms 0.0.1",
"servo_url 0.0.1",
"style 0.0.1",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -2751,7 +2751,7 @@ dependencies = [
"style_traits 0.0.1",
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
"webvr_traits 0.0.1",
]
@ -3250,7 +3250,7 @@ dependencies = [
"serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_arc 0.0.1",
"servo_atoms 0.0.1",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -3620,8 +3620,8 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.52.1"
source = "git+https://github.com/servo/webrender#37d531900bcb8e7c09c01759af12493abed8c0e3"
version = "0.53.0"
source = "git+https://github.com/servo/webrender#d741f472dd3d6c3441646f7bf4e714c71bea39b7"
dependencies = [
"app_units 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3643,13 +3643,13 @@ dependencies = [
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_profiler 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.52.1 (git+https://github.com/servo/webrender)",
"webrender_api 0.53.0 (git+https://github.com/servo/webrender)",
]
[[package]]
name = "webrender_api"
version = "0.52.1"
source = "git+https://github.com/servo/webrender#37d531900bcb8e7c09c01759af12493abed8c0e3"
version = "0.53.0"
source = "git+https://github.com/servo/webrender#d741f472dd3d6c3441646f7bf4e714c71bea39b7"
dependencies = [
"app_units 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3659,7 +3659,6 @@ dependencies = [
"core-graphics 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"dwrote 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
@ -4069,8 +4068,8 @@ dependencies = [
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"
"checksum webdriver 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d548aabf87411b1b4ba91fd07eacd8b238135c7131a452b8a9f6386209167e18"
"checksum webrender 0.52.1 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender_api 0.52.1 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender 0.53.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender_api 0.53.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum ws 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04614a58714f3fd4a8b1da4bcae9f031c532d35988c3d39627619248113f8be8"

View file

@ -5,7 +5,7 @@
use CompositionPipeline;
use SendableFrameTree;
use compositor_thread::{CompositorProxy, CompositorReceiver};
use compositor_thread::{InitialCompositorState, Msg, RenderListener};
use compositor_thread::{InitialCompositorState, Msg};
use euclid::{TypedPoint2D, TypedVector2D, ScaleFactor};
use gfx_traits::Epoch;
use gleam::gl;
@ -129,8 +129,6 @@ pub struct IOCompositor<Window: WindowMethods> {
/// The device pixel ratio for this window.
scale_factor: ScaleFactor<f32, DeviceIndependentPixel, DevicePixel>,
channel_to_self: CompositorProxy,
/// The type of composition to perform
composite_target: CompositeTarget,
@ -313,13 +311,13 @@ fn initialize_png(gl: &gl::Gl, width: usize, height: usize) -> RenderTargetInfo
}
}
struct RenderNotifier {
#[derive(Clone)]
pub struct RenderNotifier {
compositor_proxy: CompositorProxy,
}
impl RenderNotifier {
fn new(compositor_proxy: CompositorProxy,
_: Sender<ConstellationMsg>) -> RenderNotifier {
pub fn new(compositor_proxy: CompositorProxy) -> RenderNotifier {
RenderNotifier {
compositor_proxy: compositor_proxy,
}
@ -327,11 +325,15 @@ impl RenderNotifier {
}
impl webrender_api::RenderNotifier for RenderNotifier {
fn new_frame_ready(&mut self) {
fn clone(&self) -> Box<webrender_api::RenderNotifier> {
Box::new(RenderNotifier::new(self.compositor_proxy.clone()))
}
fn new_frame_ready(&self) {
self.compositor_proxy.recomposite(CompositingReason::NewWebRenderFrame);
}
fn new_scroll_frame_ready(&mut self, composite_needed: bool) {
fn new_scroll_frame_ready(&self, composite_needed: bool) {
self.compositor_proxy.send(Msg::NewScrollFrameReady(composite_needed));
}
}
@ -357,7 +359,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
window_rect: window_rect,
scale: ScaleFactor::new(1.0),
scale_factor: scale_factor,
channel_to_self: state.sender.clone(),
composition_request: CompositionRequest::NoCompositingNecessary,
touch_handler: TouchHandler::new(),
pending_scroll_zoom_events: Vec::new(),
@ -387,12 +388,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
pub fn create(window: Rc<Window>, state: InitialCompositorState) -> IOCompositor<Window> {
let mut compositor = IOCompositor::new(window, state);
let compositor_proxy_for_webrender = compositor.channel_to_self
.clone();
let render_notifier = RenderNotifier::new(compositor_proxy_for_webrender,
compositor.constellation_chan.clone());
compositor.webrender.set_render_notifier(Box::new(render_notifier));
// Set the size of the root layer.
compositor.update_zoom_transform();

View file

@ -107,12 +107,8 @@ impl CompositorReceiver {
}
}
pub trait RenderListener {
fn recomposite(&mut self, reason: CompositingReason);
}
impl RenderListener for CompositorProxy {
fn recomposite(&mut self, reason: CompositingReason) {
impl CompositorProxy {
pub fn recomposite(&self, reason: CompositingReason) {
self.send(Msg::Recomposite(reason));
}
}

View file

@ -27,6 +27,7 @@ extern crate webrender_api;
pub use compositor_thread::CompositorProxy;
pub use compositor::IOCompositor;
pub use compositor::RenderNotifier;
pub use compositor::ShutdownState;
use euclid::TypedSize2D;
use ipc_channel::ipc::IpcSender;

View file

@ -71,7 +71,7 @@ use bluetooth::BluetoothThreadFactory;
use bluetooth_traits::BluetoothRequest;
use canvas::gl_context::GLContextFactory;
use canvas::webgl_thread::WebGLThreads;
use compositing::{IOCompositor, ShutdownState};
use compositing::{IOCompositor, ShutdownState, RenderNotifier};
use compositing::compositor_thread::{self, CompositorProxy, CompositorReceiver, InitialCompositorState};
use compositing::compositor_thread::{EmbedderMsg, EmbedderProxy, EmbedderReceiver};
use compositing::windowing::WindowEvent;
@ -185,7 +185,9 @@ impl<Window> Servo<Window> where Window: WindowMethods + 'static {
let mut debug_flags = webrender::DebugFlags::empty();
debug_flags.set(webrender::DebugFlags::PROFILER_DBG, opts.webrender_stats);
webrender::Renderer::new(window.gl(), webrender::RendererOptions {
let render_notifier = Box::new(RenderNotifier::new(compositor_proxy.clone()));
webrender::Renderer::new(window.gl(), render_notifier, webrender::RendererOptions {
device_pixel_ratio: device_pixel_ratio,
resource_override_path: Some(resource_path),
enable_aa: opts.enable_text_antialiasing,

View file

@ -0,0 +1,3 @@
[border-left-applies-to-001.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-applies-to-002.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-applies-to-003.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-color-applies-to-001.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-color-applies-to-002.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-color-applies-to-003.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-width-applies-to-001.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-width-applies-to-002.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-left-width-applies-to-003.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-applies-to-001.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-applies-to-002.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-applies-to-003.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-color-applies-to-001.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-color-applies-to-002.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-color-applies-to-003.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-width-applies-to-001.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-width-applies-to-002.htm]
type: reftest
expected: FAIL

View file

@ -0,0 +1,3 @@
[border-top-width-applies-to-003.htm]
type: reftest
expected: FAIL