From 87069f26e92660cd9b13bef865e92f726d650e54 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Mon, 25 Oct 2021 15:52:06 +0200 Subject: [PATCH] renderer: rename function parameters for clearer purpose --- src/backend/renderer/mod.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/backend/renderer/mod.rs b/src/backend/renderer/mod.rs index 8a2b3a6..a975894 100644 --- a/src/backend/renderer/mod.rs +++ b/src/backend/renderer/mod.rs @@ -175,13 +175,14 @@ pub trait Frame { /// Render a texture to the current target as a flat 2d-plane at a given /// position and applying the given transformation with the given alpha value. + /// (Meaning `src_transform` should match the orientation of surface being rendered). fn render_texture_at( &mut self, texture: &Self::TextureId, pos: Point, texture_scale: i32, output_scale: f64, - transform: Transform, + src_transform: Transform, alpha: f32, ) -> Result<(), Self::Error> { self.render_texture_from_to( @@ -195,19 +196,20 @@ pub trait Frame { .to_f64() .to_physical(output_scale), ), - transform, + src_transform, alpha, ) } - /// Render part of a texture as given by src to the current target into the rectangle described by dest - /// as a flat 2d-plane after applying the given transformations. + /// Render part of a texture as given by src to the current target into the rectangle described by dst + /// as a flat 2d-plane after applying the inverse of the given transformation. + /// (Meaning `src_transform` should match the orientation of surface being rendered). fn render_texture_from_to( &mut self, texture: &Self::TextureId, src: Rectangle, - dest: Rectangle, - transform: Transform, + dst: Rectangle, + src_transform: Transform, alpha: f32, ) -> Result<(), Self::Error>; } @@ -236,7 +238,7 @@ pub trait Renderer { fn render( &mut self, size: Size, - transform: Transform, + dst_transform: Transform, rendering: F, ) -> Result where