mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
helpers.cpp: Add function SetWith4FB_HW_ACC()
align for hw blit on apollo/kronos hw
Origin commit data
------------------
Branch: ni/coolstream
Commit: 2c23f339d3
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-01-26 (Tue, 26 Jan 2016)
Origin message was:
------------------
helpers.cpp: Add function SetWith4FB_HW_ACC()
align for hw blit on apollo/kronos hw
------------------
This commit was generated by Migit
This commit is contained in:
@@ -854,6 +854,26 @@ bool split_config_string(const std::string &str, std::map<std::string,std::strin
|
||||
return !smap.empty();
|
||||
}
|
||||
|
||||
/* align for hw blit */
|
||||
uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max)
|
||||
{
|
||||
uint32_t ret = _w;
|
||||
static uint32_t xRes = 0;
|
||||
if (xRes == 0)
|
||||
xRes = CFrameBuffer::getInstance()->getScreenWidth(true);
|
||||
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;
|
||||
}
|
||||
|
||||
std::vector<std::string> split(const std::string &s, char delim)
|
||||
{
|
||||
std::vector<std::string> vec;
|
||||
|
Reference in New Issue
Block a user