void RenderTile (int renderId, int threadId, int tileIndex)
{
Exception exception = null;
Gdk.Rectangle bounds = new Gdk.Rectangle ();
try {
bounds = GetTileBounds (tileIndex);
if (!cancel_render_flag)
effect.RenderEffect (source_surface, dest_surface, new [] { bounds });
} catch (Exception ex) {
exception = ex;
Debug.WriteLine ("AsyncEffectRenderer Error while rendering effect: " + effect.Text + " exception: " + ex.Message + "\n" + ex.StackTrace);
}
// Ignore completions of tiles after a cancel or from a previous render.
if (!IsRendering || renderId != render_id)
return;
// Update bounds to be shown on next expose.
lock (updated_lock) {
if (is_updated) {
updated_x1 = Math.Min (bounds.X, updated_x1);
updated_y1 = Math.Min (bounds.Y, updated_y1);
updated_x2 = Math.Max (bounds.X + bounds.Width, updated_x2);
updated_y2 = Math.Max (bounds.Y + bounds.Height, updated_y2);
} else {
is_updated = true;
updated_x1 = bounds.X;
updated_y1 = bounds.Y;
updated_x2 = bounds.X + bounds.Width;
updated_y2 = bounds.Y + bounds.Height;
}
}
if (exception != null) {
lock (render_exceptions) {
render_exceptions.Add (exception);
}
}
}