Split compositing/pipeline/constellation code into separate crate.

This commit is contained in:
Josh Matthews 2014-06-28 09:00:43 -04:00
parent 23968efbd1
commit cc7493ea2f
16 changed files with 98 additions and 75 deletions

View file

@ -282,14 +282,22 @@ DONE_layout = $(B)src/components/layout/liblayout.dummy
DEPS_layout = $(CRATE_layout) $(SRC_layout) $(DONE_script) $(DONE_style) $(DONE_msg) $(DONE_macros) $(DONE_gfx) $(DONE_util)
RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/layout -L $(B)src/components/style -L $(B)src/components/msg -L$(B)src/components/macros
RFLAGS_compositing = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/layout -L $(B)src/components/style -L $(B)src/components/msg
SRC_compositing = $(call rwildcard,$(S)src/components/compositing/,*.rs)
CRATE_compositing = $(S)src/components/compositing/compositing.rs
DONE_compositing = $(B)src/components/compositing/libcompositing.dummy
DEPS_compositing = $(CRATE_compositing) $(SRC_compositing) $(DONE_util) $(DONE_msg) $(DONE_gfx)
RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/layout -L $(B)src/components/compositing -L $(B)src/components/style -L $(B)src/components/msg -L$(B)src/components/macros
SRC_servo = $(call rwildcard,$(S)src/components/main/,*.rs)
CRATE_servo = $(S)src/components/main/servo.rs
DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net) $(DONE_msg) $(DONE_style) $(DONE_macros) $(DONE_layout)
DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net) $(DONE_msg) $(DONE_style) $(DONE_macros) $(DONE_layout) $(DONE_compositing)
SERVO_LIB_CRATES = macros util net msg gfx script style layout
SERVO_LIB_CRATES = macros util net msg gfx script style layout compositing
# rules that depend on having correct meta-target vars (DEPS_CLEAN, DEPS_servo, etc)
# and SERVO_LIB_CRATES
@ -356,7 +364,7 @@ servo: $(DEPS_servo)
@$(call E, compile: $@)
$(Q)$(RUSTC) $(RFLAGS_servo) $< --crate-type bin,dylib,rlib
RFLAGS_embedding = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/layout -L $(B)src/components/style -L $(B)src/components/msg -L $(B).. -L $(B)src/components/main -L $(B)src/components/macros -A non_camel_case_types -A unused_variable
RFLAGS_embedding = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/layout -L $(B)src/components/compositing -L $(B)src/components/style -L $(B)src/components/msg -L $(B).. -L $(B)src/components/main -L $(B)src/components/macros -A non_camel_case_types -A unused_variable
ifeq ($(CFG_OSTYPE),apple-darwin)
RFLAGS_embedding += -C link-args="-Wl,-U,_tc_new -Wl,-U,_tc_newarray -Wl,-U,_tc_delete -Wl,-U,_tc_deletearray"

1
configure vendored
View file

@ -604,6 +604,7 @@ done
make_dir ${CFG_BUILD_DIR}src/components/macros
make_dir ${CFG_BUILD_DIR}src/components/util
make_dir ${CFG_BUILD_DIR}src/components/compositing
make_dir ${CFG_BUILD_DIR}src/components/embedding
make_dir ${CFG_BUILD_DIR}src/components/msg
make_dir ${CFG_BUILD_DIR}src/components/net

View file

@ -0,0 +1,64 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#![crate_id = "github.com/mozilla/servo#compositing:0.1"]
#![crate_type = "lib"]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![comment = "The Servo Parallel Browser Project"]
#![license = "MPL"]
#![feature(globs, phase, macro_rules)]
#[phase(plugin, link)]
extern crate log;
extern crate debug;
extern crate alert;
extern crate azure;
extern crate geom;
extern crate gfx;
#[cfg(not(target_os="android"))]
extern crate glfw;
#[cfg(target_os="android")]
extern crate glut;
extern crate layers;
extern crate layout;
extern crate opengles;
extern crate png;
extern crate script;
extern crate servo_msg = "msg";
extern crate servo_net = "net";
#[phase(plugin, link)]
extern crate servo_util = "util";
extern crate libc;
extern crate time;
extern crate url;
#[cfg(target_os="macos")]
extern crate core_graphics;
#[cfg(target_os="macos")]
extern crate core_text;
pub use compositor_task::{CompositorChan, CompositorTask};
pub use constellation::Constellation;
mod compositor_task;
mod quadtree;
mod compositor_layer;
mod compositor;
mod headless;
mod pipeline;
mod constellation;
mod windowing;
#[path="platform/mod.rs"]
pub mod platform;

View file

@ -2,11 +2,16 @@
* 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/. */
use compositor_task::{Msg, CompositorTask, Exit, ChangeReadyState, SetUnRenderedColor};
use compositor_task::{SetIds, GetGraphicsMetadata, CreateRootCompositorLayerIfNecessary};
use compositor_task::{CreateDescendantCompositorLayerIfNecessary, SetLayerPageSize};
use compositor_task::{SetLayerClipRect, Paint, ScrollFragmentPoint, LoadComplete};
use compositor_task::{ShutdownComplete, ChangeRenderState};
use constellation::SendableFrameTree;
use compositing::compositor_layer::CompositorLayer;
use compositing::*;
use compositor_layer::CompositorLayer;
use pipeline::CompositionPipeline;
use platform::{Application, Window};
use windowing;
use windowing::{FinishedWindowEvent, IdleWindowEvent, LoadUrlWindowEvent, MouseWindowClickEvent};
use windowing::{MouseWindowEvent, MouseWindowEventClass, MouseWindowMouseDownEvent};
use windowing::{MouseWindowMouseUpEvent, MouseWindowMoveEventClass, NavigationWindowEvent};

