Skip to content

Commit

Permalink
# This is a combination of 26 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

resolved second merge conflict

# This is the commit message servo#2:

timed test to drawImage from one canvas to another

# This is the commit message servo#3:

setting up canvas id in layout

# This is the commit message servo#4:

finished associating CanvasId to layout

# This is the commit message servo#5:

removed 'unused import' build warning

# This is the commit message servo#6:

Removed files that shouldn't be in the repo.

# This is the commit message servo#7:

Converted tabs to spaces

# This is the commit message servo#8:

refactor(counter_style): parse int via parse_non_negative

# This is the commit message servo#9:

Update web-platform-tests to revision 26e8a76d7fbea0721468e791a325444ac9939a4f

# This is the commit message servo#10:

fix(keyevent): do not emit default ignorable codepoint

# This is the commit message servo#11:

Reduce the number of calls to the embedder by grouping the screen and window coordinates into one structure

# This is the commit message servo#12:

forward EmbedderMsg to embedder

# This is the commit message servo#13:

move key code into dedicated file

# This is the commit message servo#14:

split window code and browser code in two different files

# This is the commit message servo#15:

remove useless pref

# This is the commit message servo#16:

Use the --device-pixel-ratio in opt instead of /components/servo/

# This is the commit message servo#17:

loop until we exhausted all the servo events

# This is the commit message servo#18:

Implement WebGL getFramebufferAttachmentParameter API

# This is the commit message servo#19:

style: Rename StyleContext to ComputedStyle.

Bug: 1447483
Reviewed-by: jwatt
MozReview-Commit-ID: KATZ6DkmpVY
Signed-off-by: Emilio Cobos Álvarez <[email protected]>

# This is the commit message servo#20:

style: Update bindings.

Signed-off-by: Emilio Cobos Álvarez <[email protected]>

# This is the commit message servo#21:

Fix an off-by-one error with limits.max_vertex_attribs

# This is the commit message servo#22:

Implement a missing INVALID_OPERATION check in DrawArrays

# This is the commit message servo#23:

Make some WebGL parameters non-optional (fixes servo#8753)

Those parameters aren't optional in the current spec.

The test element-array-buffer-delete-recreate.html now fails because we don't
actually implement gl.getParameter(gl.CURRENT_PROGRAM).

# This is the commit message servo#24:

Implement gl.getParameter(gl.CURRENT_PROGRAM)

# This is the commit message servo#25:

Implement gl.getParameter(gl.VIEWPORT)

# This is the commit message servo#26:

Don't disable canvas3d tests involving CSS transforms (fixes servo#8766)

Those don't seem to be intermittent anymore, and it's better to let
the intermittent tracker do its job anyway.
  • Loading branch information
pmocher committed Mar 30, 2018
1 parent 506ceb6 commit b30a8d2
Show file tree
Hide file tree
Showing 143 changed files with 8,230 additions and 8,405 deletions.
34 changes: 16 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 15 additions & 14 deletions components/canvas/canvas_paint_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct CanvasPaintThread<'a> {
old_image_key: Option<webrender_api::ImageKey>,
/// An old webrender image key that can be deleted when the current epoch ends.
very_old_image_key: Option<webrender_api::ImageKey>,
canvas_id: CanvasId,
canvas_id: CanvasId,
}

#[derive(Clone)]
Expand Down Expand Up @@ -100,7 +100,7 @@ impl<'a> CanvasPaintThread<'a> {
fn new(size: Size2D<i32>,
webrender_api_sender: webrender_api::RenderApiSender,
antialias: AntialiasMode,
canvas_id: CanvasId) -> CanvasPaintThread<'a> {
canvas_id: CanvasId) -> CanvasPaintThread<'a> {
let draw_target = CanvasPaintThread::create(size);
let path_builder = draw_target.create_path_builder();
let webrender_api = webrender_api_sender.create_api();
Expand All @@ -113,7 +113,7 @@ impl<'a> CanvasPaintThread<'a> {
image_key: None,
old_image_key: None,
very_old_image_key: None,
canvas_id: canvas_id,
canvas_id: canvas_id,
}
}

