mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #10150 - emilio:canvas-cleanup, r=jdm
Canvas cleanup This PR cleans up the layerization infrastructure for canvas, which was unused, and removes unused dependencies. It also takes in account my recent username change to update angle's dependency (offscreen_gl_context requires extra work due to webrender depending on it). r? @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10150) <!-- Reviewable:end -->
This commit is contained in:
commit
2887623c4a
20 changed files with 22 additions and 131 deletions
|
@ -50,7 +50,7 @@ git = "https://github.com/servo/rust-mozjs"
|
|||
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
|
||||
|
||||
[dependencies.angle]
|
||||
git = "https://github.com/ecoal95/angle"
|
||||
git = "https://github.com/emilio/angle"
|
||||
branch = "servo"
|
||||
|
||||
[dependencies.ipc-channel]
|
||||
|
|
|
@ -206,7 +206,7 @@ impl HTMLCanvasElement {
|
|||
CanvasData::Pixels(pixel_data)
|
||||
=> pixel_data.image_data.to_vec(),
|
||||
CanvasData::WebGL(_)
|
||||
// TODO(ecoal95): Not sure if WebGL canvas is required for 2d spec,
|
||||
// TODO(emilio): Not sure if WebGL canvas is required for 2d spec,
|
||||
// but I think it's not.
|
||||
=> return None,
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ impl WebGLProgram {
|
|||
_ => return Err(WebGLError::InvalidOperation),
|
||||
};
|
||||
|
||||
// TODO(ecoal95): Differentiate between same shader already assigned and other previous
|
||||
// TODO(emilio): Differentiate between same shader already assigned and other previous
|
||||
// shader.
|
||||
if shader_slot.get().is_some() {
|
||||
return Err(WebGLError::InvalidOperation);
|
||||
|
|
|
@ -610,7 +610,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(ecoal95): Probably in the future we should keep track of the
|
||||
// TODO(emilio): Probably in the future we should keep track of the
|
||||
// generated objects, either here or in the webgl thread
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||
fn CreateBuffer(&self) -> Option<Root<WebGLBuffer>> {
|
||||
|
@ -1116,8 +1116,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
if texture.is_none() {
|
||||
return self.webgl_error(InvalidOperation);
|
||||
}
|
||||
// TODO(ecoal95): Validate more parameters
|
||||
|
||||
// TODO(emilio): Validate more parameters
|
||||
let source = match source {
|
||||
Some(s) => s,
|
||||
None => return,
|
||||
|
@ -1144,7 +1143,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
};
|
||||
|
||||
let size = Size2D::new(img.width as i32, img.height as i32);
|
||||
// TODO(ecoal95): Validate that the format argument is coherent with the image.
|
||||
// TODO(emilio): Validate that the format argument is coherent with the image.
|
||||
// RGB8 should be easy to support too
|
||||
let mut data = match img.format {
|
||||
PixelFormat::RGBA8 => img.bytes.to_vec(),
|
||||
|
@ -1155,7 +1154,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
|
||||
(data, size)
|
||||
},
|
||||
// TODO(ecoal95): Getting canvas data is implemented in CanvasRenderingContext2D, but
|
||||
// TODO(emilio): Getting canvas data is implemented in CanvasRenderingContext2D, but
|
||||
// we need to refactor it moving it to `HTMLCanvasElement` and supporting WebGLContext
|
||||
ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement::HTMLCanvasElement(canvas) => {
|
||||
let canvas = canvas.r();
|
||||
|
@ -1170,7 +1169,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
=> unimplemented!(),
|
||||
};
|
||||
|
||||
// TODO(ecoal95): Invert axis, convert colorspace, premultiply alpha if requested
|
||||
// TODO(emilio): Invert axis, convert colorspace, premultiply alpha if requested
|
||||
let msg = CanvasWebGLMsg::TexImage2D(target, level, internal_format as i32,
|
||||
size.width, size.height,
|
||||
format, data_type, pixels);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue