From a0cb2f95f0706179f88dc0175769705ddeded389 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 27 Jun 2014 10:27:04 -0400 Subject: [PATCH] if CANVAS_DEBUG is defined, then the env variable CANVAS_HARLEQUIN_DEBUGGING will turn on drawing the expose areas for canvas render debugging --- libs/canvas/canvas.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index 33ef333c96..242f8ecbfd 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -110,16 +110,17 @@ Canvas::render (Rect const & area, Cairo::RefPtr const & context _root.render (*draw, context); -#if 0 - // This transparently colors the rect being rendered, after it has been drawn. - double r = (random() % 65536) /65536.0; - double g = (random() % 65536) /65536.0; - double b = (random() % 65536) /65536.0; - context->rectangle (draw->x0, draw->y0, draw->x1 - draw->x0, draw->y1 - draw->y0); - context->set_source_rgba (r, g, b, 0.25); - context->fill (); +#ifdef CANVAS_DEBUG + if (getenv ("CANVAS_HARLEQUIN_DEBUGGING")) { + // This transparently colors the rect being rendered, after it has been drawn. + double r = (random() % 65536) /65536.0; + double g = (random() % 65536) /65536.0; + double b = (random() % 65536) /65536.0; + context->rectangle (draw->x0, draw->y0, draw->x1 - draw->x0, draw->y1 - draw->y0); + context->set_source_rgba (r, g, b, 0.25); + context->fill (); + } #endif - } } -- 2.30.2