diff --git a/src/draw_buffer.rs b/src/draw_buffer.rs index 924f4e6..99275d1 100644 --- a/src/draw_buffer.rs +++ b/src/draw_buffer.rs @@ -263,7 +263,7 @@ impl DrawBufferHelpers for DrawBuffer { ColorAttachmentType::TextureWithSurface => { // TODO(ecoal95): check if this is correct let (flip, target) = Texture::texture_flip_and_target(true); - let mut texture = Texture::new(target, Size2D(self.size.width as usize, self.size.height as usize)); + let mut texture = Texture::new(target, Size2D::new(self.size.width as usize, self.size.height as usize)); texture.flip = flip; let surface_wrapper = LayersSurfaceWrapper::new(context.get_metadata(), self.size, self.size.width * (if attrs.alpha { 4 } else { 3 })); diff --git a/src/layers_surface_wrapper.rs b/src/layers_surface_wrapper.rs index 1ba00bf..91dfd6b 100644 --- a/src/layers_surface_wrapper.rs +++ b/src/layers_surface_wrapper.rs @@ -47,7 +47,7 @@ impl LayersSurfaceWrapper { } pub fn bind_to_texture(&self, texture: &Texture) { - let size = Size2D(self.size.width as isize, self.size.height as isize); + let size = Size2D::new(self.size.width as isize, self.size.height as isize); self.surface.bind_to_texture(&self.compositing_context, texture, size) } diff --git a/src/platform/with_egl/native_gl_context.rs b/src/platform/with_egl/native_gl_context.rs index 4b71b80..fb347f0 100644 --- a/src/platform/with_egl/native_gl_context.rs +++ b/src/platform/with_egl/native_gl_context.rs @@ -75,7 +75,7 @@ impl NativeGLContextMethods for NativeGLContext { fn create_headless() -> Result { // We create a context with a dummy size, we can't rely on a // default framebuffer - create_pixel_buffer_backed_offscreen_context(Size2D(16, 16)) + create_pixel_buffer_backed_offscreen_context(Size2D::new(16, 16)) } #[inline(always)] diff --git a/src/platform/with_glx/native_gl_context.rs b/src/platform/with_glx/native_gl_context.rs index 48980b3..c225f21 100644 --- a/src/platform/with_glx/native_gl_context.rs +++ b/src/platform/with_glx/native_gl_context.rs @@ -80,7 +80,7 @@ impl NativeGLContextMethods for NativeGLContext { fn create_headless() -> Result { // We create a context with a dummy size since in other platforms // a default framebuffer is not bound - create_offscreen_pixmap_backed_context(Size2D(16, 16)) + create_offscreen_pixmap_backed_context(Size2D::new(16, 16)) } #[inline(always)] diff --git a/src/tests.rs b/src/tests.rs index 9bb9753..3addb27 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -62,13 +62,13 @@ fn test_pixels(pixels: &Vec) { #[test] fn test_default_color_attachment() { load_gl(); - test_gl_context(&GLContext::create_offscreen(Size2D(256, 256), GLContextAttributes::default()).unwrap()); + test_gl_context(&GLContext::create_offscreen(Size2D::new(256, 256), GLContextAttributes::default()).unwrap()); } #[test] fn test_texture_color_attachment() { load_gl(); - test_gl_context(&GLContext::create_offscreen_with_color_attachment(Size2D(256, 256), GLContextAttributes::default(), ColorAttachmentType::Texture).unwrap()) + test_gl_context(&GLContext::create_offscreen_with_color_attachment(Size2D::new(256, 256), GLContextAttributes::default(), ColorAttachmentType::Texture).unwrap()) } #[cfg(target_os="linux")] @@ -88,7 +88,7 @@ fn get_compositing_context(_: &GLContext) -> NativeCompositingGraphicsContext { #[cfg(feature="texture_surface")] fn test_texture_surface_color_attachment() { load_gl(); - let size : Size2D = Size2D(256, 256); + let size : Size2D = Size2D::new(256, 256); let ctx = GLContext::create_offscreen_with_color_attachment(size, GLContextAttributes::default(), ColorAttachmentType::TextureWithSurface).unwrap(); test_gl_context(&ctx); @@ -97,12 +97,12 @@ fn test_texture_surface_color_attachment() { // And bind it to a new Texture let surface = ctx.borrow_draw_buffer().unwrap().borrow_bound_surface().unwrap(); let (flip, target) = Texture::texture_flip_and_target(true); - let mut texture = Texture::new(target, Size2D(size.width as usize, size.height as usize)); + let mut texture = Texture::new(target, Size2D::new(size.width as usize, size.height as usize)); texture.flip = flip; let compositing_context = get_compositing_context(&ctx); - surface.bind_to_texture(&compositing_context, &texture, Size2D(size.width as isize, size.height as isize)); + surface.bind_to_texture(&compositing_context, &texture, Size2D::new(size.width as isize, size.height as isize)); // Bind the texture, get its pixels in rgba format and test // if it has the surface contents