Shared Slug fill layouts and frozen shader interfaces. More...
#include <cmath>#include <cstdint>#include <initializer_list>#include "donner/gpu/shader/CompiledShader.h"Classes | |
| struct | donner::gpu::shader::programs::SlugFillParams |
| Per-draw transform, paint, geometry and clip parameters. More... | |
| struct | donner::gpu::shader::programs::SlugFillInstance |
| One painter-ordered instance, including its nested transform and bounding polygon. More... | |
| struct | donner::gpu::shader::programs::SlugFillBand |
| A band indexes the corresponding curve-reference range. More... | |
| struct | donner::gpu::shader::programs::SlugPixelMapping |
| Pixel-to-path mapping a Slug fragment applies to its own pixel center p: pathFromPixel * (p - pixelOrigin) + pathOffset, with pathFromPixel holding the inverse linear transform's two columns. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Functions | |
| SlugPixelMapping | donner::gpu::shader::programs::ComputeSlugPixelMapping (double a, double b, double c, double d, double e, double f) |
| Computes the mapping for the path-to-target-pixel affine x' = a x + c y + e, y' = b x + d y + f, in double precision. | |
| template<typename ParamsT> | |
| void | donner::gpu::shader::programs::WriteSlugPixelMapping (ParamsT ¶ms, const SlugPixelMapping &mapping) |
| Writes mapping into any parameter block carrying the three mapping fields. | |
| const CompiledShaderView & | donner::gpu::shader::programs::SlugFillShader () |
| Returns a stable view of the authored WGSL and reflected interface. | |
| const CompiledShaderView & | donner::gpu::shader::programs::SlugFillNativeShader () |
| Returns a stable view containing only the platform-native projection. | |
Shared Slug fill layouts and frozen shader interfaces.
|
inline |
Computes the mapping for the path-to-target-pixel affine x' = a x + c y + e, y' = b x + d y + f, in double precision.
The translation splits into an integer pixel origin and a fractional remainder. The shader subtracts the origin from the pixel center exactly, and every other input depends only on the linear part and that remainder. Draws whose translations differ by an integer, with the sum exact in double as it is for every atlas or tile placement of an ordinary draw, therefore map corresponding pixels to the same path positions whatever their target. A translation too large to split stays whole in the offset, as precise as the float path data it is compared with.
A transform without an inverse, or one whose inverse float cannot hold, gets an all-zero mapping, and the shaders cover no pixel of a draw that carries it. The draw's enclosure is built on the GPU from float axes that rounding can leave slightly invertible, so it can still rasterize a sliver of pixels, and only that rule keeps them empty.