mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 10:44:01 +00:00
[common] rects: refactor rect buffer copy code to common module
This also fixes a bug of accidentally multiplying the stride by 4 when the stride is already in bytes and not pixels.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "common/option.h"
|
||||
#include "common/framebuffer.h"
|
||||
#include "common/event.h"
|
||||
#include "common/rects.h"
|
||||
#include "common/thread.h"
|
||||
#include "common/KVMFR.h"
|
||||
#include <assert.h>
|
||||
@@ -482,17 +483,6 @@ static CaptureResult nvfbc_waitFrame(CaptureFrame * frame,
|
||||
return CAPTURE_RESULT_OK;
|
||||
}
|
||||
|
||||
inline static void rectCopyUnaligned(uint8_t * dest, uint8_t * src, int ystart,
|
||||
int yend, int dx, int dstStride, int srcStride, int width)
|
||||
{
|
||||
for (int i = ystart; i < yend; ++i)
|
||||
{
|
||||
unsigned int srcOffset = i * srcStride + dx;
|
||||
unsigned int dstOffset = i * dstStride + dx;
|
||||
memcpy(dest + dstOffset, src + srcOffset, width);
|
||||
}
|
||||
}
|
||||
|
||||
static CaptureResult nvfbc_getFrame(FrameBuffer * frame,
|
||||
const unsigned int height, int frameIndex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user