if CANVAS_DEBUG is defined, then the env variable CANVAS_HARLEQUIN_DEBUGGING will...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 27 Jun 2014 14:27:04 +0000 (10:27 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 27 Jun 2014 14:27:04 +0000 (10:27 -0400)
libs/canvas/canvas.cc

index 33ef333c963d3a06b5985189ec31a796405bfdd7..242f8ecbfd20acadf161e7df36b3b121fd6b7ec4 100644 (file)
@@ -110,16 +110,17 @@ Canvas::render (Rect const & area, Cairo::RefPtr<Cairo::Context> 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
-
        }
 
 }