frame-resize refactor

This commit is contained in:
Nikhil Shagrithaya 2017-01-14 22:00:07 +05:30
parent 04a3242dc5
commit bca565a1a3
6 changed files with 54 additions and 44 deletions

View file

@ -343,15 +343,13 @@ fn initialize_png(width: usize, height: usize) -> RenderTargetInfo {
struct RenderNotifier {
compositor_proxy: Box<CompositorProxy>,
constellation_chan: Sender<ConstellationMsg>,
}
impl RenderNotifier {
fn new(compositor_proxy: Box<CompositorProxy>,
constellation_chan: Sender<ConstellationMsg>) -> RenderNotifier {
_: Sender<ConstellationMsg>) -> RenderNotifier {
RenderNotifier {
compositor_proxy: compositor_proxy,
constellation_chan: constellation_chan,
}
}
}
@ -366,16 +364,8 @@ impl webrender_traits::RenderNotifier for RenderNotifier {
}
fn pipeline_size_changed(&mut self,
pipeline_id: webrender_traits::PipelineId,
size: Option<webrender_traits::LayoutSize>) {
let pipeline_id = pipeline_id.from_webrender();
if let Some(size) = size {
let msg = ConstellationMsg::FrameSize(pipeline_id, size.to_untyped());
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Compositor resize to constellation failed ({}).", e);
}
}
_: webrender_traits::PipelineId,
_: Option<webrender_traits::LayoutSize>) {
}
}