From d12dd4015daf1e1ac48dbdda793849a6cf24d42a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 4 Feb 2023 18:19:04 +0100 Subject: [PATCH] Revert canvas debugging This reverts commit 835931184967134982fb96372d28217302c8990d. This reverts commit f377822891d314f88d3eaccf5525d245785ac906. This reverts commit 859d6ebe4a98f9b8f68f2fc91ad03b532b7ed1ac. This reverts commit 4cd7de7a6fc95066d7351f109a8bcafbba112cb7. --- libs/canvas/canvas.cc | 36 +++++++----------------------------- libs/canvas/canvas/canvas.h | 1 - libs/canvas/canvas/fill.h | 3 --- libs/canvas/canvas/outline.h | 3 --- libs/canvas/canvas/types.h | 2 -- libs/canvas/line_set.cc | 4 ---- libs/canvas/rectangle.cc | 6 +----- libs/canvas/text.cc | 4 ---- libs/gtkmm2ext/nsglview.mm | 30 ++++++++++++------------------ libs/waveview/wave_view.cc | 4 ---- 10 files changed, 20 insertions(+), 73 deletions(-) diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index 87b0d26430..5e9a93046d 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define CANVAS_PROFILE +//#define CANVAS_PROFILE /** @file canvas/canvas.cc * @brief Implementation of the main canvas classes. @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -54,7 +53,6 @@ using namespace std; using namespace ArdourCanvas; uint32_t Canvas::tooltip_timeout_msecs = 750; -uint64_t ArdourCanvas::nodraw = 0; /** Construct a new Canvas */ Canvas::Canvas () @@ -71,13 +69,6 @@ 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 @@ -138,9 +129,6 @@ Canvas::render (Rect const & area, Cairo::RefPtr const & context #ifdef CANVAS_PROFILE const int64_t start = g_get_monotonic_time (); #endif - if (ArdourCanvas::nodraw & 0x40) { - std::cout << "GtkCanvas::render " << area << "\n"; - } PreRender (); // emit signal @@ -187,11 +175,9 @@ Canvas::render (Rect const & area, Cairo::RefPtr const & context } #ifdef CANVAS_PROFILE - if (ArdourCanvas::nodraw & 0x100) { - const int64_t end = g_get_monotonic_time (); - const int64_t elapsed = end - start; - std::cout << "GtkCanvas::render " << area << " " << (elapsed / 1000.f) << " ms\n"; - } + const int64_t end = g_get_monotonic_time (); + const int64_t elapsed = end - start; + std::cout << "GtkCanvas::render " << area << " " << (elapsed / 1000.f) << " ms\n"; #endif } @@ -1082,11 +1068,9 @@ GtkCanvas::on_expose_event (GdkEventExpose* ev) #ifdef CANVAS_PROFILE - if (ArdourCanvas::nodraw & 0x100) { - const int64_t end = g_get_monotonic_time (); - const int64_t elapsed = end - start; - printf ("GtkCanvas::on_expose_event %f ms\n", elapsed / 1000.f); - } + const int64_t end = g_get_monotonic_time (); + const int64_t elapsed = end - start; + printf ("GtkCanvas::on_expose_event %f ms\n", elapsed / 1000.f); #endif return true; @@ -1318,9 +1302,6 @@ GtkCanvas::on_unmap () void GtkCanvas::queue_draw() { - if (ArdourCanvas::nodraw & 0x20) { - std::cout << "GtkCanvas::queue_draw " << get_width () << " x " << get_height () << "\n"; - } #ifdef __APPLE__ if (_nsglview) { Gtkmm2ext::nsglview_queue_draw (_nsglview, 0, 0, get_width (), get_height ()); @@ -1333,9 +1314,6 @@ GtkCanvas::queue_draw() void GtkCanvas::queue_draw_area (int x, int y, int width, int height) { - if (ArdourCanvas::nodraw & 0x20) { - std::cout << "GtkCanvas::queue_draw_area " << width << " x " << height << " @ " << x << " + " << y << "\n"; - } #ifdef __APPLE__ if (_nsglview) { Gtkmm2ext::nsglview_queue_draw (_nsglview, x, y, width, height); diff --git a/libs/canvas/canvas/canvas.h b/libs/canvas/canvas/canvas.h index 9f90a21154..fa927794a1 100644 --- a/libs/canvas/canvas/canvas.h +++ b/libs/canvas/canvas/canvas.h @@ -188,7 +188,6 @@ 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; diff --git a/libs/canvas/canvas/fill.h b/libs/canvas/canvas/fill.h index ba6f65c100..11e5072c3e 100644 --- a/libs/canvas/canvas/fill.h +++ b/libs/canvas/canvas/fill.h @@ -47,9 +47,6 @@ public: } bool fill () const { - if (ArdourCanvas::nodraw & 0x1) { - return false; - } return _fill; } diff --git a/libs/canvas/canvas/outline.h b/libs/canvas/canvas/outline.h index 33e2a685ed..0308ad1c37 100644 --- a/libs/canvas/canvas/outline.h +++ b/libs/canvas/canvas/outline.h @@ -51,9 +51,6 @@ public: virtual void set_outline_width (Distance); bool outline () const { - if (ArdourCanvas::nodraw & 0x2) { - return false; - } return _outline; } diff --git a/libs/canvas/canvas/types.h b/libs/canvas/canvas/types.h index 7a8b8b0b0d..21f97d1a8a 100644 --- a/libs/canvas/canvas/types.h +++ b/libs/canvas/canvas/types.h @@ -257,8 +257,6 @@ struct FourDimensions { } }; -extern LIBCANVAS_API uint64_t nodraw; - extern LIBCANVAS_API std::ostream & operator<< (std::ostream &, Rect const &); typedef std::vector Points; diff --git a/libs/canvas/line_set.cc b/libs/canvas/line_set.cc index 4bbe0b3feb..bf2b130a6b 100644 --- a/libs/canvas/line_set.cc +++ b/libs/canvas/line_set.cc @@ -88,10 +88,6 @@ LineSet::set_extent (Distance e) void LineSet::render (Rect const & area, Cairo::RefPtr context) const { - if (ArdourCanvas::nodraw & 0x8) { - return; - } - /* area is in window coordinates */ for (vector::const_iterator i = _lines.begin(); i != _lines.end(); ++i) { diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index e71eacf553..20ea629519 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -101,11 +101,7 @@ Rectangle::render (Rect const & area, Cairo::RefPtr context) con if (_stops.empty()) { setup_fill_context (context); } else { - if (ArdourCanvas::nodraw & 0x80) { - setup_fill_context (context); - } else { - setup_gradient_context (context, self, Duple (draw.x0, draw.y0)); - } + setup_gradient_context (context, self, Duple (draw.x0, draw.y0)); } if (_corner_radius) { diff --git a/libs/canvas/text.cc b/libs/canvas/text.cc index be9ad62fe6..355c3f116c 100644 --- a/libs/canvas/text.cc +++ b/libs/canvas/text.cc @@ -206,10 +206,6 @@ Text::_redraw () const void Text::render (Rect const & area, Cairo::RefPtr context) const { - if (ArdourCanvas::nodraw & 0x4) { - return; - } - if (_text.empty()) { return; } diff --git a/libs/gtkmm2ext/nsglview.mm b/libs/gtkmm2ext/nsglview.mm index 5061a6bd49..7b149edca7 100644 --- a/libs/gtkmm2ext/nsglview.mm +++ b/libs/gtkmm2ext/nsglview.mm @@ -25,13 +25,9 @@ #include -#define NSVIEW_PROFILE +//#define NSVIEW_PROFILE //#define DEBUG_NSVIEW_EXPOSURE -namespace ArdourCanvas { -extern uint64_t nodraw; -} - #include #import @@ -121,12 +117,12 @@ __attribute__ ((visibility ("hidden"))) glEnable (GL_TEXTURE_RECTANGLE_ARB); [NSOpenGLContext clearCurrentContext]; - if (ArdourCanvas::nodraw & 0x200) { - [self setWantsBestResolutionOpenGLSurface:NO]; - } else { - [self setWantsBestResolutionOpenGLSurface:YES]; - [self setWantsLayer:YES]; - } +#if 1 + [self setWantsBestResolutionOpenGLSurface:YES]; + [self setWantsLayer:YES]; +#else + [self setWantsBestResolutionOpenGLSurface:NO]; +#endif [self reshape]; } @@ -169,7 +165,7 @@ __attribute__ ((visibility ("hidden"))) } float scale = 1.0; - if ([self window] && 0 == (ArdourCanvas::nodraw & 0x200)) { + if ([self window]) { scale = [[self window] backingScaleFactor]; } @@ -247,7 +243,7 @@ __attribute__ ((visibility ("hidden"))) #endif float scale = 1.0; - if ([self window] && 0 == (ArdourCanvas::nodraw & 0x200)) { + if ([self window]) { scale = [[self window] backingScaleFactor]; } @@ -343,11 +339,9 @@ __attribute__ ((visibility ("hidden"))) [super setNeedsDisplay:NO]; #ifdef NSVIEW_PROFILE - if (ArdourCanvas::nodraw & 0x100) { - const int64_t end = g_get_monotonic_time (); - const int64_t elapsed = end - start; - printf ("NSGL::drawRect (%d x %d) * %.1f in %f ms\n", _width, _height, scale, elapsed / 1000.f); - } + const int64_t end = g_get_monotonic_time (); + const int64_t elapsed = end - start; + printf ("NSGL::drawRect (%d x %d) * %.1f in %f ms\n", _width, _height, scale, elapsed / 1000.f); #endif } diff --git a/libs/waveview/wave_view.cc b/libs/waveview/wave_view.cc index b7b1886fd5..6ffe5345e5 100644 --- a/libs/waveview/wave_view.cc +++ b/libs/waveview/wave_view.cc @@ -960,10 +960,6 @@ WaveView::draw_image_in_gui_thread () const void WaveView::render (Rect const & area, Cairo::RefPtr context) const { - if (ArdourCanvas::nodraw & 0x10) { - return; - } - assert (_props->samples_per_pixel != 0); if (!_region) { // assert?