本文整理汇总了C#中Gdk.Rectangle.ToCairoRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.Rectangle.ToCairoRectangle方法的具体用法?C# Gdk.Rectangle.ToCairoRectangle怎么用?C# Gdk.Rectangle.ToCairoRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.Rectangle
的用法示例。
在下文中一共展示了Gdk.Rectangle.ToCairoRectangle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderTile
// Runs on a background thread.
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) {
dest_surface.Flush ();
effect.Render (source_surface, dest_surface, new [] { bounds });
dest_surface.MarkDirty (bounds.ToCairoRectangle ());
}
} catch (Exception ex) {
exception = ex;
Debug.WriteLine ("AsyncEffectRenderer Error while rendering effect: " + effect.Name + " 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);
}
}
}