Expand All @@ -122,7 +122,7 @@ impl<'a> CanvasPaintThread<'a> {
pub fn start(size: Size2D<i32>,
webrender_api_sender: webrender_api::RenderApiSender,
antialias: bool,
canvas_id: CanvasId)
canvas_id: CanvasId)
-> IpcSender<CanvasMsg> {
let (sender, receiver) = ipc::channel::<CanvasMsg>().unwrap();
let antialias = if antialias {
Expand All @@ -136,7 +136,7 @@ impl<'a> CanvasPaintThread<'a> {
let msg = receiver.recv();
match msg.unwrap() {
CanvasMsg::Canvas2d(message, canvas_id) => {
assert!(canvas_id == painter.canvas_id);
assert!(canvas_id == painter.canvas_id);
match message {
Canvas2dMsg::FillText(text, x, y, max_width) => painter.fill_text(text, x, y, max_width),
Canvas2dMsg::FillRect(ref rect) => painter.fill_rect(rect),
Expand Down Expand Up @@ -203,22 +203,23 @@ impl<'a> CanvasPaintThread<'a> {
}
},
CanvasMsg::Close(canvas_id) =>{
assert!(canvas_id == painter.canvas_id);
break;
},
assert!(canvas_id == painter.canvas_id);
break;
},
CanvasMsg::Recreate(size,canvas_id) =>{
assert!(canvas_id == painter.canvas_id);
painter.recreate(size);
},
assert!(canvas_id == painter.canvas_id);
painter.recreate(size);
},
CanvasMsg::FromScript(message,canvas_id) => {
assert!(canvas_id == painter.canvas_id);
assert!(canvas_id == painter.canvas_id);
match message {
FromScriptMsg::SendPixels(chan) => {
painter.send_pixels(chan)
}
}
},
CanvasMsg::FromLayout(message) => {
CanvasMsg::FromLayout(message, canvas_id) => {
assert!(canvas_id == painter.canvas_id);
match message {
FromLayoutMsg::SendData(chan) => {
painter.send_data(chan)
Expand Down Expand Up @@ -404,7 +405,7 @@ impl<'a> CanvasPaintThread<'a> {

fn draw_image_in_other(&self,
renderer: IpcSender<CanvasMsg>,
other_canvas_id: CanvasId,
other_canvas_id: CanvasId,
image_size: Size2D<f64>,
dest_rect: Rect<f64>,
source_rect: Rect<f64>,
Expand Down
25 changes: 21 additions & 4 deletions components/canvas/webgl_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ impl WebGLImpl {
Self::active_uniform(ctx.gl(), program_id, index, chan),
WebGLCommand::GetAttribLocation(program_id, name, chan) =>
Self::attrib_location(ctx.gl(), program_id, name, chan),
WebGLCommand::GetFramebufferAttachmentParameter(target, attachment, pname, chan) =>
Self::get_framebuffer_attachment_parameter(ctx.gl(), target, attachment, pname, chan),
WebGLCommand::GetVertexAttrib(index, pname, chan) =>
Self::vertex_attrib(ctx.gl(), index, pname, chan),
WebGLCommand::GetVertexAttribOffset(index, pname, chan) =>
Expand Down Expand Up @@ -858,8 +860,12 @@ impl WebGLImpl {
ctx.gl().vertex_attrib_pointer_f32(attrib_id, size, normalized, stride, offset),
WebGLCommand::VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset) =>
ctx.gl().vertex_attrib_pointer(attrib_id, size, data_type, normalized, stride, offset),
WebGLCommand::Viewport(x, y, width, height) =>
ctx.gl().viewport(x, y, width, height),
WebGLCommand::GetViewport(sender) => {
sender.send(ctx.gl().get_viewport()).unwrap();
}
WebGLCommand::SetViewport(x, y, width, height) => {
ctx.gl().viewport(x, y, width, height);
}
WebGLCommand::TexImage2D(target, level, internal, width, height, format, data_type, data) =>
ctx.gl().tex_image_2d(target, level, internal, width, height,
/*border*/0, format, data_type, Some(&data)),
Expand Down Expand Up @@ -1053,8 +1059,7 @@ impl WebGLImpl {

// Int32Array
gl::MAX_VIEWPORT_DIMS |
gl::SCISSOR_BOX |
gl::VIEWPORT => Err(WebGLError::InvalidEnum),
gl::SCISSOR_BOX => Err(WebGLError::InvalidEnum),

// Invalid parameters
_ => Err(WebGLError::InvalidEnum)
Expand Down Expand Up @@ -1165,6 +1170,18 @@ impl WebGLImpl {
chan.send(gl.get_string(gl::EXTENSIONS)).unwrap();
}

// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6
fn get_framebuffer_attachment_parameter(
gl: &gl::Gl,
target: u32,
attachment: u32,
pname: u32,
chan: WebGLSender<i32>
) {
let parameter = gl.get_framebuffer_attachment_parameter_iv(target, attachment, pname);
chan.send(parameter).unwrap();
}

fn uniform_location(gl: &gl::Gl,
program_id: WebGLProgramId,
name: String,
Expand Down
4 changes: 2 additions & 2 deletions components/canvas_traits/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ pub enum FillRule {
Evenodd,
}

#[derive(Clone, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub struct CanvasId(pub u64);

#[derive(Clone, Deserialize, Serialize)]
pub enum CanvasMsg {
Canvas2d(Canvas2dMsg, CanvasId),
FromLayout(FromLayoutMsg),
FromLayout(FromLayoutMsg, CanvasId),
FromScript(FromScriptMsg, CanvasId),
Recreate(Size2D<i32>, CanvasId),
Close(CanvasId),
Expand Down
8 changes: 6 additions & 2 deletions components/canvas_traits/webgl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ pub enum WebGLCommand {
GetVertexAttribOffset(u32, u32, WebGLSender<isize>),
GetShaderInfoLog(WebGLShaderId, WebGLSender<String>),
GetProgramInfoLog(WebGLProgramId, WebGLSender<String>),
GetFramebufferAttachmentParameter(u32, u32, u32, WebGLSender<i32>),
PolygonOffset(f32, f32),
RenderbufferStorage(u32, u32, i32, i32),
ReadPixels(i32, i32, i32, i32, u32, u32, WebGLSender<Vec<u8>>),
Expand Down Expand Up @@ -259,7 +260,8 @@ pub enum WebGLCommand {
VertexAttrib(u32, f32, f32, f32, f32),
VertexAttribPointer(u32, i32, u32, bool, i32, u32),
VertexAttribPointer2f(u32, i32, bool, i32, u32),
Viewport(i32, i32, i32, i32),
GetViewport(WebGLSender<(i32, i32, i32, i32)>),
SetViewport(i32, i32, i32, i32),
TexImage2D(u32, i32, i32, i32, i32, u32, u32, Vec<u8>),
TexParameteri(u32, u32, i32),
TexParameterf(u32, u32, f32),
Expand Down Expand Up @@ -490,6 +492,7 @@ impl fmt::Debug for WebGLCommand {
GetProgramInfoLog(..) => "GetProgramInfoLog",
GetVertexAttrib(..) => "GetVertexAttrib",
GetVertexAttribOffset(..) => "GetVertexAttribOffset",
GetFramebufferAttachmentParameter(..) => "GetFramebufferAttachmentParameter",
PolygonOffset(..) => "PolygonOffset",
ReadPixels(..) => "ReadPixels",
RenderbufferStorage(..) => "RenderbufferStorage",
Expand Down Expand Up @@ -530,7 +533,8 @@ impl fmt::Debug for WebGLCommand {
VertexAttrib(..) => "VertexAttrib",
VertexAttribPointer2f(..) => "VertexAttribPointer2f",
VertexAttribPointer(..) => "VertexAttribPointer",
Viewport(..) => "Viewport",
GetViewport(..) => "GetViewport",
SetViewport(..) => "SetViewport",
TexImage2D(..) => "TexImage2D",
TexParameteri(..) => "TexParameteri",
TexParameterf(..) => "TexParameterf",
Expand Down
Loading

0 comments on commit b30a8d2

Please sign in to comment.