mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Revert canvas debugging
This reverts commit8359311849. This reverts commitf377822891. This reverts commit859d6ebe4a. This reverts commit4cd7de7a6f.
This commit is contained in:
parent
c707b056af
commit
d12dd4015d
10 changed files with 20 additions and 73 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CANVAS_PROFILE
|
//#define CANVAS_PROFILE
|
||||||
|
|
||||||
/** @file canvas/canvas.cc
|
/** @file canvas/canvas.cc
|
||||||
* @brief Implementation of the main canvas classes.
|
* @brief Implementation of the main canvas classes.
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
|
||||||
#include <gtkmm/adjustment.h>
|
#include <gtkmm/adjustment.h>
|
||||||
#include <gtkmm/label.h>
|
#include <gtkmm/label.h>
|
||||||
#include <gtkmm/window.h>
|
#include <gtkmm/window.h>
|
||||||
|
|
@ -54,7 +53,6 @@ using namespace std;
|
||||||
using namespace ArdourCanvas;
|
using namespace ArdourCanvas;
|
||||||
|
|
||||||
uint32_t Canvas::tooltip_timeout_msecs = 750;
|
uint32_t Canvas::tooltip_timeout_msecs = 750;
|
||||||
uint64_t ArdourCanvas::nodraw = 0;
|
|
||||||
|
|
||||||
/** Construct a new Canvas */
|
/** Construct a new Canvas */
|
||||||
Canvas::Canvas ()
|
Canvas::Canvas ()
|
||||||
|
|
@ -71,13 +69,6 @@ Canvas::Canvas ()
|
||||||
_use_intermediate_surface = NULL != g_getenv("ARDOUR_INTERMEDIATE_SURFACE");
|
_use_intermediate_surface = NULL != g_getenv("ARDOUR_INTERMEDIATE_SURFACE");
|
||||||
#endif
|
#endif
|
||||||
set_epoch ();
|
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
|
void
|
||||||
|
|
@ -138,9 +129,6 @@ Canvas::render (Rect const & area, Cairo::RefPtr<Cairo::Context> const & context
|
||||||
#ifdef CANVAS_PROFILE
|
#ifdef CANVAS_PROFILE
|
||||||
const int64_t start = g_get_monotonic_time ();
|
const int64_t start = g_get_monotonic_time ();
|
||||||
#endif
|
#endif
|
||||||
if (ArdourCanvas::nodraw & 0x40) {
|
|
||||||
std::cout << "GtkCanvas::render " << area << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
PreRender (); // emit signal
|
PreRender (); // emit signal
|
||||||
|
|
||||||
|
|
@ -187,11 +175,9 @@ Canvas::render (Rect const & area, Cairo::RefPtr<Cairo::Context> const & context
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CANVAS_PROFILE
|
#ifdef CANVAS_PROFILE
|
||||||
if (ArdourCanvas::nodraw & 0x100) {
|
const int64_t end = g_get_monotonic_time ();
|
||||||
const int64_t end = g_get_monotonic_time ();
|
const int64_t elapsed = end - start;
|
||||||
const int64_t elapsed = end - start;
|
std::cout << "GtkCanvas::render " << area << " " << (elapsed / 1000.f) << " ms\n";
|
||||||
std::cout << "GtkCanvas::render " << area << " " << (elapsed / 1000.f) << " ms\n";
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1082,11 +1068,9 @@ GtkCanvas::on_expose_event (GdkEventExpose* ev)
|
||||||
|
|
||||||
|
|
||||||
#ifdef CANVAS_PROFILE
|
#ifdef CANVAS_PROFILE
|
||||||
if (ArdourCanvas::nodraw & 0x100) {
|
const int64_t end = g_get_monotonic_time ();
|
||||||
const int64_t end = g_get_monotonic_time ();
|
const int64_t elapsed = end - start;
|
||||||
const int64_t elapsed = end - start;
|
printf ("GtkCanvas::on_expose_event %f ms\n", elapsed / 1000.f);
|
||||||
printf ("GtkCanvas::on_expose_event %f ms\n", elapsed / 1000.f);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1318,9 +1302,6 @@ GtkCanvas::on_unmap ()
|
||||||
void
|
void
|
||||||
GtkCanvas::queue_draw()
|
GtkCanvas::queue_draw()
|
||||||
{
|
{
|
||||||
if (ArdourCanvas::nodraw & 0x20) {
|
|
||||||
std::cout << "GtkCanvas::queue_draw " << get_width () << " x " << get_height () << "\n";
|
|
||||||
}
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if (_nsglview) {
|
if (_nsglview) {
|
||||||
Gtkmm2ext::nsglview_queue_draw (_nsglview, 0, 0, get_width (), get_height ());
|
Gtkmm2ext::nsglview_queue_draw (_nsglview, 0, 0, get_width (), get_height ());
|
||||||
|
|
@ -1333,9 +1314,6 @@ GtkCanvas::queue_draw()
|
||||||
void
|
void
|
||||||
GtkCanvas::queue_draw_area (int x, int y, int width, int height)
|
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__
|
#ifdef __APPLE__
|
||||||
if (_nsglview) {
|
if (_nsglview) {
|
||||||
Gtkmm2ext::nsglview_queue_draw (_nsglview, x, y, width, height);
|
Gtkmm2ext::nsglview_queue_draw (_nsglview, x, y, width, height);
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,6 @@ public:
|
||||||
|
|
||||||
void set_debug_render (bool yn) { _debug_render = yn; }
|
void set_debug_render (bool yn) { _debug_render = yn; }
|
||||||
bool debug_render() const { return _debug_render; }
|
bool debug_render() const { return _debug_render; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Root _root;
|
Root _root;
|
||||||
uint32_t _queue_draw_frozen;
|
uint32_t _queue_draw_frozen;
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fill () const {
|
bool fill () const {
|
||||||
if (ArdourCanvas::nodraw & 0x1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return _fill;
|
return _fill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,6 @@ public:
|
||||||
virtual void set_outline_width (Distance);
|
virtual void set_outline_width (Distance);
|
||||||
|
|
||||||
bool outline () const {
|
bool outline () const {
|
||||||
if (ArdourCanvas::nodraw & 0x2) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return _outline;
|
return _outline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -257,8 +257,6 @@ struct FourDimensions {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern LIBCANVAS_API uint64_t nodraw;
|
|
||||||
|
|
||||||
extern LIBCANVAS_API std::ostream & operator<< (std::ostream &, Rect const &);
|
extern LIBCANVAS_API std::ostream & operator<< (std::ostream &, Rect const &);
|
||||||
|
|
||||||
typedef std::vector<Duple> Points;
|
typedef std::vector<Duple> Points;
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,6 @@ LineSet::set_extent (Distance e)
|
||||||
void
|
void
|
||||||
LineSet::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
LineSet::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
{
|
{
|
||||||
if (ArdourCanvas::nodraw & 0x8) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* area is in window coordinates */
|
/* area is in window coordinates */
|
||||||
|
|
||||||
for (vector<Line>::const_iterator i = _lines.begin(); i != _lines.end(); ++i) {
|
for (vector<Line>::const_iterator i = _lines.begin(); i != _lines.end(); ++i) {
|
||||||
|
|
|
||||||
|
|
@ -101,11 +101,7 @@ Rectangle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) con
|
||||||
if (_stops.empty()) {
|
if (_stops.empty()) {
|
||||||
setup_fill_context (context);
|
setup_fill_context (context);
|
||||||
} else {
|
} else {
|
||||||
if (ArdourCanvas::nodraw & 0x80) {
|
setup_gradient_context (context, self, Duple (draw.x0, draw.y0));
|
||||||
setup_fill_context (context);
|
|
||||||
} else {
|
|
||||||
setup_gradient_context (context, self, Duple (draw.x0, draw.y0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_corner_radius) {
|
if (_corner_radius) {
|
||||||
|
|
|
||||||
|
|
@ -206,10 +206,6 @@ Text::_redraw () const
|
||||||
void
|
void
|
||||||
Text::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
Text::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
{
|
{
|
||||||
if (ArdourCanvas::nodraw & 0x4) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_text.empty()) {
|
if (_text.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,9 @@
|
||||||
|
|
||||||
#include <gdk/gdkquartz.h>
|
#include <gdk/gdkquartz.h>
|
||||||
|
|
||||||
#define NSVIEW_PROFILE
|
//#define NSVIEW_PROFILE
|
||||||
//#define DEBUG_NSVIEW_EXPOSURE
|
//#define DEBUG_NSVIEW_EXPOSURE
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
|
||||||
extern uint64_t nodraw;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
|
@ -121,12 +117,12 @@ __attribute__ ((visibility ("hidden")))
|
||||||
glEnable (GL_TEXTURE_RECTANGLE_ARB);
|
glEnable (GL_TEXTURE_RECTANGLE_ARB);
|
||||||
[NSOpenGLContext clearCurrentContext];
|
[NSOpenGLContext clearCurrentContext];
|
||||||
|
|
||||||
if (ArdourCanvas::nodraw & 0x200) {
|
#if 1
|
||||||
[self setWantsBestResolutionOpenGLSurface:NO];
|
[self setWantsBestResolutionOpenGLSurface:YES];
|
||||||
} else {
|
[self setWantsLayer:YES];
|
||||||
[self setWantsBestResolutionOpenGLSurface:YES];
|
#else
|
||||||
[self setWantsLayer:YES];
|
[self setWantsBestResolutionOpenGLSurface:NO];
|
||||||
}
|
#endif
|
||||||
|
|
||||||
[self reshape];
|
[self reshape];
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +165,7 @@ __attribute__ ((visibility ("hidden")))
|
||||||
}
|
}
|
||||||
|
|
||||||
float scale = 1.0;
|
float scale = 1.0;
|
||||||
if ([self window] && 0 == (ArdourCanvas::nodraw & 0x200)) {
|
if ([self window]) {
|
||||||
scale = [[self window] backingScaleFactor];
|
scale = [[self window] backingScaleFactor];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -247,7 +243,7 @@ __attribute__ ((visibility ("hidden")))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float scale = 1.0;
|
float scale = 1.0;
|
||||||
if ([self window] && 0 == (ArdourCanvas::nodraw & 0x200)) {
|
if ([self window]) {
|
||||||
scale = [[self window] backingScaleFactor];
|
scale = [[self window] backingScaleFactor];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -343,11 +339,9 @@ __attribute__ ((visibility ("hidden")))
|
||||||
[super setNeedsDisplay:NO];
|
[super setNeedsDisplay:NO];
|
||||||
|
|
||||||
#ifdef NSVIEW_PROFILE
|
#ifdef NSVIEW_PROFILE
|
||||||
if (ArdourCanvas::nodraw & 0x100) {
|
const int64_t end = g_get_monotonic_time ();
|
||||||
const int64_t end = g_get_monotonic_time ();
|
const int64_t elapsed = end - start;
|
||||||
const int64_t elapsed = end - start;
|
printf ("NSGL::drawRect (%d x %d) * %.1f in %f ms\n", _width, _height, scale, elapsed / 1000.f);
|
||||||
printf ("NSGL::drawRect (%d x %d) * %.1f in %f ms\n", _width, _height, scale, elapsed / 1000.f);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -960,10 +960,6 @@ WaveView::draw_image_in_gui_thread () const
|
||||||
void
|
void
|
||||||
WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
{
|
{
|
||||||
if (ArdourCanvas::nodraw & 0x10) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert (_props->samples_per_pixel != 0);
|
assert (_props->samples_per_pixel != 0);
|
||||||
|
|
||||||
if (!_region) { // assert?
|
if (!_region) { // assert?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue