Change retrieval of buffers from sublayers to both clip relative

to the scrolled position of its parent layer and to offset the
origin, since each layer assumes that its origin is 0,0.
This commit is contained in:
Lars Bergstrom 2013-09-17 17:40:56 -05:00
parent b77c3eaaa0
commit d6141edfd4

View file

@ -244,10 +244,15 @@ impl CompositorLayer {
let transform = |x: &mut CompositorLayerChild| -> bool { let transform = |x: &mut CompositorLayerChild| -> bool {
match x.container.scissor { match x.container.scissor {
Some(scissor) => { Some(scissor) => {
let new_rect = window_rect.intersection(&scissor); let new_rect = rect.intersection(&scissor);
match new_rect { match new_rect {
Some(new_rect) => { Some(new_rect) => {
x.child.get_buffer_request(new_rect, scale) // Child layers act as if they are rendered at (0,0), so we
// subtract the layer's (x,y) coords in its containing page
// to make the child_rect appear in coordinates local to it.
let child_rect = Rect(new_rect.origin.sub(&scissor.origin),
new_rect.size);
x.child.get_buffer_request(child_rect, scale)
} }
None => { None => {
false //Layer is offscreen false //Layer is offscreen