View file

@ -2,7 +2,7 @@
* 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/. */
use compositing::quadtree::{Quadtree, Normal, Hidden};
use quadtree::{Quadtree, Normal, Hidden};
use pipeline::CompositionPipeline;
use windowing::{MouseWindowEvent, MouseWindowClickEvent, MouseWindowMouseDownEvent};
use windowing::{MouseWindowMouseUpEvent};

View file

@ -4,6 +4,8 @@
pub use windowing;
use compositor;
use headless;
use constellation::SendableFrameTree;
use windowing::{ApplicationMethods, WindowMethods};
use platform::Application;
@ -26,12 +28,6 @@ use url::Url;
#[cfg(target_os="linux")]
use azure::azure_hl;
mod quadtree;
mod compositor_layer;
mod compositor;
mod headless;
/// The implementation of the layers-based compositor.
#[deriving(Clone)]
pub struct CompositorChan {
@ -214,11 +210,11 @@ impl CompositorTask {
///
/// FIXME(pcwalton): Probably could be less platform-specific, using the metadata abstraction.
#[cfg(target_os="linux")]
fn create_graphics_context() -> NativeCompositingGraphicsContext {
pub fn create_graphics_context() -> NativeCompositingGraphicsContext {
NativeCompositingGraphicsContext::from_display(azure_hl::current_display())
}
#[cfg(not(target_os="linux"))]
fn create_graphics_context() -> NativeCompositingGraphicsContext {
pub fn create_graphics_context() -> NativeCompositingGraphicsContext {
NativeCompositingGraphicsContext::new()
}

View file

@ -2,8 +2,7 @@
* 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/. */
use compositing::{CompositorChan, LoadComplete, SetIds, SetLayerClipRect, ShutdownComplete};
use compositor_task::{CompositorChan, LoadComplete, ShutdownComplete, SetLayerClipRect, SetIds};
use std::collections::hashmap::{HashMap, HashSet};
use geom::rect::{Rect, TypedRect};
use geom::scale_factor::ScaleFactor;

View file

@ -2,7 +2,11 @@
* 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/. */
use compositing::*;
use compositor_task::{Msg, Exit, ChangeReadyState, SetUnRenderedColor};
use compositor_task::{SetIds, GetGraphicsMetadata, CreateRootCompositorLayerIfNecessary};
use compositor_task::{CreateDescendantCompositorLayerIfNecessary, SetLayerPageSize};
use compositor_task::{SetLayerClipRect, Paint, ScrollFragmentPoint, LoadComplete};
use compositor_task::{ShutdownComplete, ChangeRenderState};
use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;

View file

@ -2,7 +2,7 @@
* 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/. */
use compositing::CompositorChan;
use CompositorChan;
use layout::layout_task::LayoutTask;
use gfx::render_task::{PaintPermissionGranted, PaintPermissionRevoked};

View file

@ -1,13 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* This file exists just to make it easier to import things inside of
./images/ without specifying the file they came out of imports.
Note that you still must define each of the files as a module in
servo.rc. This is not ideal and may be changed in the future. */
pub use holder::ImageHolder;
pub use base::Image;

View file

@ -13,50 +13,20 @@ extern crate log;
extern crate debug;
extern crate alert;
extern crate azure;
extern crate geom;
extern crate gfx;
#[cfg(not(target_os="android"))]
extern crate glfw;
#[cfg(target_os="android")]
extern crate glut;
extern crate js;
extern crate layers;
extern crate layout;
extern crate opengles;
extern crate png;
extern crate compositing;
extern crate rustuv;
extern crate script;
#[phase(plugin)]
extern crate servo_macros = "macros";
extern crate servo_net = "net";
extern crate servo_msg = "msg";
#[phase(plugin, link)]
extern crate servo_util = "util";
extern crate style;
extern crate sharegl;
extern crate stb_image;
extern crate collections;
extern crate green;
extern crate libc;
extern crate native;
extern crate rustrt;
extern crate serialize;
extern crate sync;
extern crate time;
extern crate url;
#[cfg(target_os="macos")]
extern crate core_graphics;
#[cfg(target_os="macos")]
extern crate core_text;
#[cfg(not(test))]
use compositing::{CompositorChan, CompositorTask};
#[cfg(not(test))]
use constellation::Constellation;
use compositing::{CompositorChan, CompositorTask, Constellation};
#[cfg(not(test))]
use servo_msg::constellation_msg::{ConstellationChan, InitLoadUrlMsg};
@ -85,17 +55,6 @@ use rustrt::task::TaskOpts;
use url::Url;
#[path="compositing/compositor_task.rs"]
pub mod compositing;
pub mod constellation;
pub mod pipeline;
pub mod windowing;
#[path="platform/mod.rs"]
pub mod platform;
#[cfg(not(test), target_os="linux")]
#[cfg(not(test), target_os="macos")]
#[start]