mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Rename get_buffer_requests to send_buffer_requests_recursively
This commit is contained in:
parent
512c986915
commit
4c0f8c8ac0
2 changed files with 13 additions and 12 deletions
|
@ -772,7 +772,8 @@ impl IOCompositor {
|
||||||
match self.scene.root {
|
match self.scene.root {
|
||||||
Some(ref mut layer) if !layer.extra_data.borrow().hidden => {
|
Some(ref mut layer) if !layer.extra_data.borrow().hidden => {
|
||||||
let rect = Rect(Point2D(0f32, 0f32), page_window.to_untyped());
|
let rect = Rect(Point2D(0f32, 0f32), page_window.to_untyped());
|
||||||
let recomposite = CompositorData::get_buffer_request(layer.clone(),
|
let recomposite =
|
||||||
|
CompositorData::send_buffer_requests_recursively(layer.clone(),
|
||||||
&self.graphics_context,
|
&self.graphics_context,
|
||||||
rect,
|
rect,
|
||||||
scale.get());
|
scale.get());
|
||||||
|
|
|
@ -338,11 +338,11 @@ impl CompositorData {
|
||||||
|
|
||||||
// Given the current window size, determine which tiles need to be (re-)rendered and sends them
|
// 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.
|
// off the the appropriate renderer. Returns true if and only if the scene should be repainted.
|
||||||
pub fn get_buffer_request(layer: Rc<Layer<CompositorData>>,
|
pub fn send_buffer_requests_recursively(layer: Rc<Layer<CompositorData>>,
|
||||||
graphics_context: &NativeCompositingGraphicsContext,
|
graphics_context: &NativeCompositingGraphicsContext,
|
||||||
window_rect: Rect<f32>,
|
window_rect: Rect<f32>,
|
||||||
scale: f32)
|
scale: f32)
|
||||||
-> bool {
|
-> bool {
|
||||||
let (request, unused) = Layer::get_tile_rects_page(layer.clone(), window_rect, scale);
|
let (request, unused) = Layer::get_tile_rects_page(layer.clone(), window_rect, scale);
|
||||||
let redisplay = !unused.is_empty();
|
let redisplay = !unused.is_empty();
|
||||||
if redisplay {
|
if redisplay {
|
||||||
|
@ -366,7 +366,7 @@ impl CompositorData {
|
||||||
CompositorData::build_layer_tree(layer.clone(), graphics_context);
|
CompositorData::build_layer_tree(layer.clone(), graphics_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
let get_child_buffer_request = |kid: &Rc<Layer<CompositorData>>| -> bool {
|
let send_child_buffer_request = |kid: &Rc<Layer<CompositorData>>| -> bool {
|
||||||
match kid.extra_data.borrow().scissor {
|
match kid.extra_data.borrow().scissor {
|
||||||
Some(scissor) => {
|
Some(scissor) => {
|
||||||
let mut new_rect = window_rect;
|
let mut new_rect = window_rect;
|
||||||
|
@ -380,10 +380,10 @@ impl CompositorData {
|
||||||
// to make the child_rect appear in coordinates local to it.
|
// to make the child_rect appear in coordinates local to it.
|
||||||
let child_rect = Rect(new_rect.origin.sub(&scissor.origin),
|
let child_rect = Rect(new_rect.origin.sub(&scissor.origin),
|
||||||
new_rect.size);
|
new_rect.size);
|
||||||
CompositorData::get_buffer_request(kid.clone(),
|
CompositorData::send_buffer_requests_recursively(kid.clone(),
|
||||||
graphics_context,
|
graphics_context,
|
||||||
child_rect,
|
child_rect,
|
||||||
scale)
|
scale)
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
false // Layer is offscreen
|
false // Layer is offscreen
|
||||||
|
@ -395,7 +395,7 @@ impl CompositorData {
|
||||||
};
|
};
|
||||||
|
|
||||||
layer.children().iter().filter(|x| !x.extra_data.borrow().hidden)
|
layer.children().iter().filter(|x| !x.extra_data.borrow().hidden)
|
||||||
.map(get_child_buffer_request)
|
.map(send_child_buffer_request)
|
||||||
.any(|b| b) || redisplay
|
.any(|b| b) || redisplay
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue