mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add comments and improve performance of a comparison
This commit is contained in:
parent
a9af374942
commit
1aed7a390e
1 changed files with 5 additions and 5 deletions
|
@ -50,9 +50,11 @@ pub fn run_compositor(compositor: &CompositorTask) {
|
|||
let mut window_size = Size2D(window_size.width as uint, window_size.height as uint);
|
||||
let mut done = false;
|
||||
let mut recomposite = false;
|
||||
let mut composite_ready = false;
|
||||
let graphics_context = CompositorTask::create_graphics_context();
|
||||
|
||||
// Tracks whether the renderer is idle and it's now safe to perform a composite
|
||||
let mut composite_ready = false;
|
||||
|
||||
// Keeps track of the current zoom factor
|
||||
let mut world_zoom = 1f32;
|
||||
let mut zoom_action = false;
|
||||
|
@ -86,10 +88,7 @@ pub fn run_compositor(compositor: &CompositorTask) {
|
|||
ChangeReadyState(ready_state) => window.set_ready_state(ready_state),
|
||||
ChangeRenderState(render_state) => {
|
||||
window.set_render_state(render_state);
|
||||
composite_ready = match render_state {
|
||||
IdleRenderState => true,
|
||||
_ => false,
|
||||
}
|
||||
composite_ready = render_state == IdleRenderState;
|
||||
}
|
||||
|
||||
SetUnRenderedColor(_id, color) => {
|
||||
|
@ -412,6 +411,7 @@ pub fn run_compositor(compositor: &CompositorTask) {
|
|||
// Check for messages coming from the windowing system.
|
||||
check_for_window_messages(window.recv());
|
||||
|
||||
// If asked to recomposite and renderer is in a safe/idle state
|
||||
if recomposite && composite_ready {
|
||||
recomposite = false;
|
||||
composite();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue