mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Move ChromeToPaintMsg to gfx_traits.
This allows compositing not to depend on gfx.
This commit is contained in:
parent
86d65b6064
commit
7d1421bd83
9 changed files with 29 additions and 27 deletions
|
@ -9,7 +9,6 @@ name = "compositing"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
gfx = {path = "../gfx"}
|
|
||||||
gfx_traits = {path = "../gfx_traits"}
|
gfx_traits = {path = "../gfx_traits"}
|
||||||
script_traits = {path = "../script_traits"}
|
script_traits = {path = "../script_traits"}
|
||||||
style_traits = {path = "../style_traits"}
|
style_traits = {path = "../style_traits"}
|
||||||
|
|
|
@ -14,8 +14,7 @@ use euclid::rect::TypedRect;
|
||||||
use euclid::scale_factor::ScaleFactor;
|
use euclid::scale_factor::ScaleFactor;
|
||||||
use euclid::size::TypedSize2D;
|
use euclid::size::TypedSize2D;
|
||||||
use euclid::{Matrix4D, Point2D, Rect, Size2D};
|
use euclid::{Matrix4D, Point2D, Rect, Size2D};
|
||||||
use gfx::paint_thread::{ChromeToPaintMsg, PaintRequest};
|
use gfx_traits::{ChromeToPaintMsg, PaintRequest, ScrollPolicy, StackingContextId};
|
||||||
use gfx_traits::{ScrollPolicy, StackingContextId};
|
|
||||||
use gfx_traits::{color, Epoch, FrameTreeId, FragmentType, LayerId, LayerKind, LayerProperties};
|
use gfx_traits::{color, Epoch, FrameTreeId, FragmentType, LayerId, LayerKind, LayerProperties};
|
||||||
use gleam::gl;
|
use gleam::gl;
|
||||||
use gleam::gl::types::{GLint, GLsizei};
|
use gleam::gl::types::{GLint, GLsizei};
|
||||||
|
|
|
@ -15,7 +15,6 @@ extern crate app_units;
|
||||||
|
|
||||||
extern crate azure;
|
extern crate azure;
|
||||||
extern crate euclid;
|
extern crate euclid;
|
||||||
extern crate gfx;
|
|
||||||
extern crate gfx_traits;
|
extern crate gfx_traits;
|
||||||
extern crate gleam;
|
extern crate gleam;
|
||||||
extern crate image;
|
extern crate image;
|
||||||
|
@ -39,7 +38,7 @@ extern crate webrender_traits;
|
||||||
pub use compositor_thread::CompositorProxy;
|
pub use compositor_thread::CompositorProxy;
|
||||||
pub use compositor::IOCompositor;
|
pub use compositor::IOCompositor;
|
||||||
use euclid::size::TypedSize2D;
|
use euclid::size::TypedSize2D;
|
||||||
use gfx::paint_thread::ChromeToPaintMsg;
|
use gfx_traits::ChromeToPaintMsg;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use script_traits::{ConstellationControlMsg, LayoutControlMsg};
|
use script_traits::{ConstellationControlMsg, LayoutControlMsg};
|
||||||
|
|
|
@ -11,7 +11,8 @@ use euclid::size::TypedSize2D;
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
use gaol;
|
use gaol;
|
||||||
use gfx::font_cache_thread::FontCacheThread;
|
use gfx::font_cache_thread::FontCacheThread;
|
||||||
use gfx::paint_thread::{ChromeToPaintMsg, LayoutToPaintMsg, PaintThread};
|
use gfx::paint_thread::{LayoutToPaintMsg, PaintThread};
|
||||||
|
use gfx_traits::ChromeToPaintMsg;
|
||||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use layers::geometry::DevicePixel;
|
use layers::geometry::DevicePixel;
|
||||||
|
|
|
@ -15,14 +15,14 @@ use euclid::rect::Rect;
|
||||||
use euclid::size::Size2D;
|
use euclid::size::Size2D;
|
||||||
use font_cache_thread::FontCacheThread;
|
use font_cache_thread::FontCacheThread;
|
||||||
use font_context::FontContext;
|
use font_context::FontContext;
|
||||||
use gfx_traits::StackingContextId;
|
use gfx_traits::{ChromeToPaintMsg, Epoch, LayerId, LayerKind, LayerProperties};
|
||||||
use gfx_traits::{Epoch, FrameTreeId, LayerId, LayerKind, LayerProperties, PaintListener};
|
use gfx_traits::{PaintListener, PaintRequest, StackingContextId};
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
|
use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
|
||||||
use layers::platform::surface::{NativeDisplay, NativeSurface};
|
use layers::platform::surface::{NativeDisplay, NativeSurface};
|
||||||
use msg::constellation_msg::{PanicMsg, PipelineId};
|
use msg::constellation_msg::{PanicMsg, PipelineId};
|
||||||
use paint_context::PaintContext;
|
use paint_context::PaintContext;
|
||||||
use profile_traits::mem::{self, ReportsChan};
|
use profile_traits::mem;
|
||||||
use profile_traits::time;
|
use profile_traits::time;
|
||||||
use rand::{self, Rng};
|
use rand::{self, Rng};
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
@ -325,14 +325,6 @@ impl LayerCreator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PaintRequest {
|
|
||||||
pub buffer_requests: Vec<BufferRequest>,
|
|
||||||
pub scale: f32,
|
|
||||||
pub layer_id: LayerId,
|
|
||||||
pub epoch: Epoch,
|
|
||||||
pub layer_kind: LayerKind,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum Msg {
|
pub enum Msg {
|
||||||
FromLayout(LayoutToPaintMsg),
|
FromLayout(LayoutToPaintMsg),
|
||||||
FromChrome(ChromeToPaintMsg),
|
FromChrome(ChromeToPaintMsg),
|
||||||
|
@ -344,14 +336,6 @@ pub enum LayoutToPaintMsg {
|
||||||
Exit,
|
Exit,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum ChromeToPaintMsg {
|
|
||||||
Paint(Vec<PaintRequest>, FrameTreeId),
|
|
||||||
PaintPermissionGranted,
|
|
||||||
PaintPermissionRevoked,
|
|
||||||
CollectReports(ReportsChan),
|
|
||||||
Exit,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct PaintThread<C> {
|
pub struct PaintThread<C> {
|
||||||
id: PipelineId,
|
id: PipelineId,
|
||||||
_url: Url,
|
_url: Url,
|
||||||
|
|
|
@ -13,6 +13,7 @@ azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
|
||||||
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
|
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
|
||||||
msg = {path = "../msg"}
|
msg = {path = "../msg"}
|
||||||
plugins = {path = "../plugins"}
|
plugins = {path = "../plugins"}
|
||||||
|
profile_traits = {path = "../profile_traits"}
|
||||||
range = {path = "../range"}
|
range = {path = "../range"}
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
euclid = {version = "0.6.5", features = ["plugins"]}
|
euclid = {version = "0.6.5", features = ["plugins"]}
|
||||||
|
|
|
@ -15,6 +15,7 @@ extern crate euclid;
|
||||||
extern crate heapsize;
|
extern crate heapsize;
|
||||||
extern crate layers;
|
extern crate layers;
|
||||||
extern crate msg;
|
extern crate msg;
|
||||||
|
extern crate profile_traits;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate range;
|
extern crate range;
|
||||||
extern crate rustc_serialize;
|
extern crate rustc_serialize;
|
||||||
|
@ -27,7 +28,9 @@ pub use paint_listener::PaintListener;
|
||||||
use azure::azure_hl::Color;
|
use azure::azure_hl::Color;
|
||||||
use euclid::Matrix4D;
|
use euclid::Matrix4D;
|
||||||
use euclid::rect::Rect;
|
use euclid::rect::Rect;
|
||||||
|
use layers::layers::BufferRequest;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
|
use profile_traits::mem::ReportsChan;
|
||||||
use range::RangeIndex;
|
use range::RangeIndex;
|
||||||
use std::fmt::{self, Debug, Formatter};
|
use std::fmt::{self, Debug, Formatter};
|
||||||
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
||||||
|
@ -266,3 +269,19 @@ int_range_index! {
|
||||||
#[derive(HeapSizeOf)]
|
#[derive(HeapSizeOf)]
|
||||||
struct ByteIndex(isize)
|
struct ByteIndex(isize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct PaintRequest {
|
||||||
|
pub buffer_requests: Vec<BufferRequest>,
|
||||||
|
pub scale: f32,
|
||||||
|
pub layer_id: LayerId,
|
||||||
|
pub epoch: Epoch,
|
||||||
|
pub layer_kind: LayerKind,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum ChromeToPaintMsg {
|
||||||
|
Paint(Vec<PaintRequest>, FrameTreeId),
|
||||||
|
PaintPermissionGranted,
|
||||||
|
PaintPermissionRevoked,
|
||||||
|
CollectReports(ReportsChan),
|
||||||
|
Exit,
|
||||||
|
}
|
||||||
|
|
2
components/servo/Cargo.lock
generated
2
components/servo/Cargo.lock
generated
|
@ -313,7 +313,6 @@ dependencies = [
|
||||||
"app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"azure 0.4.5 (git+https://github.com/servo/rust-azure)",
|
"azure 0.4.5 (git+https://github.com/servo/rust-azure)",
|
||||||
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gfx 0.0.1",
|
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -818,6 +817,7 @@ dependencies = [
|
||||||
"layers 0.2.5 (git+https://github.com/servo/rust-layers)",
|
"layers 0.2.5 (git+https://github.com/servo/rust-layers)",
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
|
"profile_traits 0.0.1",
|
||||||
"range 0.0.1",
|
"range 0.0.1",
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
2
ports/cef/Cargo.lock
generated
2
ports/cef/Cargo.lock
generated
|
@ -272,7 +272,6 @@ dependencies = [
|
||||||
"app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"azure 0.4.5 (git+https://github.com/servo/rust-azure)",
|
"azure 0.4.5 (git+https://github.com/servo/rust-azure)",
|
||||||
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gfx 0.0.1",
|
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -727,6 +726,7 @@ dependencies = [
|
||||||
"layers 0.2.5 (git+https://github.com/servo/rust-layers)",
|
"layers 0.2.5 (git+https://github.com/servo/rust-layers)",
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
|
"profile_traits 0.0.1",
|
||||||
"range 0.0.1",
|
"range 0.0.1",
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue