[common] framebuffer: simplify the remaining calculation

The pitches match so there is no need for the added complexity of this
calculation.
This commit is contained in:
Geoffrey McRae 2021-06-08 15:14:54 +10:00
parent 196050bd23
commit 4a75cc3bcf

View File

@ -76,7 +76,7 @@ bool framebuffer_read(const FrameBuffer * frame, void * restrict dst,
// copy in large 1MB chunks if the pitches match // copy in large 1MB chunks if the pitches match
if (dstpitch == pitch) if (dstpitch == pitch)
{ {
size_t remaining = (height - 1) * pitch + dstpitch; size_t remaining = height * pitch;
while(remaining) while(remaining)
{ {
const size_t copy = remaining < FB_CHUNK_SIZE ? remaining : FB_CHUNK_SIZE; const size_t copy = remaining < FB_CHUNK_SIZE ? remaining : FB_CHUNK_SIZE;