13
0

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.
This commit is contained in:
Paul Davis 2015-02-03 15:38:14 -05:00
parent 2689848ed7
commit 9fab39358a

View File

@ -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 */