GernotFrisch
Member
- Joined
- Jan 2, 2007
- Messages
- 445
Hi,
my performance dropped a lot since I reduced tearing. Can this function be written any quicker?
I thought about making it all with macros to get rid of the loops totally... :/
my performance dropped a lot since I reduced tearing. Can this function be written any quicker?
Code:
inline void UpdateDisplay(unsigned short* Buffer, bool Landscape)
{
// 240x320 display -> 320x240 buffer
const unsigned short* pSrc;
unsigned short* pDst;
pSrc=Buffer; pDst = Screen.pRawFrameBuffer; // /dev/fb0
const unsigned short* pLine = Buffer + 319; // "Buffer" is my 320x240 buffer
for(int x=0; x<320; ++x)
{
pSrc = pLine;
for(int y=0; y<240 / 4; ++y)
{
*pDst = *pSrc; pSrc += 320; ++pDst;
*pDst = *pSrc; pSrc += 320; ++pDst;
*pDst = *pSrc; pSrc += 320; ++pDst;
*pDst = *pSrc; pSrc += 320; ++pDst;
}
--pLine;
}
}
I thought about making it all with macros to get rid of the loops totally... :/