Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/draw_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
Expand Down
2 changes: 1 addition & 1 deletion src/layers_surface_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform/with_egl/native_gl_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl NativeGLContextMethods for NativeGLContext {
fn create_headless() -> Result<NativeGLContext, &'static str> {
// 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)]
Expand Down
2 changes: 1 addition & 1 deletion src/platform/with_glx/native_gl_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl NativeGLContextMethods for NativeGLContext {
fn create_headless() -> Result<NativeGLContext, &'static str> {
// 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)]
Expand Down
10 changes: 5 additions & 5 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ fn test_pixels(pixels: &Vec<u8>) {
#[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")]
Expand All @@ -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<i32> = Size2D(256, 256);
let size : Size2D<i32> = Size2D::new(256, 256);
let ctx = GLContext::create_offscreen_with_color_attachment(size, GLContextAttributes::default(), ColorAttachmentType::TextureWithSurface).unwrap();

test_gl_context(&ctx);
Expand All @@ -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
Expand Down