Auto merge of #17068 - gterzian:remove_compositorproxy, r=asajeffrey

Separate waking the event loop, from communicating with Compositor

<!-- Please describe your changes on the following line: -->

@paulrouget first step of #15934, Glutin only for now, please take a look...

If this makes sense, I will also update the code for ports other than Glutin...

One question: one do I add the `warn!` macro to `servolib`? Also perhaps we would also want to add `box`, since I had to switch to using `Box::new`...

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/17068)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-07 05:52:35 -07:00 committed by GitHub
commit 7e273d6c9b
9 changed files with 103 additions and 108 deletions

View file

@ -103,7 +103,7 @@ pub struct IOCompositor<Window: WindowMethods> {
window: Rc<Window>,
/// The port on which we receive messages.
port: Box<CompositorReceiver>,
port: CompositorReceiver,
/// The root pipeline.
root_pipeline: Option<CompositionPipeline>,
@ -133,7 +133,7 @@ pub struct IOCompositor<Window: WindowMethods> {
/// The device pixel ratio for this window.
scale_factor: ScaleFactor<f32, DeviceIndependentPixel, DevicePixel>,
channel_to_self: Box<CompositorProxy + Send>,
channel_to_self: CompositorProxy,
/// A handle to the delayed composition timer.
delayed_composition_timer: DelayedCompositionTimerProxy,
@ -312,11 +312,11 @@ fn initialize_png(gl: &gl::Gl, width: usize, height: usize) -> RenderTargetInfo
}
struct RenderNotifier {
compositor_proxy: Box<CompositorProxy>,
compositor_proxy: CompositorProxy,
}
impl RenderNotifier {
fn new(compositor_proxy: Box<CompositorProxy>,
fn new(compositor_proxy: CompositorProxy,
_: Sender<ConstellationMsg>) -> RenderNotifier {
RenderNotifier {
compositor_proxy: compositor_proxy,
@ -336,7 +336,7 @@ impl webrender_traits::RenderNotifier for RenderNotifier {
// Used to dispatch functions from webrender to the main thread's event loop.
struct CompositorThreadDispatcher {
compositor_proxy: Box<CompositorProxy>
compositor_proxy: CompositorProxy
}
impl webrender_traits::RenderDispatcher for CompositorThreadDispatcher {