mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 10:21:10 +02:00
implement getWidth4FB_HW_ACC in fb_accel class
This helper to determine alignment for hardware blitting is now in system/helpers.h, where it does not really belong. Put it into the framebuffer class instead. Framebuffers that don't need it will just get a dummy function, the cs_hd2 framebuffer gets the real thing. Also add a bool function that indicates the need for alignment.
This commit is contained in:
committed by
M. Liebmann
parent
7fdc4c7178
commit
b6909fb815
@@ -228,3 +228,20 @@ void CFbAccelCSHD2::setBlendLevel(int level)
|
||||
if (level == 100) // TODO: sucks.
|
||||
usleep(20000);
|
||||
}
|
||||
|
||||
/* align for hw blit */
|
||||
uint32_t CFbAccelCSHD2::getWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max)
|
||||
{
|
||||
uint32_t ret = _w;
|
||||
if ((_x + ret) >= xRes)
|
||||
ret = xRes-_x-1;
|
||||
if (ret%4 == 0)
|
||||
return ret;
|
||||
|
||||
int add = (max) ? 3 : 0;
|
||||
ret = ((ret + add) / 4) * 4;
|
||||
if ((_x + ret) >= xRes)
|
||||
ret -= 4;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user