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) { diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 66d4b8a21..d5a6a6ad3 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -545,11 +546,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 ); @@ -669,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; @@ -680,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); @@ -707,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++; } } @@ -727,42 +730,69 @@ 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 + if (!getActive()) + return NULL; - fb_pixel_t* boxBuf = paintBoxRel2Buf(dx, dy, MASK, NULL, radius, type); - if (!boxBuf) - return NULL; + fb_pixel_t MASK = 0xFFFFFFFF; + int _dx = dx; + int w_align; + int offs_align; +#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); + if (boxBuf == NULL) + return NULL; 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; @@ -1917,6 +1947,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 +2003,52 @@ 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); + add_gxa_sync_marker(); + 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 +2057,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) diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 68722516d..d0d1adc79 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -48,6 +48,8 @@ typedef struct gradientData_t fb_pixel_t* boxBuf; bool direction; int mode; + int x; + int dx; } gradientData_struct_t; #define CORNER_NONE 0x0 @@ -208,7 +210,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/channellist.cpp b/src/gui/channellist.cpp index 9d2f1a47b..f49fef1af 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2074,6 +2074,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/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 0b2a4456e..b744caaff 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; + cc_gradient_bg_cleanup = false; + v_fbdata.clear(); } @@ -534,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 @@ -560,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; } } } @@ -591,6 +597,8 @@ void CCDraw::paintFbItems(bool do_save_bg) } // if found empty gradient buffer, create it, otherwise paint from cache + 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__); fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); @@ -598,7 +606,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__); @@ -607,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; } } } @@ -616,8 +624,6 @@ void CCDraw::paintFbItems(bool do_save_bg) OnAfterPaintLayers(); } - - void CCDraw::hide() { //restore saved screen background of item if available @@ -627,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; } } } @@ -635,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 @@ -660,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) @@ -683,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 152a6359b..50036fd8b 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 cc_gradient_bg_cleanup; + ///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() @@ -312,9 +314,45 @@ 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); }; }; #endif 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; 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/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 diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index a65234f23..34e1b7ee6 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 62c5e2952..b698c6c31 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -655,6 +655,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); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 5beaaeb50..e963a42f0 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -425,6 +425,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(); @@ -432,15 +433,27 @@ 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; + 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, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); - else - body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); + if (body == NULL){ + body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); + }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); @@ -448,6 +461,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); } @@ -668,6 +682,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(); @@ -1635,27 +1652,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){ @@ -1664,6 +1687,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); } } @@ -1676,7 +1701,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) @@ -1684,7 +1711,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){ @@ -1693,7 +1722,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); } } @@ -1988,9 +2019,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()) @@ -2012,11 +2045,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) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 587d582f2..2cf1f66a4 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; } @@ -496,6 +498,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); } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index aa5c4bc27..0bbe1f692 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; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c524fb3bc..c006c27e2 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -811,6 +811,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) @@ -1239,6 +1243,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 @@ -1476,6 +1481,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) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 1ccc0b301..42c9be139 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -820,6 +820,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 85a6d701b..f8a51edfa 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -94,6 +94,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);