From 1dc7e185bf60fd31db5e083cf16607cabe7fdeb7 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 26 Dec 2017 22:58:36 +0100 Subject: [PATCH] cc_draw: add simple debug facility not perfect, since the borders can be overdrawn afterwards but still pretty useful --- src/gui/components/cc_draw.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index e086ac503..65c47712d 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -31,6 +31,9 @@ #include 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;