mono/xwt — pull request #103 by lytico (2012-04-16 23:33:05+00:00)
Title: Xwt.Wpf.DrawingContext: reduced resource usage

refactored Wpf.DrawingContext to reuse and lazy use of expensive System.Drawing-objects like pen, brush, font
results in short old Code new Code
Time in sec (Frames 1210)
5,66 4,68
Frames per sec
213,71 258,49
SetColor memory usage in bytes:
14,673,402 90
Context.Save memory usage in bytes:
305,184 83,248

Brush is lazy cause its never used in
Stroke without FillPreserve
DrawTextLayout without Fill
Draw Image without Fill
Pen is lazy cause its never used in
Fill without StrokePreserve
DrawTextLayout without Stroke
Draw Image without Stroke
Path is lazy cause its never used in
DrawTextLayout without Stroke or Fill
Draw Image without Stroke or Fill
Font is lazy cause its never used if
DrawTextLayout is never used or
Context.SetFont is called