Invert control flow, fix resizing, and improve checkerboarding

significantly by giving tiles some time to paint before we render
unrendered content.
This commit is contained in:
Patrick Walton 2014-10-19 09:23:18 -07:00
parent e483a189a3
commit 10f7b49cf7
27 changed files with 1195 additions and 678 deletions

View file

@ -84,36 +84,36 @@ pub struct LayerMetadata {
/// The interface used by the renderer to acquire draw targets for each render frame and
/// submit them to be drawn to the display.
pub trait RenderListener {
fn get_graphics_metadata(&self) -> Option<NativeGraphicsMetadata>;
pub trait RenderListener for Sized? {
fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata>;
/// Informs the compositor of the layers for the given pipeline. The compositor responds by
/// creating and/or destroying render layers as necessary.
fn initialize_layers_for_pipeline(&self,
fn initialize_layers_for_pipeline(&mut self,
pipeline_id: PipelineId,
metadata: Vec<LayerMetadata>,
epoch: Epoch);
/// Sends new tiles for the given layer to the compositor.
fn paint(&self,
fn paint(&mut self,
pipeline_id: PipelineId,
epoch: Epoch,
replies: Vec<(LayerId, Box<LayerBufferSet>)>);
fn render_msg_discarded(&self);
fn set_render_state(&self, PipelineId, RenderState);
fn render_msg_discarded(&mut self);
fn set_render_state(&mut self, PipelineId, RenderState);
}
/// The interface used by the script task to tell the compositor to update its ready state,
/// which is used in displaying the appropriate message in the window's title.
pub trait ScriptListener : Clone {
fn set_ready_state(&self, PipelineId, ReadyState);
fn scroll_fragment_point(&self,
pub trait ScriptListener {
fn set_ready_state(&mut self, PipelineId, ReadyState);
fn scroll_fragment_point(&mut self,
pipeline_id: PipelineId,
layer_id: LayerId,
point: Point2D<f32>);
fn close(&self);
fn dup(&self) -> Box<ScriptListener+'static>;
fn close(&mut self);
fn dup(&mut self) -> Box<ScriptListener+'static>;
}
impl<E, S: Encoder<E>> Encodable<S, E> for Box<ScriptListener+'static> {

View file

@ -2,8 +2,8 @@
* 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/. */
//! The high-level interface from script to constellation. Using this abstract interface helps reduce
//! coupling between these two components
//! The high-level interface from script to constellation. Using this abstract interface helps
//! reduce coupling between these two components.
use geom::rect::Rect;
use geom::size::TypedSize2D;