Confirmed users
166
edits
m (→Draw targets) |
m (→Draw targets) |
||
Line 110: | Line 110: | ||
# <shape> (Rect / Path) — the exceptions are FillGlyph and DrawSurface | # <shape> (Rect / Path) — the exceptions are FillGlyph and DrawSurface | ||
# A Pattern object that describes the source for filling/stroking | # A <code>Pattern</code> object that describes the source for filling/stroking | ||
# A DrawOptions object (alpha, comp-op, anti-aliasing, snapping etc.) | # A <code>DrawOptions</code> object (alpha, comp-op, anti-aliasing, snapping etc.) | ||
# Call-specific draw options | # Call-specific draw options | ||
==== Paths ==== | |||
To draw paths, we create a <code>PathBuilder</code> for a DrawTarget using <code>CreatePathBuilder</code>. The <code>PathBuilder</code> has methods such as: | To draw paths, we create a <code>PathBuilder</code> for a DrawTarget using <code>CreatePathBuilder</code>. The <code>PathBuilder</code> has methods such as: | ||
Line 122: | Line 124: | ||
Finally, calling <code>Finish</code> returns a <code>Path</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! | Finally, calling <code>Finish</code> returns a <code>Path</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! | ||
==== Patterns ==== | |||
* ColorPattern | Patterns describe the pixels used as the source for a masked composition operation that is done by the different drawing commands. The different types of patterns are: | ||
* SurfacePattern | |||
* LinearGradientPattern | * <code>ColorPattern</code> — a solid color fill | ||
* RadialGradientPattern | * <code>SurfacePattern</code> — a <code>SourceSurface</code> plus a repeat mode, transformation matrix, and resampling filter | ||
* <code>LinearGradientPattern</code> | |||
* <code>RadialGradientPattern</code> | |||
For linear and radial gradient patterns, the list of gradient stops is back-end specific. | |||
These objects are ''not'' ref-counted and may be allocated on the stack. | |||
== Developing Moz2D == | == Developing Moz2D == |