Rename RenderState -> PaintState

This commit is contained in:
Tetsuharu OHZEKI 2014-12-08 13:28:13 +09:00
parent b5f73fb179
commit 806b6f09c9
8 changed files with 49 additions and 49 deletions

View file

@ -39,8 +39,8 @@ use png;
use gleam::gl::types::{GLint, GLsizei};
use gleam::gl;
use script_traits::{ViewportMsg, ScriptControlChan};
use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdleRenderState, LayerId};
use servo_msg::compositor_msg::{ReadyState, RenderingRenderState, RenderState, Scrollable};
use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdlePaintState, LayerId};
use servo_msg::compositor_msg::{ReadyState, PaintingPaintState, PaintState, Scrollable};
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, LoadUrlMsg};
use servo_msg::constellation_msg::{NavigateMsg, LoadData, PipelineId, ResizedWindowMsg};
use servo_msg::constellation_msg::{WindowSizeData, KeyState, Key, KeyModifiers};
@ -112,8 +112,8 @@ pub struct IOCompositor<Window: WindowMethods> {
/// Current display/reflow status of each pipeline.
ready_states: HashMap<PipelineId, ReadyState>,
/// Current render status of each pipeline.
render_states: HashMap<PipelineId, RenderState>,
/// Current paint status of each pipeline.
render_states: HashMap<PipelineId, PaintState>,
/// Whether the page being rendered has loaded completely.
/// Differs from ReadyState because we can finish loading (ready)
@ -358,7 +358,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
fn change_render_state(&mut self, pipeline_id: PipelineId, render_state: RenderState) {
fn change_render_state(&mut self, pipeline_id: PipelineId, render_state: PaintState) {
match self.render_states.entry(pipeline_id) {
Occupied(entry) => {
*entry.into_mut() = render_state;
@ -375,7 +375,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
if self.ready_states.len() == 0 {
return false;
}
return self.render_states.values().all(|&value| value == IdleRenderState);
return self.render_states.values().all(|&value| value == IdlePaintState);
}
fn has_render_msg_tracking(&self) -> bool {
@ -435,9 +435,9 @@ impl<Window: WindowMethods> IOCompositor<Window> {
frame_tree: &SendableFrameTree,
frame_rect: Option<TypedRect<PagePx, f32>>)
-> Rc<Layer<CompositorData>> {
// Initialize the ReadyState and RenderState for this pipeline.
// Initialize the ReadyState and PaintState for this pipeline.
self.ready_states.insert(frame_tree.pipeline.id, Blank);
self.render_states.insert(frame_tree.pipeline.id, RenderingRenderState);
self.render_states.insert(frame_tree.pipeline.id, PaintingPaintState);
let root_layer = create_root_layer_for_pipeline_and_rect(&frame_tree.pipeline, frame_rect);
for kid in frame_tree.children.iter() {

View file

@ -18,7 +18,7 @@ use geom::size::Size2D;
use layers::platform::surface::{NativeCompositingGraphicsContext, NativeGraphicsMetadata};
use layers::layers::LayerBufferSet;
use servo_msg::compositor_msg::{Epoch, LayerId, LayerMetadata, ReadyState};
use servo_msg::compositor_msg::{PaintListener, RenderState, ScriptListener, ScrollPolicy};
use servo_msg::compositor_msg::{PaintListener, PaintState, ScriptListener, ScrollPolicy};
use servo_msg::constellation_msg::{ConstellationChan, PipelineId};
use servo_util::memory::MemoryProfilerChan;
use servo_util::time::TimeProfilerChan;
@ -146,8 +146,8 @@ impl PaintListener for Box<CompositorProxy+'static+Send> {
self.send(PaintMsgDiscarded);
}
fn set_paint_state(&mut self, pipeline_id: PipelineId, render_state: RenderState) {
self.send(ChangePaintState(pipeline_id, render_state))
fn set_paint_state(&mut self, pipeline_id: PipelineId, paint_state: PaintState) {
self.send(ChangePaintState(pipeline_id, paint_state))
}
}
@ -182,8 +182,8 @@ pub enum Msg {
Paint(PipelineId, Epoch, Vec<(LayerId, Box<LayerBufferSet>)>),
/// Alerts the compositor to the current status of page loading.
ChangeReadyState(PipelineId, ReadyState),
/// Alerts the compositor to the current status of rendering.
ChangePaintState(PipelineId, RenderState),
/// Alerts the compositor to the current status of painting.
ChangePaintState(PipelineId, PaintState),
/// Alerts the compositor that the RenderMsg has been discarded.
PaintMsgDiscarded,
/// Sets the channel to the current layout and render tasks, along with their id

View file

@ -12,7 +12,7 @@ use geom::size::TypedSize2D;
use layers::geometry::DevicePixel;
use layers::platform::surface::NativeGraphicsMetadata;
use servo_msg::constellation_msg::{Key, KeyState, KeyModifiers};
use servo_msg::compositor_msg::{ReadyState, RenderState};
use servo_msg::compositor_msg::{ReadyState, PaintState};
use servo_util::geometry::ScreenPx;
use std::fmt::{FormatError, Formatter, Show};
use std::rc::Rc;
@ -90,8 +90,8 @@ pub trait WindowMethods {
/// Sets the ready state of the current page.
fn set_ready_state(&self, ready_state: ReadyState);
/// Sets the render state of the current page.
fn set_render_state(&self, render_state: RenderState);
/// Sets the paint state of the current page.
fn set_render_state(&self, paint_state: PaintState);
/// Returns the hidpi factor of the monitor.
fn hidpi_factor(&self) -> ScaleFactor<ScreenPx, DevicePixel, f32>;