Remove unused invalidate_rect code

This commit is contained in:
Matt Brubeck 2014-04-22 18:25:44 -07:00
parent c6bdc7b7f2
commit 46e5d5379f
5 changed files with 2 additions and 54 deletions

View file

@ -299,10 +299,6 @@ impl IOCompositor {
self.paint(pipeline_id, layer_id, new_layer_buffer_set, epoch);
}
(Data(InvalidateRect(pipeline_id, layer_id, rect)), false) => {
self.invalidate_rect(pipeline_id, layer_id, rect);
}
(Data(ScrollFragmentPoint(pipeline_id, layer_id, point)), false) => {
self.scroll_fragment_to_point(pipeline_id, layer_id, point);
}
@ -518,27 +514,6 @@ impl IOCompositor {
// it wishes.
}
fn invalidate_rect(&mut self, pipeline_id: PipelineId, layer_id: LayerId, rect: Rect<uint>) {
let ask: bool = match self.compositor_layer {
Some(ref mut layer) => {
let point = Point2D(rect.origin.x as f32,
rect.origin.y as f32);
let size = Size2D(rect.size.width as f32,
rect.size.height as f32);
layer.invalidate_rect(pipeline_id, layer_id, Rect(point, size));
true
}
None => {
// Nothing to do
false
}
};
if ask {
self.ask_for_tiles();
}
}
fn scroll_fragment_to_point(&mut self,
pipeline_id: PipelineId,
layer_id: LayerId,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use compositing::quadtree::{Quadtree, Normal, Invalid, Hidden};
use compositing::quadtree::{Quadtree, Normal, Hidden};
use pipeline::CompositionPipeline;
use windowing::{MouseWindowEvent, MouseWindowClickEvent, MouseWindowMouseDownEvent};
use windowing::{MouseWindowMouseUpEvent};
@ -891,26 +891,6 @@ impl CompositorLayer {
}
}
pub fn invalidate_rect(&mut self, pipeline_id: PipelineId, layer_id: LayerId, rect: Rect<f32>)
-> bool {
debug!("compositor_layer: starting invalidate_rect()");
if self.pipeline.id == pipeline_id && layer_id == self.id {
debug!("compositor_layer: layer found for invalidate_rect()");
let quadtree = match self.quadtree {
NoTree(..) => return true, // Nothing to do
Tree(ref mut quadtree) => quadtree,
};
quadtree.set_status_page(rect, Invalid, true);
true
} else {
// ID does not match ours, so recurse on descendents (including hidden children).
self.children
.mut_iter()
.map(|kid_holder| &mut kid_holder.child)
.any(|kid| kid.invalidate_rect(pipeline_id, layer_id, rect))
}
}
// Recursively sets occluded portions of quadtrees to Hidden, so that they do not ask for
// tile requests. If layers are moved, resized, or deleted, these portions may be updated.
fn set_occlusions(&mut self) {

View file

@ -45,10 +45,6 @@ impl ScriptListener for CompositorChan {
self.chan.send(msg);
}
fn invalidate_rect(&self, pipeline_id: PipelineId, layer_id: LayerId, rect: Rect<uint>) {
self.chan.send(InvalidateRect(pipeline_id, layer_id, rect));
}
fn scroll_fragment_point(&self,
pipeline_id: PipelineId,
layer_id: LayerId,
@ -179,8 +175,6 @@ pub enum Msg {
SetLayerClipRect(PipelineId, LayerId, Rect<f32>),
/// Alerts the compositor that the specified pipeline has been deleted.
DeleteLayerGroup(PipelineId),
/// Invalidate a rect for a given layer
InvalidateRect(PipelineId, LayerId, Rect<uint>),
/// Scroll a page in a window
ScrollFragmentPoint(PipelineId, LayerId, Point2D<f32>),
/// Requests that the compositor paint the given layer buffer set for the given page size.

View file

@ -79,7 +79,7 @@ impl NullCompositor {
CreateRootCompositorLayerIfNecessary(..) |
CreateDescendantCompositorLayerIfNecessary(..) | SetLayerPageSize(..) |
SetLayerClipRect(..) | DeleteLayerGroup(..) | Paint(..) | InvalidateRect(..) |
SetLayerClipRect(..) | DeleteLayerGroup(..) | Paint(..) |
ChangeReadyState(..) | ChangeRenderState(..) | ScrollFragmentPoint(..) |
SetUnRenderedColor(..) | LoadComplete(..) => ()
}

View file

@ -150,7 +150,6 @@ pub trait RenderListener {
/// which is used in displaying the appropriate message in the window's title.
pub trait ScriptListener : Clone {
fn set_ready_state(&self, ReadyState);
fn invalidate_rect(&self, pipeline_id: PipelineId, layer_id: LayerId, rect: Rect<uint>);
fn scroll_fragment_point(&self,
pipeline_id: PipelineId,
layer_id: LayerId,