13
0

debugging: allow selection no-draw for canvas fill, outline, text, lineset and waveview

This commit is contained in:
Paul Davis 2023-01-20 18:13:00 -07:00
parent a1dee6cba2
commit 4cd7de7a6f
8 changed files with 30 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include <list>
#include <cassert>
#include <cstdlib>
#include <gtkmm/adjustment.h>
#include <gtkmm/label.h>
#include <gtkmm/window.h>
@ -51,6 +52,7 @@ using namespace std;
using namespace ArdourCanvas;
uint32_t Canvas::tooltip_timeout_msecs = 750;
uint64_t ArdourCanvas::nodraw = 0;
/** Construct a new Canvas */
Canvas::Canvas ()
@ -67,6 +69,13 @@ Canvas::Canvas ()
_use_intermediate_surface = NULL != g_getenv("ARDOUR_INTERMEDIATE_SURFACE");
#endif
set_epoch ();
const char * dbg = g_getenv ("ARDOUR_CANVAS_NODRAW");
if (dbg) {
nodraw = strtoull (dbg, NULL, 0);
std::cerr << "\n\n **** SET NODRAW FROM " << dbg << " to " << std::hex << nodraw << std::dec << std::endl;
}
}
void

View File

@ -188,6 +188,7 @@ public:
void set_debug_render (bool yn) { _debug_render = yn; }
bool debug_render() const { return _debug_render; }
protected:
Root _root;
uint32_t _queue_draw_frozen;

View File

@ -47,6 +47,9 @@ public:
}
bool fill () const {
if (ArdourCanvas::nodraw & 0x1) {
return false;
}
return _fill;
}

View File

@ -51,6 +51,9 @@ public:
virtual void set_outline_width (Distance);
bool outline () const {
if (ArdourCanvas::nodraw & 0x2) {
return false;
}
return _outline;
}

View File

@ -257,6 +257,8 @@ struct FourDimensions {
}
};
extern LIBCANVAS_API uint64_t nodraw;
extern LIBCANVAS_API std::ostream & operator<< (std::ostream &, Rect const &);
typedef std::vector<Duple> Points;

View File

@ -88,6 +88,10 @@ LineSet::set_extent (Distance e)
void
LineSet::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
{
if (ArdourCanvas::nodraw & 0x8) {
return;
}
/* area is in window coordinates */
for (vector<Line>::const_iterator i = _lines.begin(); i != _lines.end(); ++i) {

View File

@ -206,6 +206,10 @@ Text::_redraw () const
void
Text::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
{
if (ArdourCanvas::nodraw & 0x4) {
return;
}
if (_text.empty()) {
return;
}

View File

@ -960,6 +960,10 @@ WaveView::draw_image_in_gui_thread () const
void
WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
{
if (ArdourCanvas::nodraw & 0x10) {
return;
}
assert (_props->samples_per_pixel != 0);
if (!_region) { // assert?