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
Send an IpcSharedMemory in tex_image_2d and tex_sub_image_2d #22225
Merged
+602
−563
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2a5539c
Use Size2D in TexImage2D and TexSubImage2D messages
nox 5f9e3d8
Move prepare_pixels to canvas_traits::webgl
nox ca62b5c
Call prepare_pixels on the WebGL thread
nox 87c849c
Move prepare_pixels to the canvas thread
nox faee0b2
Rename gleam feature to gl in compositing
nox 2c0acf6
Move PixelFormat to the pixels crate
nox cfca906
Call rgba8_byte_swap_colors_inplace on the WebGL thread
nox 804d964
Send an IpcSharedMemory in tex_image_2d and tex_sub_image_2d
nox 9a8d03a
Make HTMLCanvasElement::fetch_all_data return a shared memory blob
nox File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Call prepare_pixels on the WebGL thread
- Loading branch information
commit ca62b5c318bc101dce49be99302dae0abed1dfd2
| @@ -6,7 +6,7 @@ | ||
| use backtrace::Backtrace; | ||
| use canvas_traits::webgl::WebGLError::*; | ||
| use canvas_traits::webgl::{ | ||
| self, webgl_channel, AlphaTreatment, DOMToTextureCommand, Parameter, TexDataType, TexFormat, | ||
| webgl_channel, AlphaTreatment, DOMToTextureCommand, Parameter, TexDataType, TexFormat, | ||
| TexParameter, TexSource, WebGLCommand, WebGLCommandBacktrace, WebGLContextShareMode, | ||
| WebGLError, WebGLFramebufferBindingRequest, WebGLMsg, WebGLMsgSender, WebGLProgramId, | ||
| WebGLResult, WebGLSLVersion, WebGLSender, WebGLVersion, WebVRCommand, YAxisTreatment, | ||
| @@ -643,7 +643,7 @@ impl WebGLRenderingContext { | ||
| texture: &WebGLTexture, | ||
| target: TexImageTarget, | ||
| data_type: TexDataType, | ||
| internal_format: TexFormat, | ||
| format: TexFormat, | ||
| level: u32, | ||
| _border: u32, | ||
| unpacking_alignment: u32, | ||
| @@ -658,7 +658,7 @@ impl WebGLRenderingContext { | ||
| pixels.size.width, | ||
| pixels.size.height, | ||
| 1, | ||
| internal_format, | ||
| format, | ||
| level, | ||
| Some(data_type) | ||
| ) | ||
| @@ -679,36 +679,30 @@ impl WebGLRenderingContext { | ||
| YAxisTreatment::AsIs | ||
| }; | ||
|
|
||
| let buff = webgl::prepare_pixels( | ||
| internal_format, | ||
| data_type, | ||
| pixels.size, | ||
| unpacking_alignment, | ||
| alpha_treatment, | ||
| y_axis_treatment, | ||
| tex_source, | ||
| pixels.data, | ||
| ); | ||
|
|
||
| let format = internal_format.as_gl_constant(); | ||
| let data_type = data_type.as_gl_constant(); | ||
| let internal_format = self | ||
| let effective_internal_format = self | ||
| .extension_manager | ||
| .get_effective_tex_internal_format(format, data_type); | ||
| .get_effective_tex_internal_format(format.as_gl_constant(), data_type.as_gl_constant()); | ||
| let effective_data_type = self | ||
| .extension_manager | ||
| .effective_type(data_type.as_gl_constant()); | ||
|
|
||
| // TODO(emilio): convert colorspace if requested | ||
| let (sender, receiver) = ipc::bytes_channel().unwrap(); | ||
| self.send_command(WebGLCommand::TexImage2D { | ||
| target: target.as_gl_constant(), | ||
| level, | ||
| internal_format, | ||
| effective_internal_format, | ||
| size: pixels.size, | ||
| format, | ||
| data_type: self.extension_manager.effective_type(data_type), | ||
| data_type, | ||
| effective_data_type, | ||
| unpacking_alignment, | ||
| alpha_treatment, | ||
| y_axis_treatment, | ||
| tex_source, | ||
| receiver, | ||
| }); | ||
| sender.send(&buff).unwrap(); | ||
| sender.send(&pixels.data).unwrap(); | ||
|
|
||
| if let Some(fb) = self.bound_framebuffer.get() { | ||
| fb.invalidate_texture(&*texture); | ||
| @@ -765,16 +759,9 @@ impl WebGLRenderingContext { | ||
| YAxisTreatment::AsIs | ||
| }; | ||
|
|
||
| let buff = webgl::prepare_pixels( | ||
| format, | ||
| data_type, | ||
| pixels.size, | ||
| unpacking_alignment, | ||
| alpha_treatment, | ||
| y_axis_treatment, | ||
| tex_source, | ||
| pixels.data, | ||
| ); | ||
| let effective_data_type = self | ||
| .extension_manager | ||
| .effective_type(data_type.as_gl_constant()); | ||
nox
Author
Member
|
||
|
|
||
| // TODO(emilio): convert colorspace if requested | ||
| let (sender, receiver) = ipc::bytes_channel().unwrap(); | ||
| @@ -784,14 +771,16 @@ impl WebGLRenderingContext { | ||
| xoffset, | ||
| yoffset, | ||
| size: pixels.size, | ||
| format: format.as_gl_constant(), | ||
| data_type: self | ||
| .extension_manager | ||
| .effective_type(data_type.as_gl_constant()), | ||
| format, | ||
| data_type, | ||
| effective_data_type, | ||
| unpacking_alignment, | ||
| alpha_treatment, | ||
| y_axis_treatment, | ||
| tex_source, | ||
| receiver, | ||
| }); | ||
| sender.send(&buff).unwrap(); | ||
| sender.send(&pixels.data).unwrap(); | ||
| } | ||
|
|
||
| fn get_gl_extensions(&self) -> String { | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Why doesn't textSubImage2D need to go through the EM in order to get the effective internal format?