mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +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.
Origin commit data
------------------
Branch: ni/coolstream
Commit: b6909fb815
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-14 (Tue, 14 Feb 2017)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Michael Liebmann
parent
248fd86b6a
commit
ddb457bc90
@@ -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