From b49195d6fc9ce69246006dcb1f89f10c33918732 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:15 +0100 Subject: [PATCH 01/20] framebuffer: use hardware accel for blitBox2FB() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1bd0f814bc5056f1744d30850628a7877c6e3c6b Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/driver/framebuffer.cpp | 57 +++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 66d4b8a21..f9178625c 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -545,11 +545,13 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign } stride = _fix.line_length; - printf("FB: %dx%dx%d line length %d. %s nevis GXA accelerator.\n", xRes, yRes, bpp, stride, -#ifdef USE_NEVIS_GXA - "Using" + printf("FB: %dx%dx%d line length %d. %s accelerator.\n", xRes, yRes, bpp, stride, +#if defined(USE_NEVIS_GXA) + "Using nevis GXA" +#elif defined(FB_HW_ACCELERATION) + "Using fb hw graphics" #else - "Not using" + "Not using graphics" #endif ); @@ -1917,6 +1919,7 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 ioctl(fd, FBIO_IMAGE_BLT, &image); } #endif + //printf("\033[34m>>>>\033[0m [%s:%s:%d] FB_HW_ACCELERATION (image) x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); return; } @@ -1972,16 +1975,51 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff) { - checkFbArea(xoff, yoff, width, height, true); + uint32_t xc = (width > xRes) ? (uint32_t)xRes : width; + uint32_t yc = (height > yRes) ? (uint32_t)yRes : height; + checkFbArea(xoff, yoff, xc, yc, true); + +#if defined(FB_HW_ACCELERATION) + if (!(width%4)) { + fb_image image; + image.dx = xoff; + image.dy = yoff; + image.width = xc; + image.height = yc; + image.cmap.len = 0; + image.depth = 32; + image.data = (const char*)boxBuf; + ioctl(fd, FBIO_IMAGE_BLT, &image); + //printf("\033[33m>>>>\033[0m [%s:%s:%d] FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + checkFbArea(xoff, yoff, xc, yc, false); + return; + } + printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); +#elif defined(USE_NEVIS_GXA) + void* uKva = cs_phys_addr((void*)boxBuf); + if(uKva != NULL) { + OpenThreads::ScopedLock m_lock(mutex); + u32 cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(1) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(3); + _write_gxa(gxa_base, GXA_BMP1_TYPE_REG, (3 << 16) | width); + _write_gxa(gxa_base, GXA_BMP1_ADDR_REG, (unsigned int) uKva); + _write_gxa(gxa_base, cmd, GXA_POINT(xoff, yoff)); + _write_gxa(gxa_base, cmd, GXA_POINT(xc, yc)); + _write_gxa(gxa_base, cmd, GXA_POINT(0, 0)); + //printf("\033[33m>>>>\033[0m [%s:%s:%d] USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + checkFbArea(xoff, yoff, xc, yc, false); + return; + } + printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); +#endif uint32_t swidth = stride / sizeof(fb_pixel_t); fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * yoff); fb_pixel_t* data = (fb_pixel_t*)boxBuf; uint32_t line = 0; - while (line < height) { - fb_pixel_t *pixpos = &data[line * width]; - for (uint32_t pos = xoff; pos < xoff + width; pos++) { + while (line < yc) { + fb_pixel_t *pixpos = &data[line * xc]; + for (uint32_t pos = xoff; pos < xoff + xc; pos++) { //don't paint backgroundcolor (*pixpos = 0x00000000) if (*pixpos) *(fbp + pos) = *pixpos; @@ -1990,8 +2028,7 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t fbp += swidth; line++; } - - checkFbArea(xoff, yoff, width, height, false); + checkFbArea(xoff, yoff, xc, yc, false); } void CFrameBuffer::displayRGB(unsigned char *rgbbuff, int x_size, int y_size, int x_pan, int y_pan, int x_offs, int y_offs, bool clearfb, int transp) From 3f8b67f627a609617eaed7767f40c6f08054a7c6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:25 +0100 Subject: [PATCH 02/20] helpers.cpp: Add function SetWith4FB_HW_ACC() align for hw blit on apollo/kronos hw Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c23f339d3a9762244b6768ebcac7c64a8ba782a Author: Michael Liebmann 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 --- src/system/helpers.cpp | 20 ++++++++++++++++++++ src/system/helpers.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index bae705934..de76cb728 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -854,6 +854,26 @@ bool split_config_string(const std::string &str, std::mapgetScreenWidth(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 split(const std::string &s, char delim) { std::vector vec; diff --git a/src/system/helpers.h b/src/system/helpers.h index 205a4f30a..b6da33508 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -95,6 +95,8 @@ class CFileHelpers 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(unsigned int); std::string to_string(long); From b4a84c445eecf9b412134ef8f23e591d90ac2f08 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:29 +0100 Subject: [PATCH 03/20] CFrameBuffer::paintBoxRel2Buf(): Align buffer at 4 byte boundary... ...for hw blit on apollo/kronos hardware Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/95f11ce7af381773ab28f14ae4c04ce1ee815785 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/driver/framebuffer.cpp | 59 +++++++++++++++++++++++----------- src/driver/framebuffer.h | 4 ++- src/gui/components/cc_draw.cpp | 2 +- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index f9178625c..62341d355 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -671,7 +672,7 @@ void CFrameBuffer::paintHLineRelInternal2Buf(const int& x, const int& dx, const *(dest++) = col; } -fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_pixel_t col, fb_pixel_t* buf/* = NULL*/, int radius/* = 0*/, int type/* = CORNER_ALL*/) +fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const int w_align, const int offs_align, const fb_pixel_t col, fb_pixel_t* buf/* = NULL*/, int radius/* = 0*/, int type/* = CORNER_ALL*/) { if (!getActive()) return buf; @@ -682,13 +683,13 @@ fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_p fb_pixel_t* pixBuf = buf; if (pixBuf == NULL) { - pixBuf = (fb_pixel_t*) cs_malloc_uncached(dx*dy*sizeof(fb_pixel_t)); + pixBuf = (fb_pixel_t*) cs_malloc_uncached(w_align*dy*sizeof(fb_pixel_t)); if (pixBuf == NULL) { dprintf(DEBUG_NORMAL, "[%s #%d] Error cs_malloc_uncached\n", __func__, __LINE__); return NULL; } } - memset((void*)pixBuf, '\0', dx*dy*sizeof(fb_pixel_t)); + memset((void*)pixBuf, '\0', w_align*dy*sizeof(fb_pixel_t)); if (type && radius) { setCornerFlags(type); @@ -709,16 +710,16 @@ fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_p line++; continue; } - paintHLineRelInternal2Buf(ofl, dx-ofl-ofr, line, dx, col, pixBuf); + paintHLineRelInternal2Buf(ofl+offs_align, dx-ofl-ofr, line, w_align, col, pixBuf); line++; } } else { fb_pixel_t *bp = pixBuf; int line = 0; while (line < dy) { - for (int pos = 0; pos < dx; pos++) + for (int pos = offs_align; pos < dx+offs_align; pos++) *(bp + pos) = col; - bp += dx; + bp += w_align; line++; } } @@ -729,42 +730,64 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co const fb_pixel_t /*col*/, gradientData_t *gradientData, int radius, int type) { -#define MASK 0xFFFFFFFF + fb_pixel_t MASK = 0xFFFFFFFF; + int _dx = dx; + int w_align; + int offs_align; - fb_pixel_t* boxBuf = paintBoxRel2Buf(dx, dy, MASK, NULL, radius, type); - if (!boxBuf) - return NULL; +#ifdef BOXMODEL_APOLLO + if (_dx%4 != 0) { + w_align = GetWidth4FB_HW_ACC(x, _dx, true); + if (w_align < _dx) + _dx = w_align; + offs_align = w_align - _dx; + if ((x - offs_align) < 0) + offs_align = 0; + } + else { + w_align = _dx; + offs_align = 0; + } +#else + w_align = _dx; + offs_align = 0; +#endif + fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf; + gradientData->x = x - offs_align; + gradientData->dx = w_align; if (gradientData->direction == gradientVertical) { // vertical - for (int pos = 0; pos < dx; pos++) { + for (int pos = offs_align; pos < _dx+offs_align; pos++) { for(int count = 0; count < dy; count++) { if (*(bp + pos) == MASK) *(bp + pos) = (fb_pixel_t)(*(gra + count)); - bp += dx; + bp += w_align; } bp = boxBuf; } } else { // horizontal for (int line = 0; line < dy; line++) { - for (int pos = 0; pos < dx; pos++) { - if (*(bp + pos) == MASK) - *(bp + pos) = (fb_pixel_t)(*(gra + pos)); + int gra_pos = 0; + for (int pos = 0; pos < w_align; pos++) { + if ((*(bp + pos) == MASK) && (pos >= offs_align) && (gra_pos < _dx)) { + *(bp + pos) = (fb_pixel_t)(*(gra + gra_pos)); + gra_pos++; + } } - bp += dx; + bp += w_align; } } if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) return boxBuf; -// blit2FB(boxBuf, dx, dy, x, y); - blitBox2FB(boxBuf, dx, dy, x, y); + blitBox2FB(boxBuf, w_align, dy, x-offs_align, y); if ((gradientData->mode & pbrg_noFree) == pbrg_noFree) return boxBuf; diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 79c70450f..6ee46df62 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -46,6 +46,8 @@ typedef struct gradientData_t fb_pixel_t* boxBuf; bool direction; int mode; + int x; + int dx; } gradientData_struct_t; #define CORNER_NONE 0x0 @@ -206,7 +208,7 @@ class CFrameBuffer : public sigc::trackable }; void paintPixel(int x, int y, const fb_pixel_t col); - fb_pixel_t* paintBoxRel2Buf(const int dx, const int dy, const fb_pixel_t col, fb_pixel_t* buf = NULL, int radius = 0, int type = CORNER_ALL); + fb_pixel_t* paintBoxRel2Buf(const int dx, const int dy, const int w_align, const int offs_align, const fb_pixel_t col, fb_pixel_t* buf = NULL, int radius = 0, int type = CORNER_ALL); fb_pixel_t* paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, gradientData_t *gradientData, int radius = 0, int type = CORNER_ALL); void paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 0b2a4456e..41b2c1802 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -598,7 +598,7 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); }else{ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); - frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.dx, fbdata.dy, fbdata.x, fbdata.y); + frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); } }else{ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); From 1db2e302416456c3209ead4d5b4553d0f1d3e4ed Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:32 +0100 Subject: [PATCH 04/20] CComponentsPicture: Align pictures at 4 byte boundary... ...for hw blit on apollo/kronos hardware Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/346b28556f579763a241255124d69f73a8111235 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/components/cc_item_picture.cpp | 5 +++++ src/gui/moviebrowser.cpp | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index c5ede3520..b6e0d1b82 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -33,6 +33,7 @@ #include "cc_item_picture.h" #include #include +#include extern CPictureViewer * g_PicViewer; @@ -196,6 +197,10 @@ void CComponentsPicture::initCCItem() if (keep_dx_aspect){ float h_ratio = float(height)*100/(float)dy; width = int(h_ratio*(float)dx/100); +#ifdef BOXMODEL_APOLLO + if (do_scale && (width > 10 || height > 10)) + width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; +#endif } if (keep_dy_aspect){ float w_ratio = float(width)*100/(float)dx; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 29b4667bc..5b38a3af5 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1347,10 +1347,6 @@ void CMovieBrowser::refreshMovieInfo(void) if (logo_ok) { flogo_w = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); flogo_h = m_cBoxFrameInfo.iHeight; -#ifdef BOXMODEL_APOLLO - /* align for hw blit */ - flogo_w = ((flogo_w + 3) / 4) * 4; -#endif } static int logo_w = 0; From 32e2150f7578a876ee45ba70dbe16fb7178cad78 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:35 +0100 Subject: [PATCH 05/20] CCDraw: Add function for cleanup gradient background Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf0f63467d280d8b753086e2228a48de1c50f618 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/components/cc_draw.cpp | 6 ++++-- src/gui/components/cc_draw.h | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 41b2c1802..1140fbcd5 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -71,6 +71,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; + gradientBgCleanUp = false; + v_fbdata.clear(); } @@ -591,6 +593,8 @@ void CCDraw::paintFbItems(bool do_save_bg) } // if found empty gradient buffer, create it, otherwise paint from cache + if (gradientBgCleanUp) + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); if (fbdata.gradient_data->boxBuf == NULL){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint new gradient)...\033[0m\n", __func__, __LINE__); fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); @@ -616,8 +620,6 @@ void CCDraw::paintFbItems(bool do_save_bg) OnAfterPaintLayers(); } - - void CCDraw::hide() { //restore saved screen background of item if available diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 152a6359b..f1d3d4092 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -142,6 +142,8 @@ class CCDraw : public COSDFader, public CComponentsSignals ///sub: get gradient data evaluted with current parameters gradientData_t* getGradientData(); + bool gradientBgCleanUp; + ///rendering of framebuffer elements at once, ///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(), ///parameter do_save_bg=true, saves background of element to pixel buffer, this can be restore with hide() @@ -315,6 +317,9 @@ class CCDraw : public COSDFader, public CComponentsSignals ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); + + virtual void enableGradientBgCleanUp(bool enable = true) { gradientBgCleanUp = enable; }; + virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; }; #endif From c1d88da12d82dc0c17f4cc26c419574918b09066 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 26 Jan 2016 06:16:39 +0100 Subject: [PATCH 06/20] CCDraw: use ccdraw namespace Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/063ccbb6226b4a15c9f212daaea3ddb6b7531a64 Author: Thilo Graf Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/components/cc_draw.cpp | 4 ++-- src/gui/components/cc_draw.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 1140fbcd5..8a9903510 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -71,7 +71,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; - gradientBgCleanUp = false; + cc_gradient_bg_cleanup = false; v_fbdata.clear(); } @@ -593,7 +593,7 @@ void CCDraw::paintFbItems(bool do_save_bg) } // if found empty gradient buffer, create it, otherwise paint from cache - if (gradientBgCleanUp) + if (cc_gradient_bg_cleanup) frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); if (fbdata.gradient_data->boxBuf == NULL){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint new gradient)...\033[0m\n", __func__, __LINE__); diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index f1d3d4092..d1381c591 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -142,7 +142,7 @@ class CCDraw : public COSDFader, public CComponentsSignals ///sub: get gradient data evaluted with current parameters gradientData_t* getGradientData(); - bool gradientBgCleanUp; + bool cc_gradient_bg_cleanup; ///rendering of framebuffer elements at once, ///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(), @@ -318,7 +318,7 @@ class CCDraw : public COSDFader, public CComponentsSignals ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); - virtual void enableGradientBgCleanUp(bool enable = true) { gradientBgCleanUp = enable; }; + virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; }; virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; }; From ffa73a3241b563456dfb54c55ed1ead4b90b45e9 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 06:16:42 +0100 Subject: [PATCH 07/20] CMenuWidget: Enable cleanup gradient background for menu hints... ... and for menu headers when save screen is enabled Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ef9246d89214e6831adb65557d605589f61c864a Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/widget/menue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c27be79e9..16e4c5818 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1240,6 +1240,7 @@ void CMenuWidget::paint() header->setColorShadow(COL_MENUCONTENTDARK_PLUS_0); header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); + header->enableGradientBgCleanUp(savescreen); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow @@ -1477,6 +1478,7 @@ void CMenuWidget::paintHint(int pos) info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_INFOBAR_SHADOW_PLUS_1 is default footer color + info_box->enableGradientBgCleanUp(); //paint result if (details_line) From c0c76986583c66d36ae8aa88fb3f420442619d9a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 26 Jan 2016 14:11:33 +0100 Subject: [PATCH 08/20] jsoncpp.cpp: re-apply gcc version compil fix Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a72274efbbb8e9d4eb8704ff68505acb96f9b36 Author: Jacek Jendrzej Date: 2016-01-26 (Tue, 26 Jan 2016) --- lib/jsoncpp/jsoncpp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/jsoncpp/jsoncpp.cpp b/lib/jsoncpp/jsoncpp.cpp index be5a16b3b..5c2825a2e 100644 --- a/lib/jsoncpp/jsoncpp.cpp +++ b/lib/jsoncpp/jsoncpp.cpp @@ -219,7 +219,11 @@ static int stackDepth_g = 0; // see readValue() namespace Json { +#if __cplusplus >= 201103L +typedef std::unique_ptr CharReaderPtr; +#else typedef std::auto_ptr CharReaderPtr; +#endif // Implementation of class Features // //////////////////////////////// @@ -3761,7 +3765,11 @@ Value& Path::make(Value& root) const { namespace Json { +#if __cplusplus >= 201103L +typedef std::unique_ptr StreamWriterPtr; +#else typedef std::auto_ptr StreamWriterPtr; +#endif static bool containsControlCharacter(const char* str) { while (*str) { From 11d20c5d6c7191a5bfd738f9ba9f89d457921f8d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 24 Jan 2016 16:08:59 +0100 Subject: [PATCH 09/20] CCDraw: add member to remove shadow only Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f521e32981f516a51d9934216bbb6765a5496b1b Author: Thilo Graf Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/components/cc_draw.cpp | 32 +++++++++++++++++++++------- src/gui/components/cc_draw.h | 39 +++++++++++++++++++++++++++++++--- src/gui/components/cc_types.h | 12 +++++------ 3 files changed, 66 insertions(+), 17 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 8a9903510..b744caaff 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -536,16 +536,19 @@ void CCDraw::paintFbItems(bool do_save_bg) */ if (cc_enable_frame){ if (fbtype == CC_FBDATA_TYPE_FRAME) { - if (fbdata.frame_thickness > 0 && cc_allow_paint) + if (fbdata.frame_thickness > 0 && cc_allow_paint){ frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.frame_thickness, fbdata.color, fbdata.r, fbdata.rtype); + v_fbdata[i].is_painted = true; + } } } if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BACKGROUND){ frameBuffer->paintBackgroundBoxRel(x, y, fbdata.dx, fbdata.dy); + v_fbdata[i].is_painted = true; } } - if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && (!is_painted || shadow_force)) { + if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force)) { if (fbdata.enabled) { /* here we paint the shadow around the body * on 1st step we check for already cached screen buffer, if true @@ -562,6 +565,7 @@ void CCDraw::paintFbItems(bool do_save_bg) //if is paint cache enabled if (cc_paint_cache && fbdata.pixbuf == NULL) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + fbdata.is_painted = true; } } } @@ -611,7 +615,7 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } - is_painted = true; + is_painted = v_fbdata[i].is_painted = true; } } } @@ -629,6 +633,7 @@ void CCDraw::hide() //restore screen from backround layer frameBuffer->waitForIdle("CCDraw::hide()"); frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); + v_fbdata[i].is_painted = false; } } } @@ -637,9 +642,10 @@ void CCDraw::hide() } //erase or paint over rendered objects -void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius) +void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type /*fbdata_type*/) { for(size_t i =0; i< v_fbdata.size() ;i++){ + if (fblayer_type == CC_FBDATA_TYPES || v_fbdata[i].fbdata_type & fblayer_type){ #if 0 if (bg_color != COL_BACKGROUND_PLUS_0) #endif @@ -662,15 +668,23 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius) bg_color, r, corner_type); - + v_fbdata[i].is_painted = false; #if 0 else frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); #endif + } } - firstPaint = true; - is_painted = false; + if (fblayer_type == CC_FBDATA_TYPE_BOX){ + firstPaint = true; + is_painted = false; + } +} + +void CCDraw::killShadow(const fb_pixel_t& bg_color, const int& corner_radius) +{ + kill(bg_color, corner_radius, CC_FBDATA_TYPE_SHADOW_BOX); } bool CCDraw::doPaintBg(bool do_paint) @@ -685,8 +699,10 @@ bool CCDraw::doPaintBg(bool do_paint) void CCDraw::enableShadow(int mode, const int& shadow_width, bool force_paint) { - if (shadow != mode) + if (shadow != mode){ + killShadow(); shadow = mode; + } if (shadow != CC_SHADOW_OFF) if (shadow_width != -1) setShadowWidth(shadow_width); diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index d1381c591..50036fd8b 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -314,9 +314,42 @@ class CCDraw : public COSDFader, public CComponentsSignals */ virtual void hide(); - ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known - ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); + /**Erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + * from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] corner_radius optional, defined corner radius, default radius is the current defined radius + * @param[in] fblayer_type optional, defines layer that to remove, default all layers (cc_fbdata_t) will remove + * possible layer types are: + * @li CC_FBDATA_TYPE_BGSCREEN, + * @li CC_FBDATA_TYPE_BOX, + * @li CC_FBDATA_TYPE_SHADOW_BOX, + * @li CC_FBDATA_TYPE_FRAME, + * @li CC_FBDATA_TYPE_BACKGROUND, + * @see + * cc_types.h + * gui/color.h + * driver/framebuffer.h + * @todo + * Shadow paint must be reworked, because dimensions of shadow containes not the real defined size. Parts of item are killed too. + * + */ + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES); + + /**Erase shadow around rendered item. + * This is similar with the kill() member, but shadow will be handled only. + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] corner_radius optional, defined corner radius, default radius is the current defined radius + * + * @see + * kill() + */ + virtual void killShadow(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; }; virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index cb135fe6a..549bf2c30 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -90,13 +90,13 @@ typedef struct cc_fbdata_t //fb data object layer types typedef enum { - CC_FBDATA_TYPE_BGSCREEN, - CC_FBDATA_TYPE_BOX, - CC_FBDATA_TYPE_SHADOW_BOX, - CC_FBDATA_TYPE_FRAME, - CC_FBDATA_TYPE_BACKGROUND, + CC_FBDATA_TYPE_BGSCREEN = 1, + CC_FBDATA_TYPE_BOX = 2, + CC_FBDATA_TYPE_SHADOW_BOX = 4, + CC_FBDATA_TYPE_FRAME = 8, + CC_FBDATA_TYPE_BACKGROUND = 16, - CC_FBDATA_TYPES + CC_FBDATA_TYPES = 32 }FBDATA_TYPES; //fb color gradient types From 45bab5a66daa6d656e0d56e0c39434dd0e79bd97 Mon Sep 17 00:00:00 2001 From: defans Date: Sun, 24 Jan 2016 16:13:55 +0100 Subject: [PATCH 10/20] CInfoViewer: reset zapmode if not in default mode Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/12c3a15c10081362861916a63edfcc4e0aa38289 Author: defans Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/infoviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ac27fe96c..3a179b140 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -665,6 +665,9 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { + if(!calledFromNumZap && zap_mode != IV_MODE_DEFAULT) + resetSwitchMode(); + std::string Channel = channel->getName(); t_satellite_position satellitePosition = channel->getSatellitePosition(); t_channel_id new_channel_id = channel->getChannelID(); From 674e1f34c50657db0513d07ba9b2338c45a36f83 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 24 Jan 2016 16:16:49 +0100 Subject: [PATCH 11/20] CComponentsItem: reset paint mode after cleanup Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/107c3234b2ff2094996d5d0baf35a8b2d95ff23f Author: Thilo Graf Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/components/cc_item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 4f9b242c4..0f8b32963 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -65,8 +65,10 @@ void CComponentsItem::initParent(CComponentsForm* parent) // If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this! void CComponentsItem::paintInit(bool do_save_bg) { - if (hasChanges()) + if (hasChanges()){ clearFbData(); + is_painted = false; //force repaint if required + } if (v_fbdata.empty()){ int th = fr_thickness; From f71b4084e9cb31a147d2c4568424be0fc6af7665 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 24 Jan 2016 16:17:48 +0100 Subject: [PATCH 12/20] CInfoViewer: remove shadow offset from init, items works with its own values Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/da0b86709852a911f99dd71d7a470cfe2ac359be Author: Thilo Graf Date: 2016-01-24 (Sun, 24 Jan 2016) --- src/gui/infoviewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 3a179b140..2840846bb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -429,7 +429,7 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { - int h_body = InfoHeightY - header_height + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int h_body = InfoHeightY - header_height - SHADOW_OFFSET + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); @@ -1984,9 +1984,11 @@ void CInfoViewer::killTitle() { is_visible = false; infoViewerBB->is_visible = false; +#if 0 //unused int bottom = BoxEndY + SHADOW_OFFSET + infoViewerBB->bottom_bar_offset; if (showButtonBar) bottom += infoViewerBB->InfoHeightY_Info; +#endif if (infoViewerBB->getFooter()) infoViewerBB->getFooter()->kill(); if (infoViewerBB->getCABar()) From 2e73c3be8c7f88d9d6ba63a75305306c0b8cf8a8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 23 Jan 2016 18:32:18 +0100 Subject: [PATCH 13/20] CInfoViewer: unified vars for body position Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b23e3c15c3703bb8ccfd377270c2b37a37129726 Author: Thilo Graf Date: 2016-01-23 (Sat, 23 Jan 2016) --- src/gui/infoviewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 2840846bb..4e79c8c30 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -430,14 +430,15 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { int h_body = InfoHeightY - header_height - SHADOW_OFFSET + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int y_body = ChanNameY + header_height; if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); if (body == NULL) - body = new CComponentsShapeSquare(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); + body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); else - body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); + body->setDimensionsAll(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); //set corner and shadow modes, consider virtual zap mode body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); From 4e4167008d22c42757e8e9f7747ce44d3c42ea07 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 23 Jan 2016 22:34:08 +0100 Subject: [PATCH 14/20] CInfoViewer: try to fix shadow and background behavior in vzap mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4cded5afb65af521699d0507046caa22a143825a Author: Thilo Graf Date: 2016-01-23 (Sat, 23 Jan 2016) --- src/gui/infoviewer.cpp | 49 +++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 4e79c8c30..bb8b5d28d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -435,10 +435,21 @@ void CInfoViewer::paintBody() if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); - if (body == NULL) + if (body == NULL){ body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); - else + }else{ + if(txt_cur_event && txt_next_event){ + if (h_body != body->getHeight() || y_body != body->getYPos()){ + txt_cur_start->getCTextBoxObject()->clearScreenBuffer(); + txt_cur_event->getCTextBoxObject()->clearScreenBuffer(); + txt_cur_event_rest->getCTextBoxObject()->clearScreenBuffer(); + txt_next_start->getCTextBoxObject()->clearScreenBuffer(); + txt_next_event->getCTextBoxObject()->clearScreenBuffer(); + txt_next_in->getCTextBoxObject()->clearScreenBuffer(); + } + } body->setDimensionsAll(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); + } //set corner and shadow modes, consider virtual zap mode body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); @@ -1636,27 +1647,33 @@ void CInfoViewer::display_Info(const char *current, const char *next, bool colored_event_C = (g_settings.theme.colored_events_infobar == 1); bool colored_event_N = (g_settings.theme.colored_events_infobar == 2); + bool restore = false; + if (txt_cur_event){ + if (txt_cur_event_rest && txt_cur_event_rest->isPainted() && txt_cur_event && txt_cur_event->isPainted()) + restore = true; + } + //current event if (current && update_current){ if (txt_cur_event == NULL) txt_cur_event = new CComponentsTextTransp(NULL, xStart, CurrInfoY - height, currTimeX - xStart - 5, height); else txt_cur_event->setDimensionsAll(xStart, CurrInfoY - height, currTimeX - xStart - 5, height); + txt_cur_event->setText(current, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - - if (txt_cur_event_rest && txt_cur_event_rest->isPainted()) - txt_cur_event_rest->hide(); - if (txt_cur_event && txt_cur_event->isPainted()) + if (restore) txt_cur_event->hide(); - txt_cur_event->paint(CC_SAVE_SCREEN_YES); + if (runningStart){ if (txt_cur_start == NULL) txt_cur_start = new CComponentsTextTransp(NULL, InfoX, CurrInfoY - height, info_time_width, height); else txt_cur_start->setDimensionsAll(InfoX, CurrInfoY - height, info_time_width, height); txt_cur_start->setText(runningStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_cur_start->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_cur_event->hide(); + txt_cur_start->paint(CC_SAVE_SCREEN_YES); } if (runningRest){ @@ -1665,6 +1682,8 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_cur_event_rest->setDimensionsAll(currTimeX, CurrInfoY - height, currTimeW, height); txt_cur_event_rest->setText(runningRest, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); + if (restore) + txt_cur_event_rest->hide(); txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES); } } @@ -1677,7 +1696,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_event->setDimensionsAll(xStart, NextInfoY, nextTimeX - xStart - 5, height); txt_next_event->setText(next, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_event->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_next_event->hide(); + txt_next_event->paint(CC_SAVE_SCREEN_YES); if (nextStart){ if (txt_next_start == NULL) @@ -1685,7 +1706,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_start->setDimensionsAll(InfoX, NextInfoY, info_time_width, height); txt_next_start->setText(nextStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_start->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_next_start->hide(); + txt_next_start->paint(CC_SAVE_SCREEN_YES); } if (nextDuration){ @@ -1694,7 +1717,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_in->setDimensionsAll(nextTimeX, NextInfoY, nextTimeW, height); txt_next_in->setText(nextDuration, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_in->paint(CC_SAVE_SCREEN_NO); + if (restore) + txt_next_in->hide(); + txt_next_in->paint(CC_SAVE_SCREEN_YES); } } @@ -2011,11 +2036,11 @@ void CInfoViewer::killTitle() clock->kill(); #endif body->kill(); +#if 0 //not really required to kill epg infos, body does this if (txt_cur_event) txt_cur_event->kill(); if (txt_cur_event_rest) txt_cur_event_rest->kill(); -#if 0 //not really required to kill epg infos, body does this if (txt_cur_start) txt_cur_start->kill(); if (txt_next_start) From 5c87e0646a31575aff1ec70308dabe99e354c47f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 25 Jan 2016 15:53:26 +0100 Subject: [PATCH 15/20] CMenuWidget: try to fix possible overlength of details line Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a338357fcca6a9a4e7b788976786a6f84abe58d Author: Jacek Jendrzej Date: 2016-01-25 (Mon, 25 Jan 2016) --- src/gui/widget/menue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 16e4c5818..40c4141c9 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -812,6 +812,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if (titem->isSelectable()) { items[selected]->paint( false ); selected= i; + if (selected > page_start[current_page + 1] || selected < page_start[current_page]) { + /* different page */ + paintItems(); + } paintHint(selected); pos = selected; if (titem->directKeyOK) From 3d0eca59b699b2b355b8b1d79b5f97e1bba01f50 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 26 Jan 2016 13:29:00 +0100 Subject: [PATCH 16/20] Fix ghost text in infoviewer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8dd426d7140d6daa1d06457f852bf7074dfe8993 Author: Michael Liebmann Date: 2016-01-26 (Tue, 26 Jan 2016) --- src/gui/infoviewer.cpp | 2 ++ src/gui/infoviewer_bb.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index bb8b5d28d..e4f1ca1d8 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -422,6 +422,7 @@ void CInfoViewer::paintHead() header->setColorBody(g_settings.theme.infobar_gradient_top ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); header->enableColBodyGradient(g_settings.theme.infobar_gradient_top, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_top_direction); clock->setColorBody(header->getColorBody()); + header->enableGradientBgCleanUp(); header->paint(CC_SAVE_SCREEN_NO); header_height = header->getHeight(); @@ -457,6 +458,7 @@ void CInfoViewer::paintBody() body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); + body->enableGradientBgCleanUp(); body->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index e95d645cc..16dccc572 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -496,6 +496,7 @@ void CInfoViewerBB::paintFoot(int w) foot->setColorBody(COL_INFOBAR_BUTTONS_BACKGROUND); foot->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_bottom_direction); foot->setCorner(RADIUS_LARGE, CORNER_BOTTOM); + foot->enableGradientBgCleanUp(); foot->paint(CC_SAVE_SCREEN_NO); } From 97693201cb4ec9506e076de29da9d8291acf4e40 Mon Sep 17 00:00:00 2001 From: defans Date: Wed, 27 Jan 2016 00:13:17 +0100 Subject: [PATCH 17/20] infoviewer: simplify body height calculation Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fcd8352daf026fe27f2968e7e5b03641d707ae6a Author: defans Date: 2016-01-27 (Wed, 27 Jan 2016) Origin message was: ------------------ - infoviewer: simplify body height calculation --- src/gui/infoviewer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e4f1ca1d8..26bd0dd1c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -430,11 +430,11 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { - int h_body = InfoHeightY - header_height - SHADOW_OFFSET + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); - int y_body = ChanNameY + header_height; + int h_body = InfoHeightY - header_height - SHADOW_OFFSET; + if (!zap_mode) + h_body += infoViewerBB->bottom_bar_offset; - if(zap_mode) - h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int y_body = ChanNameY + header_height; if (body == NULL){ body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); From 581164437616dd3cd37f5b01d7489180cd6d25d2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 27 Jan 2016 10:04:19 +0100 Subject: [PATCH 18/20] Fix osd error on nevis Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/87e6f328dd429fd09b13bb236951cab1758c350d Author: Michael Liebmann Date: 2016-01-27 (Wed, 27 Jan 2016) --- src/driver/framebuffer.cpp | 1 + src/gui/infoviewer_bb.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 62341d355..dba43f397 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -2030,6 +2030,7 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t _write_gxa(gxa_base, cmd, GXA_POINT(xc, yc)); _write_gxa(gxa_base, cmd, GXA_POINT(0, 0)); //printf("\033[33m>>>>\033[0m [%s:%s:%d] USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + add_gxa_sync_marker(); checkFbArea(xoff, yoff, xc, yc, false); return; } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 16dccc572..3673ca78e 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -407,6 +407,8 @@ void CInfoViewerBB::showBBButtons(bool paintFooter) frameBuffer->SaveScreen(buf_x, buf_y, buf_w, buf_h, pixbuf); paintFoot(); if (pixbuf != NULL) { + if (g_settings.theme.infobar_gradient_bottom) + frameBuffer->waitForIdle("CInfoViewerBB::showBBButtons"); frameBuffer->RestoreScreen(buf_x, buf_y, buf_w, buf_h, pixbuf); delete [] pixbuf; } From 953724caa2d70854be7616a8437ed7badd53cfbf Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 27 Jan 2016 14:59:07 +0100 Subject: [PATCH 19/20] Fix ghost text in channellist & epg view Complement to commit 3d0eca5 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d85bb1d09b4d1437b2883ab20e4bc8bbbf6d933d Author: Michael Liebmann Date: 2016-01-27 (Wed, 27 Jan 2016) Origin message was: ------------------ Fix ghost text in channellist & epg view Complement to commit 3d0eca5 --- src/gui/channellist.cpp | 1 + src/gui/epgplus.cpp | 1 + src/gui/epgview.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 17655dc91..b61ee8883 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2066,6 +2066,7 @@ void CChannelList::paintHead() } header->setDimensionsAll(x, y, full_width, theight); + header->enableGradientBgCleanUp(); if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked != g_settings.parentallock_defaultlocked) header->setIcon(NEUTRINO_ICON_LOCK); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index bf91e3088..b6ba031e5 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -127,6 +127,7 @@ void EpgPlus::Header::paint(const char * Name) std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head); + header.enableGradientBgCleanUp(); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 97deca924..dd901dc87 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -646,6 +646,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); } + header->enableGradientBgCleanUp(); std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); headerText->doPaintBg(false); From cd6a46b7e0905c744aa43b5617074ebb0a34a671 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 28 Jan 2016 01:47:45 +0100 Subject: [PATCH 20/20] CFrameBuffer::paintBoxRel: Fix segfault in standby mode and fix segfault when paintBoxRel2Buf() returns NULL Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/86278623a6e9c5a99b5720c5a5c5189fa55989d9 Author: Michael Liebmann Date: 2016-01-28 (Thu, 28 Jan 2016) Origin message was: ------------------ CFrameBuffer::paintBoxRel: Fix segfault in standby mode and fix segfault when paintBoxRel2Buf() returns NULL --- src/driver/framebuffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index dba43f397..d5a6a6ad3 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -730,6 +730,9 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co const fb_pixel_t /*col*/, gradientData_t *gradientData, int radius, int type) { + if (!getActive()) + return NULL; + fb_pixel_t MASK = 0xFFFFFFFF; int _dx = dx; int w_align; @@ -754,6 +757,8 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co #endif fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); + if (boxBuf == NULL) + return NULL; fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf;