|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Draws the transparency checkerboard over a Geode-owned render target. More...
#include "donner/svg/renderer/geode/GeodeCheckerboardPipeline.h"
Public Member Functions | |
| GeodeCheckerboardPass (const GeodeCheckerboardPass &)=delete | |
| GeodeCheckerboardPass & | operator= (const GeodeCheckerboardPass &)=delete |
| GeodeCheckerboardPass (GeodeCheckerboardPass &&) noexcept=default | |
| Move constructor. | |
| GeodeCheckerboardPass & | operator= (GeodeCheckerboardPass &&) noexcept=default |
| Move assignment operator. | |
| bool | draw (GeodeDevice &device, const wgpu::Texture &target, Vector2i targetSizePx, const CheckerboardUnderlayParams ¶ms, GeodeCheckerboardPipeline::BlendMode blendMode) |
Submit one checkerboard pass over target. | |
Draws the transparency checkerboard over a Geode-owned render target.
This is the single checkerboard draw in the project. It is deliberately Geode-only: the checkerboard exists so see-through document pixels reach a GPU presentation surface with something behind them, and there is no software presentation path that needs one. Putting it here instead of on RendererInterface keeps a GPU-only concern out of the backend-neutral interface every renderer has to implement.
One instance per consumer: the compiled pipeline and its bind group layout are shared device-wide (issue #575), but the uniform buffer and bind group are per-consumer and are built on the first draw, so a consumer that never draws a checkerboard never allocates them.
|
nodiscard |
Submit one checkerboard pass over target.
With GeodeCheckerboardPipeline::BlendMode::Replace the pass overwrites the scissored region, so it must run before any document pixels land in the target. With GeodeCheckerboardPipeline::BlendMode::DestinationOver it goes underneath premultiplied content already in the target: fully-opaque pixels are unchanged, fully-transparent pixels become checkerboard, and partial alpha blends as destination-over does.
| device | Device that owns target and the shared pipeline. |
| target | Render target owned by the embedding surface. Needs RenderAttachment usage and the device's texture format. |
| targetSizePx | Target size in device pixels. |
| params | Checkerboard placement and appearance. |
| blendMode | How the checkerboard combines with the target's contents. |
target untouched.