Replay(IRenderingBackend, PdfRectangle) Method

Definition

Assembly Broadside.dll

Calls backend for the operations of the list that can change pixels inside region, in order: every paint whose bounds meet the region, and every state change. A saved state whose paints all lie outside the region is skipped with its SaveState() and RestoreState().

public void Replay(IRenderingBackend backend, PdfRectangle region)

Parameters

backend
IRenderingBackend

The backend that draws.

region
PdfRectangle

The region in the list's default user space (the page's coordinates, as its crop box is given). A backend that paints beyond a shape's exact outline (a minimum line width in device pixels, stroke adjustment, anti-aliasing) passes the region it draws widened by that much; Replay(IRenderingBackend) is the same as a region that holds everything.

Remarks

Spec #33 story 14 (viewer capability 1: render tiles at many zoom levels from one cached list). Each paint's bounds are in default user space (ISO 32000-2 §8.3.2.3): its path's points (curve control points included, which bound the curve) under the transform of the paint (a fill or stroke in a shading or tiling pattern (§8.7.3) is bounded by its path like any other); a stroke's path widened by half the line width times the miter limit or √2 for square caps (§8.4.3.3–§8.4.3.5), in user space where the pen is; an image's or stencil mask's unit square (§8.9.4); a glyph run's outlines under their glyph transforms (§9.4.4); a shading's BBox (§8.7.4.3), or no bound without one. Every paint's bounds are cut by the clipping path's bounds at that point (§8.5.4), so the content of a clip outside the region is skipped too. An annotation (§12.5.5) is skipped whole like a saved state; one drawn with NoZoom or NoRotate (§12.5.3), which the backend places by its own mapping, is never skipped. Alpha constants and blend modes act per pixel (§11.3), so skipping a paint that changes no pixel of the region changes nothing in it.

The bounds are computed once per list, on the first region replay (one array of an operation's size per list), and replaying a region allocates nothing after that. Safe to call on several threads at once with a backend per thread.