From 138081ba25c47d5b9afd08e6e5d0d2aed045971a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 4 Jan 2015 11:36:47 +0100 Subject: [PATCH] Rename the PaintState variants. --- components/compositing/compositor.rs | 8 ++++---- components/gfx/paint_task.rs | 8 ++++---- components/msg/compositor_msg.rs | 4 ++-- ports/glfw/window.rs | 10 +++++----- ports/glutin/window.rs | 10 +++++----- ports/gonk/src/window.rs | 5 ++--- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 62ae9b10086..bec2d3a009c 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -29,8 +29,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, IdlePaintState, LayerId}; -use servo_msg::compositor_msg::{ReadyState, PaintState, PaintingPaintState, Scrollable}; +use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, LayerId}; +use servo_msg::compositor_msg::{ReadyState, PaintState, Scrollable}; use servo_msg::constellation_msg::{mod, ConstellationChan}; use servo_msg::constellation_msg::Msg as ConstellationMsg; use servo_msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; @@ -411,7 +411,7 @@ impl IOCompositor { if self.ready_states.len() == 0 { return false; } - return self.paint_states.values().all(|&value| value == IdlePaintState); + return self.paint_states.values().all(|&value| value == PaintState::Idle); } fn has_paint_msg_tracking(&self) -> bool { @@ -505,7 +505,7 @@ impl IOCompositor { -> Rc> { // Initialize the ReadyState and PaintState for this pipeline. self.ready_states.insert(frame_tree.pipeline.id, Blank); - self.paint_states.insert(frame_tree.pipeline.id, PaintingPaintState); + self.paint_states.insert(frame_tree.pipeline.id, PaintState::Painting); let root_layer = self.create_root_layer_for_pipeline_and_rect(&frame_tree.pipeline, frame_rect); diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 31799c119e1..42d629cd82e 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -21,8 +21,8 @@ use layers::platform::surface::{NativeSurface, NativeSurfaceMethods}; use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet}; use layers; use native::task::NativeTaskBuilder; -use servo_msg::compositor_msg::{Epoch, IdlePaintState, LayerId}; -use servo_msg::compositor_msg::{LayerMetadata, PaintListener, PaintingPaintState, ScrollPolicy}; +use servo_msg::compositor_msg::{Epoch, PaintState, LayerId}; +use servo_msg::compositor_msg::{LayerMetadata, PaintListener, ScrollPolicy}; use servo_msg::constellation_msg::Msg as ConstellationMsg; use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use servo_msg::constellation_msg::PipelineExitType; @@ -260,7 +260,7 @@ impl PaintTask where C: PaintListener + Send { } let mut replies = Vec::new(); - self.compositor.set_paint_state(self.id, PaintingPaintState); + self.compositor.set_paint_state(self.id, PaintState::Painting); for PaintRequest { buffer_requests, scale, layer_id, epoch } in requests.into_iter() { if self.epoch == epoch { @@ -270,7 +270,7 @@ impl PaintTask where C: PaintListener + Send { } } - self.compositor.set_paint_state(self.id, IdlePaintState); + self.compositor.set_paint_state(self.id, PaintState::Idle); for reply in replies.iter() { let &(_, ref buffer_set) = reply; diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs index 32717ec8f17..284e40b53af 100644 --- a/components/msg/compositor_msg.rs +++ b/components/msg/compositor_msg.rs @@ -16,8 +16,8 @@ use constellation_msg::PipelineId; /// The status of the painter. #[deriving(PartialEq, Clone)] pub enum PaintState { - IdlePaintState, - PaintingPaintState, + Idle, + Painting, } #[deriving(Eq, Ord, PartialEq, PartialOrd, Clone, Show)] diff --git a/ports/glfw/window.rs b/ports/glfw/window.rs index 377bb2839b6..9410949ef66 100644 --- a/ports/glfw/window.rs +++ b/ports/glfw/window.rs @@ -23,8 +23,8 @@ use gleam::gl; use layers::geometry::DevicePixel; use layers::platform::surface::NativeGraphicsMetadata; use libc::c_int; -use msg::compositor_msg::{Blank, FinishedLoading, IdlePaintState, Loading, PaintState}; -use msg::compositor_msg::{PaintingPaintState, PerformingLayout, ReadyState}; +use msg::compositor_msg::{Blank, FinishedLoading, Loading, PaintState}; +use msg::compositor_msg::{PerformingLayout, ReadyState}; use msg::constellation_msg::{mod, LoadData}; use msg::constellation_msg::{Key, KeyModifiers, CONTROL, SHIFT}; use std::cell::{Cell, RefCell}; @@ -81,7 +81,7 @@ impl Window { mouse_down_point: Cell::new(Point2D(0 as c_int, 0)), ready_state: Cell::new(Blank), - paint_state: Cell::new(IdlePaintState), + paint_state: Cell::new(PaintState::Idle), last_title_set_time: Cell::new(Timespec::new(0, 0)), }; @@ -354,10 +354,10 @@ impl Window { } FinishedLoading => { match self.paint_state.get() { - PaintingPaintState => { + PaintState::Painting => { self.glfw_window.set_title("Rendering — Servo [GLFW]") } - IdlePaintState => { + PaintState::Idle => { self.glfw_window.set_title("Servo [GLFW]") } } diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index f463d42483d..500be58fbfa 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -19,8 +19,8 @@ use layers::geometry::DevicePixel; use layers::platform::surface::NativeGraphicsMetadata; use msg::constellation_msg; use msg::constellation_msg::{Key, CONTROL, SHIFT, ALT}; -use msg::compositor_msg::{IdlePaintState, PaintState, PaintingPaintState}; -use msg::compositor_msg::{FinishedLoading, Blank, Loading, PerformingLayout, ReadyState}; +use msg::compositor_msg::{PaintState, FinishedLoading, Blank, Loading}; +use msg::compositor_msg::{PerformingLayout, ReadyState}; use msg::constellation_msg::LoadData; use std::cell::{Cell, RefCell}; use std::num::Float; @@ -156,7 +156,7 @@ impl Window { mouse_pos: Cell::new(Point2D(0, 0)), ready_state: Cell::new(Blank), - paint_state: Cell::new(IdlePaintState), + paint_state: Cell::new(PaintState::Idle), key_modifiers: Cell::new(KeyModifiers::empty()), last_title_set_time: Cell::new(Timespec::new(0, 0)), @@ -344,10 +344,10 @@ impl Window { } FinishedLoading => { match self.paint_state.get() { - PaintingPaintState => { + PaintState::Painting => { window.set_title("Rendering - Servo [glutin]") } - IdlePaintState => { + PaintState::Idle => { window.set_title("Servo [glutin]") } } diff --git a/ports/gonk/src/window.rs b/ports/gonk/src/window.rs index 141cd409843..fd99df29ec4 100644 --- a/ports/gonk/src/window.rs +++ b/ports/gonk/src/window.rs @@ -11,8 +11,7 @@ use geom::size::TypedSize2D; use layers::geometry::DevicePixel; use layers::platform::surface::NativeGraphicsMetadata; use libc::c_int; -use msg::compositor_msg::{Blank, IdlePaintState}; -use msg::compositor_msg::{ReadyState, PaintState}; +use msg::compositor_msg::{Blank, ReadyState, PaintState}; use msg::constellation_msg::{Key, KeyModifiers}; use msg::constellation_msg::LoadData; use std::cell::Cell; @@ -748,7 +747,7 @@ impl Window { surf: eglwindow, ready_state: Cell::new(Blank), - paint_state: Cell::new(IdlePaintState), + paint_state: Cell::new(PaintState::Idle), }; Rc::new(window)