mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Only clone the RenderChan once per Pipeline
This commit is contained in:
parent
a378f3e680
commit
0f21d6be12
2 changed files with 8 additions and 7 deletions
|
@ -752,8 +752,8 @@ impl IOCompositor {
|
|||
&self.graphics_context,
|
||||
rect,
|
||||
scale.get());
|
||||
for (_pipeline_id, requests) in request_map.move_iter() {
|
||||
for (chan, request) in requests.move_iter() {
|
||||
for (_pipeline_id, (chan, requests)) in request_map.move_iter() {
|
||||
for request in requests.move_iter() {
|
||||
let _ = chan.send_opt(ReRenderMsg(request));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,8 +122,8 @@ impl CompositorData {
|
|||
// Given the current window size, determine which tiles need to be (re-)rendered and sends them
|
||||
// off the the appropriate renderer. Returns true if and only if the scene should be repainted.
|
||||
pub fn get_buffer_requests_recursively(requests: &mut HashMap<PipelineId,
|
||||
Vec<(RenderChan,
|
||||
ReRenderRequest)>>,
|
||||
(RenderChan,
|
||||
Vec<ReRenderRequest>)>,
|
||||
layer: Rc<Layer<CompositorData>>,
|
||||
graphics_context: &NativeCompositingGraphicsContext,
|
||||
window_rect: Rect<f32>,
|
||||
|
@ -142,15 +142,16 @@ impl CompositorData {
|
|||
// FIXME(#2003, pcwalton): We may want to batch these up in the case in which
|
||||
// one page has multiple layers, to avoid the user seeing inconsistent states.
|
||||
let pipeline_id = layer.extra_data.borrow().pipeline.id;
|
||||
let chan = layer.extra_data.borrow().pipeline.render_chan.clone();
|
||||
let msg = ReRenderRequest {
|
||||
buffer_requests: request,
|
||||
scale: scale,
|
||||
layer_id: layer.extra_data.borrow().id,
|
||||
epoch: layer.extra_data.borrow().epoch,
|
||||
};
|
||||
let vec = requests.find_or_insert(pipeline_id, Vec::new());
|
||||
vec.push((chan, msg));
|
||||
let &(_, ref mut vec) = requests.find_or_insert_with(pipeline_id, |_| {
|
||||
(layer.extra_data.borrow().pipeline.render_chan.clone(), Vec::new())
|
||||
});
|
||||
vec.push(msg);
|
||||
}
|
||||
|
||||
if redisplay {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue