mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use more iterators in compositing component
This commit is contained in:
parent
acc0bf6873
commit
649e50f15c
2 changed files with 8 additions and 8 deletions
|
@ -2011,13 +2011,11 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn cache_unused_buffers(&mut self, buffers: Vec<Box<LayerBuffer>>) {
|
||||
if !buffers.is_empty() {
|
||||
let surfaces = buffers.into_iter().map(|buffer| {
|
||||
buffer.native_surface
|
||||
}).collect();
|
||||
self.surface_map.insert_surfaces(&self.native_display, surfaces);
|
||||
}
|
||||
pub fn cache_unused_buffers<B>(&mut self, buffers: B)
|
||||
where B: IntoIterator<Item=Box<LayerBuffer>>
|
||||
{
|
||||
let surfaces = buffers.into_iter().map(|buffer| buffer.native_surface);
|
||||
self.surface_map.insert_surfaces(&self.native_display, surfaces);
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue