mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
gallium: fix Y-inverted copies
Don't require the caller to pass a non-intuitive negative src_y coord anymore when doing a src-inverted copy.
This commit is contained in:
parent
81b1a4224d
commit
f738c3acac
1 changed files with 4 additions and 1 deletions
|
|
@ -37,6 +37,7 @@
|
|||
/**
|
||||
* Copy 2D rect from one place to another.
|
||||
* Position and sizes are in pixels.
|
||||
* src_pitch may be negative to do vertical flip of pixels from source.
|
||||
*/
|
||||
void
|
||||
pipe_copy_rect(ubyte * dst,
|
||||
|
|
@ -52,6 +53,7 @@ pipe_copy_rect(ubyte * dst,
|
|||
int src_y)
|
||||
{
|
||||
unsigned i;
|
||||
int src_pitch_pos = src_pitch < 0 ? -src_pitch : src_pitch;
|
||||
|
||||
assert(cpp > 0);
|
||||
assert(src_x >= 0);
|
||||
|
|
@ -61,10 +63,11 @@ pipe_copy_rect(ubyte * dst,
|
|||
|
||||
dst_pitch *= cpp;
|
||||
src_pitch *= cpp;
|
||||
src_pitch_pos *= cpp;
|
||||
dst += dst_x * cpp;
|
||||
src += src_x * cpp;
|
||||
dst += dst_y * dst_pitch;
|
||||
src += src_y * src_pitch;
|
||||
src += src_y * src_pitch_pos;
|
||||
width *= cpp;
|
||||
|
||||
if (width == dst_pitch && width == src_pitch)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue