=== Draw targets ===
<span style="background:yellow">TBD (currently just note form)</span>
<div style="background:#ffd">
A draw target performs drawing operations on some backing store (e.g. a D3D texture or other buffer).
DrawTargetIncludes methods such as the following:
* <code>FillRect</code>* <code>Fill</code>* <code>StrokeRect</code>* <code>StrokeLine</code>* <code>Stroke</code>
* …
The following methods are stateful: * <code>PushClip (Stateful)</code>* <code>PushClipRect (Stateful)</code>* <code>PopClip (Stateful)</code>* <code>SetTransform (Stateful)</code>
Typically the arguments to draw commands take the following order:
# Shape <shape> (Rect / Path) – — the exceptions are FillGlyph and DrawSurface# A Patternobject that describes the source for filling/stroking
# A DrawOptions object (alpha, comp-op, anti-aliasing, snapping etc.)
# Call-specific draw options
To draw paths, we create a <code>PathBuilder</code> for a DrawTarget using <code>CreatePathBuilder</code>. The <code>PathBuilder</code> has methods such as:
PathBuilder:* <code>MoveTo</code>* <code>LineTo</code>* …
* MoveTo* LineTo* …* Finally, calling <code>Finish: </code> returns a <code>Path – cannot re-use a PathBuilder after </code> that can be used for drawing (e.g. with <code>Fill</code> or <code>Stroke</code>). After calling <code>Finish</code> the <code>PathBuilder</code> cannot be used again!
<div style="background: #ffc">TODO: Write this part* ColorPattern* SurfacePattern* LinearGradientPattern* RadialGradientPattern
(These are all not-refcounted, but usually stack-based)
Draw commands
* Shape (Rect / Path)
* Pattern
</div>