mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
cargo fix --edition-idioms
This commit is contained in:
parent
b1fd6237d1
commit
2012be4a8b
203 changed files with 665 additions and 1281 deletions
|
@ -1364,7 +1364,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
fn initialize_framebuffer(
|
||||
gl: &gl::Gl,
|
||||
gl: &dyn gl::Gl,
|
||||
state: &GLState,
|
||||
color: bool,
|
||||
depth: bool,
|
||||
|
@ -1424,7 +1424,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn link_program(gl: &gl::Gl, program: WebGLProgramId) -> ProgramLinkInfo {
|
||||
fn link_program(gl: &dyn gl::Gl, program: WebGLProgramId) -> ProgramLinkInfo {
|
||||
gl.link_program(program.get());
|
||||
let mut linked = [0];
|
||||
unsafe {
|
||||
|
@ -1497,13 +1497,13 @@ impl WebGLImpl {
|
|||
}
|
||||
}
|
||||
|
||||
fn finish(gl: &gl::Gl, chan: &WebGLSender<()>) {
|
||||
fn finish(gl: &dyn gl::Gl, chan: &WebGLSender<()>) {
|
||||
gl.finish();
|
||||
chan.send(()).unwrap();
|
||||
}
|
||||
|
||||
fn shader_precision_format(
|
||||
gl: &gl::Gl,
|
||||
gl: &dyn gl::Gl,
|
||||
shader_type: u32,
|
||||
precision_type: u32,
|
||||
chan: &WebGLSender<(i32, i32, i32)>,
|
||||
|
@ -1512,13 +1512,13 @@ impl WebGLImpl {
|
|||
chan.send(result).unwrap();
|
||||
}
|
||||
|
||||
fn get_extensions(gl: &gl::Gl, chan: &WebGLSender<String>) {
|
||||
fn get_extensions(gl: &dyn gl::Gl, chan: &WebGLSender<String>) {
|
||||
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,
|
||||
gl: &dyn gl::Gl,
|
||||
target: u32,
|
||||
attachment: u32,
|
||||
pname: u32,
|
||||
|
@ -1529,13 +1529,18 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7
|
||||
fn get_renderbuffer_parameter(gl: &gl::Gl, target: u32, pname: u32, chan: &WebGLSender<i32>) {
|
||||
fn get_renderbuffer_parameter(
|
||||
gl: &dyn gl::Gl,
|
||||
target: u32,
|
||||
pname: u32,
|
||||
chan: &WebGLSender<i32>,
|
||||
) {
|
||||
let parameter = gl.get_renderbuffer_parameter_iv(target, pname);
|
||||
chan.send(parameter).unwrap();
|
||||
}
|
||||
|
||||
fn uniform_location(
|
||||
gl: &gl::Gl,
|
||||
gl: &dyn gl::Gl,
|
||||
program_id: WebGLProgramId,
|
||||
name: &str,
|
||||
chan: &WebGLSender<i32>,
|
||||
|
@ -1545,18 +1550,18 @@ impl WebGLImpl {
|
|||
chan.send(location).unwrap();
|
||||
}
|
||||
|
||||
fn shader_info_log(gl: &gl::Gl, shader_id: WebGLShaderId, chan: &WebGLSender<String>) {
|
||||
fn shader_info_log(gl: &dyn gl::Gl, shader_id: WebGLShaderId, chan: &WebGLSender<String>) {
|
||||
let log = gl.get_shader_info_log(shader_id.get());
|
||||
chan.send(log).unwrap();
|
||||
}
|
||||
|
||||
fn program_info_log(gl: &gl::Gl, program_id: WebGLProgramId, chan: &WebGLSender<String>) {
|
||||
fn program_info_log(gl: &dyn gl::Gl, program_id: WebGLProgramId, chan: &WebGLSender<String>) {
|
||||
let log = gl.get_program_info_log(program_id.get());
|
||||
chan.send(log).unwrap();
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn create_buffer(gl: &gl::Gl, chan: &WebGLSender<Option<WebGLBufferId>>) {
|
||||
fn create_buffer(gl: &dyn gl::Gl, chan: &WebGLSender<Option<WebGLBufferId>>) {
|
||||
let buffer = gl.gen_buffers(1)[0];
|
||||
let buffer = if buffer == 0 {
|
||||
None
|
||||
|
@ -1567,7 +1572,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn create_framebuffer(gl: &gl::Gl, chan: &WebGLSender<Option<WebGLFramebufferId>>) {
|
||||
fn create_framebuffer(gl: &dyn gl::Gl, chan: &WebGLSender<Option<WebGLFramebufferId>>) {
|
||||
let framebuffer = gl.gen_framebuffers(1)[0];
|
||||
let framebuffer = if framebuffer == 0 {
|
||||
None
|
||||
|
@ -1578,7 +1583,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn create_renderbuffer(gl: &gl::Gl, chan: &WebGLSender<Option<WebGLRenderbufferId>>) {
|
||||
fn create_renderbuffer(gl: &dyn gl::Gl, chan: &WebGLSender<Option<WebGLRenderbufferId>>) {
|
||||
let renderbuffer = gl.gen_renderbuffers(1)[0];
|
||||
let renderbuffer = if renderbuffer == 0 {
|
||||
None
|
||||
|
@ -1589,7 +1594,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn create_texture(gl: &gl::Gl, chan: &WebGLSender<Option<WebGLTextureId>>) {
|
||||
fn create_texture(gl: &dyn gl::Gl, chan: &WebGLSender<Option<WebGLTextureId>>) {
|
||||
let texture = gl.gen_textures(1)[0];
|
||||
let texture = if texture == 0 {
|
||||
None
|
||||
|
@ -1600,7 +1605,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn create_program(gl: &gl::Gl, chan: &WebGLSender<Option<WebGLProgramId>>) {
|
||||
fn create_program(gl: &dyn gl::Gl, chan: &WebGLSender<Option<WebGLProgramId>>) {
|
||||
let program = gl.create_program();
|
||||
let program = if program == 0 {
|
||||
None
|
||||
|
@ -1611,7 +1616,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn create_shader(gl: &gl::Gl, shader_type: u32, chan: &WebGLSender<Option<WebGLShaderId>>) {
|
||||
fn create_shader(gl: &dyn gl::Gl, shader_type: u32, chan: &WebGLSender<Option<WebGLShaderId>>) {
|
||||
let shader = gl.create_shader(shader_type);
|
||||
let shader = if shader == 0 {
|
||||
None
|
||||
|
@ -1622,7 +1627,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn create_vertex_array(gl: &gl::Gl, chan: &WebGLSender<Option<WebGLVertexArrayId>>) {
|
||||
fn create_vertex_array(gl: &dyn gl::Gl, chan: &WebGLSender<Option<WebGLVertexArrayId>>) {
|
||||
let vao = gl.gen_vertex_arrays(1)[0];
|
||||
let vao = if vao == 0 {
|
||||
None
|
||||
|
@ -1634,7 +1639,7 @@ impl WebGLImpl {
|
|||
|
||||
#[inline]
|
||||
fn bind_framebuffer<Native: NativeGLContextMethods>(
|
||||
gl: &gl::Gl,
|
||||
gl: &dyn gl::Gl,
|
||||
target: u32,
|
||||
request: WebGLFramebufferBindingRequest,
|
||||
ctx: &GLContext<Native>,
|
||||
|
@ -1650,7 +1655,7 @@ impl WebGLImpl {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
fn compile_shader(gl: &gl::Gl, shader_id: WebGLShaderId, source: &str) {
|
||||
fn compile_shader(gl: &dyn gl::Gl, shader_id: WebGLShaderId, source: &str) {
|
||||
gl.shader_source(shader_id.get(), &[source.as_bytes()]);
|
||||
gl.compile_shader(shader_id.get());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue