Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor rendering code #523

Merged
merged 5 commits into from Jun 20, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Warning police.

  • Loading branch information
metajack committed Jun 17, 2013
commit ece8791c26134d359c6a9466cf45214445b8a01a
@@ -24,7 +24,6 @@ use geom::{Point2D, Rect, Size2D};
use servo_net::image::base::Image;
use servo_util::range::Range;
use std::arc::ARC;
use std::arc;

/// A list of rendering operations to be performed.
pub struct DisplayList<E> {
@@ -3,15 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use platform::{Application, Window};
use script::dom::event::{Event, ClickEvent, MouseDownEvent, MouseUpEvent, ResizeEvent};
use script::script_task::{LoadMsg, SendEventMsg};
use script::layout_interface::{LayoutChan, RouteScriptMsg};
use script::compositor_interface::{ReadyState, ScriptListener};
use windowing::{ApplicationMethods, WindowMethods, WindowMouseEvent, WindowClickEvent};
use windowing::{WindowMouseDownEvent, WindowMouseUpEvent};

use script::dom::event::{Event, ClickEvent, MouseDownEvent, MouseUpEvent, ResizeEvent};
use script::compositor_interface::{ReadyState, ScriptListener};
use script::script_task::{ScriptChan, SendEventMsg};
use script::layout_interface::{LayoutChan, RouteScriptMsg};

use azure::azure_hl::{DataSourceSurface, DrawTarget, SourceSurfaceMethods, current_gl_context};
use azure::azure::AzGLContext;
use core::cell::Cell;
@@ -42,19 +42,19 @@ pub trait LayoutAuxMethods {
impl LayoutAuxMethods for AbstractNode<LayoutView> {
// FIXME (Rust #3080): These unsafe blocks are *not* unused!
pub fn layout_data(self) -> @mut LayoutData {
unsafe {
/*unsafe {*/
self.unsafe_layout_data()
}
/*}*/
}
pub fn has_layout_data(self) -> bool {
unsafe {
/*unsafe {*/
self.unsafe_has_layout_data()
}
/*}*/
}
pub fn set_layout_data(self, data: @mut LayoutData) {
unsafe {
/*unsafe {*/
self.unsafe_set_layout_data(data)
}
/*}*/
}

/// If none exists, creates empty layout data for the node (the reader-auxiliary
@@ -59,7 +59,8 @@ impl WindowMethods<Application> for Window {
/// Creates a new window.
pub fn new(_: &Application) -> @mut Window {
// Create the GLUT window.
unsafe { glut::bindgen::glutInitWindowSize(800, 600); }
// FIXME (Rust #3080): These unsafe blocks are *not* unused!
/*unsafe { */glut::bindgen::glutInitWindowSize(800, 600);/* }*/
let glut_window = glut::create_window(~"Servo");

// Create our window object.
@@ -117,7 +118,7 @@ impl WindowMethods<Application> for Window {
window.handle_mouse(button, state, x, y);
}
}
do glut::mouse_wheel_func |wheel, direction, x, y| {
do glut::mouse_wheel_func |wheel, direction, _x, _y| {
let delta = if HAVE_PRECISE_MOUSE_WHEEL {
(direction as f32) / 10000.0
} else {
@@ -546,7 +546,7 @@ impl ScriptContext {
}
}

ClickEvent(button, point) => {
ClickEvent(_button, point) => {
debug!("ClickEvent: clicked at %?", point);
let root = match self.root_frame {
Some(ref frame) => frame.document.root,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.