diff options
Diffstat (limited to 'components/canvas_traits')
-rw-r--r-- | components/canvas_traits/canvas.rs | 8 | ||||
-rw-r--r-- | components/canvas_traits/webgl.rs | 21 |
2 files changed, 17 insertions, 12 deletions
diff --git a/components/canvas_traits/canvas.rs b/components/canvas_traits/canvas.rs index a9d47d252a4..ec3f623e634 100644 --- a/components/canvas_traits/canvas.rs +++ b/components/canvas_traits/canvas.rs @@ -22,10 +22,10 @@ pub struct CanvasId(pub u64); #[derive(Clone, Deserialize, Serialize)] pub enum CanvasMsg { Canvas2d(Canvas2dMsg, CanvasId), - Create(IpcSender<CanvasId>, Size2D<i32>, webrender_api::RenderApiSender, bool), + Create(IpcSender<CanvasId>, Size2D<u32>, webrender_api::RenderApiSender, bool), FromLayout(FromLayoutMsg, CanvasId), FromScript(FromScriptMsg, CanvasId), - Recreate(Size2D<i32>, CanvasId), + Recreate(Size2D<u32>, CanvasId), Close(CanvasId), } @@ -143,7 +143,7 @@ impl RadialGradientStyle { #[derive(Clone, Deserialize, Serialize)] pub struct SurfaceStyle { pub surface_data: ByteBuf, - pub surface_size: Size2D<i32>, + pub surface_size: Size2D<u32>, pub repeat_x: bool, pub repeat_y: bool, } @@ -151,7 +151,7 @@ pub struct SurfaceStyle { impl SurfaceStyle { pub fn new( surface_data: Vec<u8>, - surface_size: Size2D<i32>, + surface_size: Size2D<u32>, repeat_x: bool, repeat_y: bool, ) -> Self { diff --git a/components/canvas_traits/webgl.rs b/components/canvas_traits/webgl.rs index ad10ed7edd0..4c392972b8e 100644 --- a/components/canvas_traits/webgl.rs +++ b/components/canvas_traits/webgl.rs @@ -36,10 +36,14 @@ pub struct WebGLCommandBacktrace { #[derive(Deserialize, Serialize)] pub enum WebGLMsg { /// Creates a new WebGLContext. - CreateContext(WebGLVersion, Size2D<i32>, GLContextAttributes, - WebGLSender<Result<(WebGLCreateContextResult), String>>), + CreateContext( + WebGLVersion, + Size2D<u32>, + GLContextAttributes, + WebGLSender<Result<(WebGLCreateContextResult), String>>, + ), /// Resizes a WebGLContext. - ResizeContext(WebGLContextId, Size2D<i32>, WebGLSender<Result<(), String>>), + ResizeContext(WebGLContextId, Size2D<u32>, WebGLSender<Result<(), String>>), /// Drops a WebGLContext. RemoveContext(WebGLContextId), /// Runs a WebGLCommand in a specific WebGLContext. @@ -141,10 +145,11 @@ impl WebGLMsgSender { /// Send a resize message #[inline] - pub fn send_resize(&self, - size: Size2D<i32>, - sender: WebGLSender<Result<(), String>>) - -> WebGLSendResult { + pub fn send_resize( + &self, + size: Size2D<u32>, + sender: WebGLSender<Result<(), String>>, + ) -> WebGLSendResult { self.sender.send(WebGLMsg::ResizeContext(self.ctx_id, size, sender)) } @@ -224,7 +229,7 @@ pub enum WebGLCommand { RenderbufferStorage(u32, u32, i32, i32), ReadPixels(i32, i32, i32, i32, u32, u32, IpcBytesSender), SampleCoverage(f32, bool), - Scissor(i32, i32, i32, i32), + Scissor(i32, i32, u32, u32), StencilFunc(u32, i32, u32), StencilFuncSeparate(u32, u32, i32, u32), StencilMask(u32), |