cc_draw: add simple debug facility

not perfect, since the borders can be overdrawn afterwards
but still pretty useful
This commit is contained in:
Stefan Seyfried
2017-12-26 22:58:36 +01:00
committed by Thilo Graf
parent bbe2d5b11a
commit 1dc7e185bf

View File

@@ -31,6 +31,9 @@
#include <system/debug.h>
extern CPictureViewer * g_PicViewer;
/* export CCDRAW_DEBUG to paint red lines around all elements */
static bool CCDraw_debug = !!(getenv("CCDRAW_DEBUG"));
CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha)
{
frameBuffer = CFrameBuffer::getInstance();
@@ -551,6 +554,8 @@ void CCDraw::paintFbItems(bool do_save_bg)
if (fbtype == CC_FBDATA_TYPE_BACKGROUND){
frameBuffer->paintBackgroundBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy);
v_fbdata[i].is_painted = true;
if (CCDraw_debug)
frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 1, COL_RED);
continue;
}
}
@@ -684,6 +689,8 @@ void CCDraw::paintFbItems(bool do_save_bg)
}
}
}
if (CCDraw_debug)
frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 1, COL_RED);
}
//set is_painted attribut. if any layer was painted set it to true;