renderer: rename function parameters for clearer purpose

This commit is contained in:
Victor Brekenfeld 2021-10-25 15:52:06 +02:00 committed by Victor Berger
parent 011a7da665
commit 87069f26e9
1 changed files with 9 additions and 7 deletions

View File

@ -175,13 +175,14 @@ pub trait Frame {
/// Render a texture to the current target as a flat 2d-plane at a given /// 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. /// 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( fn render_texture_at(
&mut self, &mut self,
texture: &Self::TextureId, texture: &Self::TextureId,
pos: Point<f64, Physical>, pos: Point<f64, Physical>,
texture_scale: i32, texture_scale: i32,
output_scale: f64, output_scale: f64,
transform: Transform, src_transform: Transform,
alpha: f32, alpha: f32,
) -> Result<(), Self::Error> { ) -> Result<(), Self::Error> {
self.render_texture_from_to( self.render_texture_from_to(
@ -195,19 +196,20 @@ pub trait Frame {
.to_f64() .to_f64()
.to_physical(output_scale), .to_physical(output_scale),
), ),
transform, src_transform,
alpha, alpha,
) )
} }
/// Render part of a texture as given by src to the current target into the rectangle described by dest /// 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 given transformations. /// 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( fn render_texture_from_to(
&mut self, &mut self,
texture: &Self::TextureId, texture: &Self::TextureId,
src: Rectangle<i32, Buffer>, src: Rectangle<i32, Buffer>,
dest: Rectangle<f64, Physical>, dst: Rectangle<f64, Physical>,
transform: Transform, src_transform: Transform,
alpha: f32, alpha: f32,
) -> Result<(), Self::Error>; ) -> Result<(), Self::Error>;
} }
@ -236,7 +238,7 @@ pub trait Renderer {
fn render<F, R>( fn render<F, R>(
&mut self, &mut self,
size: Size<i32, Physical>, size: Size<i32, Physical>,
transform: Transform, dst_transform: Transform,
rendering: F, rendering: F,
) -> Result<R, Self::Error> ) -> Result<R, Self::Error>
where where