summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-03-21 15:53:17 +0100
committerRobin Gareus <robin@gareus.org>2017-03-21 15:53:29 +0100
commit500033b416ea8656eb7ef433288bddd7fc87d1cd (patch)
tree91705767faa2e51ac3ff0b3277f3725ec2a7effe /libs/gtkmm2ext
parent5e9492b996a8c7b7cc15957decebe2f006a085a2 (diff)
Debug NSView Exposure
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r--libs/gtkmm2ext/nsglview.mm18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/gtkmm2ext/nsglview.mm b/libs/gtkmm2ext/nsglview.mm
index 9115fc7287..d2eace78da 100644
--- a/libs/gtkmm2ext/nsglview.mm
+++ b/libs/gtkmm2ext/nsglview.mm
@@ -64,6 +64,7 @@ __attribute__ ((visibility ("hidden")))
- (void) dealloc;
- (void) setCairoCanvas:(Gtkmm2ext::CairoCanvas*)c;
- (void) reshape;
+- (void) setNeedsDisplayInRect:(NSRect)rect;
- (void) drawRect:(NSRect)rect;
- (BOOL) canBecomeKeyWindow:(id)sender;
- (BOOL) acceptsFirstResponder:(id)sender;
@@ -176,6 +177,15 @@ __attribute__ ((visibility ("hidden")))
_height = height;
}
+- (void) setNeedsDisplayInRect:(NSRect)rect
+{
+ [super setNeedsDisplayInRect:rect];
+#ifdef DEBUG_NSVIEW_EXPOSURE
+ printf ("needsDisplay: %5.1f %5.1f %5.1f %5.1f\n",
+ rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
+#endif
+}
+
- (void) drawRect:(NSRect)rect
{
[[self openGLContext] makeCurrentContext];
@@ -217,6 +227,11 @@ __attribute__ ((visibility ("hidden")))
}
ctx->fill ();
+#ifdef DEBUG_NSVIEW_EXPOSURE
+ printf ("drawRect: %.1f %.1f %.1f %1.f\n",
+ cairo_rect.x, cairo_rect.y, cairo_rect.width, cairo_rect.height);
+#endif
+
cairo_canvas->render (ctx, &cairo_rect);
surf->flush ();
@@ -302,6 +317,9 @@ Gtkmm2ext::nsglview_queue_draw (void* glv, int x, int y, int w, int h)
{
ArdourCanvasOpenGLView* gl_view = (ArdourCanvasOpenGLView*) glv;
[gl_view setNeedsDisplayInRect:NSMakeRect(x, y, w, h)];
+#ifdef DEBUG_NSVIEW_EXPOSURE
+ printf ("Queue Draw %5d %5d %5d %5d\n", x, y, w, h);
+#endif
}
void