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:
Michael Liebmann
2016-01-26 06:16:25 +01:00
parent 93b16ae807
commit dbc216d4ae
2 changed files with 22 additions and 0 deletions

View File

@@ -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;