Changes

Jump to: navigation, search

Platform/GFX/Moz2D

472 bytes added, 07:49, 28 August 2013
m
Draw targets
=== 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>
* &hellip;
 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 &lt;shape&gt; (Rect / Path) &mdash; 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>* &hellip;
* MoveTo* LineTo* &hellip;* 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>
Confirm
166
edits

Navigation menu