From 22c66526daaef7534b272dba039f884e94fa51b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 19 Feb 2017 23:22:12 +0100 Subject: [PATCH 1/2] framebuffer: rename scaleFont() to scale2Res() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e631c3e3c0853c9e9978395ffe6ef2700fe47595 Author: vanhofen Date: 2017-02-19 (Sun, 19 Feb 2017) Origin message was: ------------------ - framebuffer: rename scaleFont() to scale2Res() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_accel.h | 2 +- src/driver/fb_accel_cs_hd2.cpp | 7 ++++++- src/driver/fb_generic.h | 2 +- src/driver/neutrinofonts.cpp | 4 ++-- src/gui/infoclock.cpp | 2 +- src/gui/volumebar.cpp | 6 +++--- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index 40ef3863a..03eac764c 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -129,7 +129,7 @@ class CFbAccelCSHD2 fb_pixel_t * getBackBufferPointer() const; void setBlendMode(uint8_t); void setBlendLevel(int); - int scaleFont(int size); + int scale2Res(int size); bool fullHdAvailable(); void setOsdResolutions(); uint32_t getWidth4FB_HW_ACC(const uint32_t x, const uint32_t w, const bool max=true); diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index b6d9be87f..cf229002b 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -290,8 +290,13 @@ void CFbAccelCSHD2::setBlendLevel(int level) usleep(20000); } -int CFbAccelCSHD2::scaleFont(int size) +int CFbAccelCSHD2::scale2Res(int size) { + /* + The historic resolution 1280x720 is default for some values/sizes. + So let's scale these values to other resolutions. + */ + if (screeninfo.xres == 1920) size += size/2; diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 291bb9af0..b9f0be111 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -277,7 +277,7 @@ class CFrameBuffer : public sigc::trackable virtual void blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff); virtual void mark(int x, int y, int dx, int dy); - virtual int scaleFont(int size) { return size; }; + virtual int scale2Res(int size) { return size; }; virtual bool fullHdAvailable() { return false; }; virtual void setOsdResolutions(); std::vector osd_resolutions; diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 6bbe1e912..d5da1827d 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -180,7 +180,7 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) { if (g_Font[i]) delete g_Font[i]; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - fontSize = CFrameBuffer::getInstance()->scaleFont(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; + fontSize = CFrameBuffer::getInstance()->scale2Res(CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize)) + neutrino_font[i].size_offset * fontDescr.size_offset; #else fontSize = CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset; #endif @@ -188,7 +188,7 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) } if (g_SignalFont) delete g_SignalFont; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - fontSize = CFrameBuffer::getInstance()->scaleFont(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; + fontSize = CFrameBuffer::getInstance()->scale2Res(signal_font.defaultsize) + signal_font.size_offset * fontDescr.size_offset; #else fontSize = signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset; #endif diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index a5c75b7fc..c3f2e7168 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -77,7 +77,7 @@ void CInfoClock::initCCLockItems() //set height, NOTE: height is strictly bound to settings height = g_settings.infoClockFontSize; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - height = CFrameBuffer::getInstance()->scaleFont(height); + height = CFrameBuffer::getInstance()->scale2Res(height); #endif initClockFont(0, height); diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 6ba244f27..6f1f76fe8 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -55,7 +55,7 @@ void CVolumeBar::initVarVolumeBar() vb_item_offset = OFFSET_INNER_SMALL; height = g_settings.volume_size; //default height #ifdef ENABLE_CHANGE_OSD_RESOLUTION - height = CFrameBuffer::getInstance()->scaleFont(height); + height = CFrameBuffer::getInstance()->scale2Res(height); #endif //assume volume value as pointer to global setting @@ -96,7 +96,7 @@ void CVolumeBar::initVolumeBarSize() //scale vb_pbw = 200; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - vb_pbw = CFrameBuffer::getInstance()->scaleFont(vb_pbw); + vb_pbw = CFrameBuffer::getInstance()->scale2Res(vb_pbw); #endif vb_pbh = height-4*vb_item_offset; @@ -370,7 +370,7 @@ void CVolumeHelper::initVolBarSize() g_settings.volume_size = max(g_settings.volume_size, icon_height); vol_height = g_settings.volume_size; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - vol_height = CFrameBuffer::getInstance()->scaleFont(vol_height); + vol_height = CFrameBuffer::getInstance()->scale2Res(vol_height); #endif if (g_settings.volume_digits) { From bb9e1d06e47d9b0ba76431ea2cadd946a222645d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 19 Feb 2017 23:22:12 +0100 Subject: [PATCH 2/2] settings.h: scale RADIUS- and OFFSET-defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/726302f945439c5afd20bfe3b07e41661eb4cdf6 Author: vanhofen Date: 2017-02-19 (Sun, 19 Feb 2017) Origin message was: ------------------ - settings.h: scale RADIUS- and OFFSET-defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/settings.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/system/settings.h b/src/system/settings.h index 3b605f557..48bf18e55 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -906,10 +906,10 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define DEFAULT_LCD_AUTODIMM 0x00 #define DEFAULT_LCD_SHOW_VOLUME 0x01 -#define CORNER_RADIUS_LARGE 11 -#define CORNER_RADIUS_MID 7 -#define CORNER_RADIUS_SMALL 5 -#define CORNER_RADIUS_MIN 3 +#define CORNER_RADIUS_LARGE CFrameBuffer::getInstance()->scale2Res(11) +#define CORNER_RADIUS_MID CFrameBuffer::getInstance()->scale2Res(7) +#define CORNER_RADIUS_SMALL CFrameBuffer::getInstance()->scale2Res(5) +#define CORNER_RADIUS_MIN CFrameBuffer::getInstance()->scale2Res(3) #define CORNER_RADIUS_NONE 0 #define RADIUS_LARGE (g_settings.rounded_corners ? CORNER_RADIUS_LARGE : 0) @@ -919,12 +919,12 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define RADIUS_NONE 0 // offsets -#define OFFSET_SHADOW 6 -#define OFFSET_INTER 6 -#define OFFSET_INNER_LARGE 20 -#define OFFSET_INNER_MID 10 -#define OFFSET_INNER_SMALL 5 -#define OFFSET_INNER_MIN 2 +#define OFFSET_SHADOW CFrameBuffer::getInstance()->scale2Res(6) +#define OFFSET_INTER CFrameBuffer::getInstance()->scale2Res(6) +#define OFFSET_INNER_LARGE CFrameBuffer::getInstance()->scale2Res(20) +#define OFFSET_INNER_MID CFrameBuffer::getInstance()->scale2Res(10) +#define OFFSET_INNER_SMALL CFrameBuffer::getInstance()->scale2Res(5) +#define OFFSET_INNER_MIN CFrameBuffer::getInstance()->scale2Res(2) #define OFFSET_INNER_NONE 0 #define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN