mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
helpers.cpp: Add function SetWith4FB_HW_ACC()
align for hw blit on apollo/kronos hw
Origin commit data
------------------
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 is contained in:
@@ -854,6 +854,26 @@ bool split_config_string(const std::string &str, std::map<std::string,std::strin
|
|||||||
return !smap.empty();
|
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> split(const std::string &s, char delim)
|
||||||
{
|
{
|
||||||
std::vector<std::string> vec;
|
std::vector<std::string> vec;
|
||||||
|
@@ -95,6 +95,8 @@ class CFileHelpers
|
|||||||
static uint64_t getDirSize(const std::string& dir){return getDirSize(dir.c_str());};
|
static uint64_t getDirSize(const std::string& dir){return getDirSize(dir.c_str());};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true);
|
||||||
|
|
||||||
std::string to_string(int);
|
std::string to_string(int);
|
||||||
std::string to_string(unsigned int);
|
std::string to_string(unsigned int);
|
||||||
std::string to_string(long);
|
std::string to_string(long);
|
||||||
|
Reference in New Issue
Block a user