[host] nvfbc: cosmetics

This commit is contained in:
Geoffrey McRae 2023-11-11 09:08:56 +11:00
parent cb849b287c
commit 27f3af8221

View File

@ -743,11 +743,19 @@ static CaptureResult nvfbc_getFrame(FrameBuffer * frame, int frameIndex)
this->diffMap[y * w + x2])) this->diffMap[y * w + x2]))
++x2; ++x2;
unsigned int width = (min(x2 << this->diffShift, this->grabWidth) - unsigned int xstart = x << this->diffShift;
(x << this->diffShift)) * this->bpp; unsigned int xend = min(x2 << this->diffShift, this->grabWidth);
rectCopyUnaligned(frameData, this->frameBuffer, ystart, yend, unsigned int width = xend - xstart;
(x << this->diffShift) * this->bpp, this->shmStride * this->bpp,
this->grabStride * this->bpp, width); rectCopyUnaligned(
frameData,
this->frameBuffer,
ystart,
yend,
xstart * this->bpp,
this->shmStride * this->bpp,
this->grabStride * this->bpp,
width * this->bpp);
x = x2; x = x2;
} }
@ -759,9 +767,16 @@ static CaptureResult nvfbc_getFrame(FrameBuffer * frame, int frameIndex)
for (int y = 0; y < this->dataHeight; y += 64) for (int y = 0; y < this->dataHeight; y += 64)
{ {
int yend = min(this->dataHeight, y + 128); int yend = min(this->dataHeight, y + 128);
rectCopyUnaligned(frameData, this->frameBuffer, y, yend, 0, rectCopyUnaligned(
this->shmStride * this->bpp, this->grabStride * this->bpp, frameData,
this->frameBuffer,
y,
yend,
0,
this->shmStride * this->bpp,
this->grabStride * this->bpp,
this->grabWidth * this->bpp); this->grabWidth * this->bpp);
framebuffer_set_write_ptr(frame, yend * this->shmStride * this->bpp); framebuffer_set_write_ptr(frame, yend * this->shmStride * this->bpp);
} }
} }