Renders pages and display lists through Direct2D into a Bitmap of premultiplied BGRA pixels: a native backend for Windows that matches the SoftwareRasterizer within the golden-image thresholds.
public sealed class Direct2DRenderer : IDisposable
It consumes display lists only, replaying them onto a Direct2D device context over a Direct3D 11 device (the graphics hardware or WARP, Direct2DDriver). Fills use the non-zero winding or even-odd rule with every subpath closed (ISO 32000-2 §8.5.3.3), strokes follow the line parameters with the elliptical pen of a non-uniform transform, dashes, the thinnest line and stroke adjustment (§8.5.3.2, §8.4.3, §10.7.5), and clips intersect anti-aliased, saved and restored with the graphics state (§8.5.4). Colours convert to RGB through GetColorConverter(PdfColorSpace, ColorConversion, PdfDefaultColorSpaces?), so the engine's colour management decides them (§8.6, §10). Pages map to pixels as RenderOptions says (§8.3.2.3, §7.7.3.3 Table 31, §14.11.2), the same mapping the software rasterizer uses.
Text (ISO 32000-2 §9.4.3, §9.3.6): glyphs of TrueType and OpenType programs are filled by DirectWrite from a font face loaded from
the program's bytes (§9.9), created once per program and renderer; glyphs of every other program, and every glyph when
ForceOutlines is set, are filled from the outlines the display list carries by the non-zero winding
rule (§9.2.4). Stroked text is stroked from the outlines like a path. A TrueType or OpenType program DirectWrite cannot read as
Broadside does draws from its outlines and is reported (BackendNativeGlyphsUnavailable, information).
Constant alpha (ISO 32000-2 §11.6.4.4) is the brush colour's alpha. Annotations and form fields (§12.5.5) are placed as the software rasterizer places them (NoZoom and NoRotate, §12.5.3), clipped to their rectangle and, when translucent, drawn in a layer with their opacity.
Transparency (ISO 32000-2 §11.4, §11.5, §11.6): groups whose content does not blend are Direct2D layers with the group's opacity,
and soft masks are a layer's opacity brush holding the mask values the software rasterizer computes
(BackendSoftMaskRasterized, information). Direct2D's primitive blend is source-over only: knockout groups (§11.4.6) and
isolated groups whose content blends (§11.3.5) are drawn by
Render(in DisplayGroup, PdfDocument, Bitmap, in Matrix, in Matrix, Double, Double, BlendMode)
into a bitmap drawn in their place, reported once per kind (BackendKnockoutGroupRasterized,
BackendBlendingGroupRasterized, BackendGroupColorSpaceRasterized, information); a page that blends with its backdrop
in a mode other than Normal (a paint, annotation or group in another blend mode, or a non-isolated group whose content blends) is
drawn whole by the software rasterizer (BackendPageRasterized, information).
Reuse one instance for many renders: its device, device context and target bitmaps are created once (the targets again when the size changes) and released on Dispose(), and a warm render allocates nothing managed per operation. An instance renders one page at a time; use one per thread to render in parallel (a document is safe for concurrent renders while nobody changes it).
kind:method, kind:property, kind:ctor. Press Esc to clear.Direct2DRenderer()Initializes a new instance of the Direct2DRenderer class on the graphics hardware, or WARP when there is none.Direct2DRenderer(Direct2DDriver)Initializes a new instance of the Direct2DRenderer class on the given driver.DiagnosticsGets the diagnostics of the last render: one warning, code RenderingOperationSkipped, for each kind of display-list operation this backend does not draw yet and left out, and one information entry, code BackendNativeGlyphsUnavailable, when glyphs of a TrueType or OpenType program were drawn from their outlines because DirectWrite could not read the program.Dispose()Releases the Direct2D device, its device context and bitmaps, and the DirectWrite font faces; the renderer renders no more after this.Render(PdfPage, Bitmap, RenderOptions)Renders page into the top-left GetPixelSize(PdfPage) pixels of target, on white; pixels outside that area are left as they are.Render(PdfPage, RenderOptions)Renders page into a new pooled bitmap of GetPixelSize(PdfPage) pixels, on white.Render(PdfPage)Renders page at 72 DPI into a new pooled bitmap, on white.Render(DisplayList, Bitmap, in Matrix, Boolean)Draws list over the current pixels of target, without a background, drawing every glyph from its outline when forceOutlines is set.Render(DisplayList, Bitmap, in Matrix)Draws list over the current pixels of target, without a background.