Rename RenderListener -> PaintListener, and its methods.

This commit is contained in:
Tetsuharu OHZEKI 2014-12-08 11:58:57 +09:00
parent 94071f6330
commit b5f73fb179
3 changed files with 14 additions and 14 deletions

View file

@ -18,7 +18,7 @@ use geom::size::Size2D;
use layers::platform::surface::{NativeCompositingGraphicsContext, NativeGraphicsMetadata}; use layers::platform::surface::{NativeCompositingGraphicsContext, NativeGraphicsMetadata};
use layers::layers::LayerBufferSet; use layers::layers::LayerBufferSet;
use servo_msg::compositor_msg::{Epoch, LayerId, LayerMetadata, ReadyState}; use servo_msg::compositor_msg::{Epoch, LayerId, LayerMetadata, ReadyState};
use servo_msg::compositor_msg::{RenderListener, RenderState, ScriptListener, ScrollPolicy}; use servo_msg::compositor_msg::{PaintListener, RenderState, ScriptListener, ScrollPolicy};
use servo_msg::constellation_msg::{ConstellationChan, PipelineId}; use servo_msg::constellation_msg::{ConstellationChan, PipelineId};
use servo_util::memory::MemoryProfilerChan; use servo_util::memory::MemoryProfilerChan;
use servo_util::time::TimeProfilerChan; use servo_util::time::TimeProfilerChan;
@ -108,8 +108,8 @@ impl LayerProperties {
} }
} }
/// Implementation of the abstract `RenderListener` interface. /// Implementation of the abstract `PaintListener` interface.
impl RenderListener for Box<CompositorProxy+'static+Send> { impl PaintListener for Box<CompositorProxy+'static+Send> {
fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata> { fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata> {
let (chan, port) = channel(); let (chan, port) = channel();
self.send(GetGraphicsMetadata(chan)); self.send(GetGraphicsMetadata(chan));
@ -142,11 +142,11 @@ impl RenderListener for Box<CompositorProxy+'static+Send> {
} }
} }
fn render_msg_discarded(&mut self) { fn paint_msg_discarded(&mut self) {
self.send(PaintMsgDiscarded); self.send(PaintMsgDiscarded);
} }
fn set_render_state(&mut self, pipeline_id: PipelineId, render_state: RenderState) { fn set_paint_state(&mut self, pipeline_id: PipelineId, render_state: RenderState) {
self.send(ChangePaintState(pipeline_id, render_state)) self.send(ChangePaintState(pipeline_id, render_state))
} }
} }

View file

@ -22,7 +22,7 @@ use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
use layers; use layers;
use native::task::NativeTaskBuilder; use native::task::NativeTaskBuilder;
use servo_msg::compositor_msg::{Epoch, IdleRenderState, LayerId}; use servo_msg::compositor_msg::{Epoch, IdleRenderState, LayerId};
use servo_msg::compositor_msg::{LayerMetadata, RenderListener, RenderingRenderState, ScrollPolicy}; use servo_msg::compositor_msg::{LayerMetadata, PaintListener, RenderingRenderState, ScrollPolicy};
use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineId}; use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineId};
use servo_msg::constellation_msg::{RendererReadyMsg}; use servo_msg::constellation_msg::{RendererReadyMsg};
use servo_msg::platform::surface::NativeSurfaceAzureMethods; use servo_msg::platform::surface::NativeSurfaceAzureMethods;
@ -136,7 +136,7 @@ fn initialize_layers<C>(compositor: &mut C,
pipeline_id: PipelineId, pipeline_id: PipelineId,
epoch: Epoch, epoch: Epoch,
root_stacking_context: &StackingContext) root_stacking_context: &StackingContext)
where C: RenderListener { where C: PaintListener {
let mut metadata = Vec::new(); let mut metadata = Vec::new();
build(&mut metadata, root_stacking_context, &ZERO_POINT); build(&mut metadata, root_stacking_context, &ZERO_POINT);
compositor.initialize_layers_for_pipeline(pipeline_id, metadata, epoch); compositor.initialize_layers_for_pipeline(pipeline_id, metadata, epoch);
@ -167,7 +167,7 @@ fn initialize_layers<C>(compositor: &mut C,
} }
} }
impl<C> PaintTask<C> where C: RenderListener + Send { impl<C> PaintTask<C> where C: PaintListener + Send {
pub fn create(id: PipelineId, pub fn create(id: PipelineId,
port: Receiver<Msg>, port: Receiver<Msg>,
compositor: C, compositor: C,
@ -248,12 +248,12 @@ impl<C> PaintTask<C> where C: RenderListener + Send {
debug!("paint_task: render ready msg"); debug!("paint_task: render ready msg");
let ConstellationChan(ref mut c) = self.constellation_chan; let ConstellationChan(ref mut c) = self.constellation_chan;
c.send(RendererReadyMsg(self.id)); c.send(RendererReadyMsg(self.id));
self.compositor.render_msg_discarded(); self.compositor.paint_msg_discarded();
continue; continue;
} }
let mut replies = Vec::new(); let mut replies = Vec::new();
self.compositor.set_render_state(self.id, RenderingRenderState); self.compositor.set_paint_state(self.id, RenderingRenderState);
for PaintRequest { buffer_requests, scale, layer_id, epoch } for PaintRequest { buffer_requests, scale, layer_id, epoch }
in requests.into_iter() { in requests.into_iter() {
if self.epoch == epoch { if self.epoch == epoch {
@ -263,7 +263,7 @@ impl<C> PaintTask<C> where C: RenderListener + Send {
} }
} }
self.compositor.set_render_state(self.id, IdleRenderState); self.compositor.set_paint_state(self.id, IdleRenderState);
debug!("paint_task: returning surfaces"); debug!("paint_task: returning surfaces");
self.compositor.paint(self.id, self.epoch, replies); self.compositor.paint(self.id, self.epoch, replies);

View file

@ -83,7 +83,7 @@ pub struct LayerMetadata {
/// The interface used by the renderer to acquire draw targets for each render frame and /// The interface used by the renderer to acquire draw targets for each render frame and
/// submit them to be drawn to the display. /// submit them to be drawn to the display.
pub trait RenderListener for Sized? { pub trait PaintListener for Sized? {
fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata>; fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata>;
/// Informs the compositor of the layers for the given pipeline. The compositor responds by /// Informs the compositor of the layers for the given pipeline. The compositor responds by
@ -99,8 +99,8 @@ pub trait RenderListener for Sized? {
epoch: Epoch, epoch: Epoch,
replies: Vec<(LayerId, Box<LayerBufferSet>)>); replies: Vec<(LayerId, Box<LayerBufferSet>)>);
fn render_msg_discarded(&mut self); fn paint_msg_discarded(&mut self);
fn set_render_state(&mut self, PipelineId, RenderState); fn set_paint_state(&mut self, PipelineId, RenderState);
} }
/// The interface used by the script task to tell the compositor to update its ready state, /// The interface used by the script task to tell the compositor to update its ready state,