diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-02-03 15:38:14 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-02-03 15:38:14 -0500 |
commit | 9fab39358a08e534910bdd27a81ee5ddcca65bac (patch) | |
tree | 623f2685cded5a5f818b50a8c937fc3ff2bef9b9 /libs | |
parent | 2689848ed796dfc070da96c215e31add06577226 (diff) |
render canvas using the GDK region rather than the GDK area.
The region is the un-coalesced set of rectangles that were requested for redraw. The area
is the coalesced single rectangle. In the worst cases, the coalesced rectangle could span
the entire window even though just two pixels in opposite corners were to be redrawn.
There is a problem with the verbose cursor as it is dragged across MIDI tracks. TO BE
FIXED.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/canvas/canvas.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index 1a14f8bde3..8436036983 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -786,9 +786,20 @@ GtkCanvas::on_expose_event (GdkEventExpose* ev) draw_context->fill (); /* render canvas */ - - render (Rect (ev->area.x, ev->area.y, ev->area.x + ev->area.width, ev->area.y + ev->area.height), draw_context); +#ifdef CANVAS_SINGLE_EXPOSE + render (Rect (ev->area.x, ev->area.y, ev->area.x + ev->area.width, ev->area.y + ev->area.height), draw_context); +#else + GdkRectangle* rects; + gint nrects; + + gdk_region_get_rectangles (ev->region, &rects, &nrects); + for (gint n = 0; n < nrects; ++n) { + render (Rect (rects[n].x, rects[n].y, rects[n].x + rects[n].width, rects[n].y + rects[n].height), draw_context); + } + g_free (rects); +#endif + #ifdef USE_CAIRO_IMAGE_SURFACE /* now blit our private surface back to the GDK one */ |