Gecko:2DGraphicsSketch: Difference between revisions

Jump to navigation Jump to search
Line 263: Line 263:
''This class is mostly stateless. The major piece of state is of course what we've rendered into the target. We also store a CTM and a current clip, since we often want to draw an arbitrary chunk of content with a given CTM and clip, and passing the CTM and clip around alongside the DrawTarget would be overly burdensome. But we give direct set/get access to the clip and matrix --- so no save/restore needed, and it'll be easy to set the clip to anything we want whenever we want.''
''This class is mostly stateless. The major piece of state is of course what we've rendered into the target. We also store a CTM and a current clip, since we often want to draw an arbitrary chunk of content with a given CTM and clip, and passing the CTM and clip around alongside the DrawTarget would be overly burdensome. But we give direct set/get access to the clip and matrix --- so no save/restore needed, and it'll be easy to set the clip to anything we want whenever we want.''


The primary drawing primitives correspond to cairo's fill, stroke, mask and show_glyphs --- except for no paint(). That doesn't seem useful.
The primary drawing primitives correspond to cairo's fill, stroke, mask and show_glyphs --- except for no paint(). It just doesn't seem useful.


''We should also provide shortcuts that correspond to canvas-2D operations.'' This will offer maximum efficiency, so we don't have to spend cycles detecting special cases when the caller code already knows what the special case is.
''We should also provide shortcuts that correspond to canvas-2D operations.'' This will offer maximum efficiency, so we don't have to spend cycles detecting special cases when the caller code already knows what the special case is.
1,295

edits

Navigation menu