Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
GeodeCheckerboardPipeline.h File Reference

Render pipeline and draw pass for the transparency checkerboard (fullscreen triangle). More...

#include <array>
#include <cstdint>
#include <optional>
#include <webgpu/webgpu.hpp>
#include "donner/base/Vector2.h"
#include "donner/gpu/Device.h"
Include dependency graph for GeodeCheckerboardPipeline.h:

Classes

struct  donner::geode::CheckerboardScissorPx
 Device-pixel sub-rectangle of the target a checkerboard pass is confined to. More...
struct  donner::geode::CheckerboardUnderlayParams
 Placement and appearance of a transparency-checkerboard pass over a render target. More...
class  donner::geode::GeodeCheckerboardPipeline
 Caches the compiled render pipeline that draws the transparency checkerboard behind see-through document regions, plus its bind group layout. More...
struct  donner::geode::GeodeCheckerboardPipeline::Uniforms
 Uniform block consumed by the checkerboard shader. More...
class  donner::geode::GeodeCheckerboardPass
 Draws the transparency checkerboard over a Geode-owned render target. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Variables

constexpr double donner::geode::kTransparencyCheckerboardCellLogicalPx = 16.0
 Appearance of the transparency checkerboard drawn behind see-through document pixels.
constexpr std::array< float, 4 > donner::geode::kTransparencyCheckerboardDarkColor
 RGBA in the 0-1 range for odd cells.
constexpr std::array< float, 4 > donner::geode::kTransparencyCheckerboardLightColor
 RGBA in the 0-1 range for even cells.

Detailed Description

Render pipeline and draw pass for the transparency checkerboard (fullscreen triangle).


Class Documentation

◆ donner::geode::GeodeCheckerboardPipeline::Uniforms

struct donner::geode::GeodeCheckerboardPipeline::Uniforms

Uniform block consumed by the checkerboard shader.

Class Members
float checkerSize Checker cell size in logical pixels.
float darkColor[4] RGBA for odd cells.
float devicePixelRatio Device pixels per logical pixel.
float lightColor[4] RGBA for even cells.
float originOffsetPx[2] Device-pixel offset of the target's top-left from the anchor.
float padding[2] WGSL uniform struct tail padding; must be zero.
float targetSize[2] Render-target size in device pixels.

Variable Documentation

◆ kTransparencyCheckerboardCellLogicalPx

double donner::geode::kTransparencyCheckerboardCellLogicalPx = 16.0
inlineconstexpr

Appearance of the transparency checkerboard drawn behind see-through document pixels.

Shared by every presentation path so the same document lands on identical cells. The size is in logical pixels, so the pattern is anchored to device pixels and never scales with document zoom.

◆ kTransparencyCheckerboardDarkColor

std::array<float, 4> donner::geode::kTransparencyCheckerboardDarkColor
inlineconstexpr
Initial value:
= {
40.0f / 255.0f, 40.0f / 255.0f, 40.0f / 255.0f, 1.0f}

RGBA in the 0-1 range for odd cells.

◆ kTransparencyCheckerboardLightColor

std::array<float, 4> donner::geode::kTransparencyCheckerboardLightColor
inlineconstexpr
Initial value:
= {
60.0f / 255.0f, 60.0f / 255.0f, 60.0f / 255.0f, 1.0f}

RGBA in the 0-1 range for even cells.