v0.1.15 — DirectWrite text backend + three-layer cache + ADR-006 progress
·
171 commits
to master
since this release
WhatsCanvas v0.1.15
Version bump 0.1.14 → 0.1.15 documenting the 17 PRs (#27–#46) merged since 0.1.14.
Highlights
Text rendering
- DirectWrite text backend (Windows): first-class native adapter selectable via
TextBackendKind::DirectWrite. Covers measurement, real line breaking viaIDWriteTextLayout, weight / slant / spacing / locale styling, custom in-memory font registration and fallback chains, underline / strikethrough decorations, and grayscale + ClearType raster modes.resolveFontFamiliesnow matches the portable backend. - Per-
PaintTextRenderMode(Auto/Grayscale/ClearType): explicit per-draw opt-in for ClearType when the surface is known to be opaque and axis-aligned. - Cross-backend text decoration parity: underline and strikethrough now render consistently on the portable, DirectWrite, and software backends; a regression test pixel-compares all three.
- Text sharpness / HiDPI: text rasterizes at effective device pixel size under a scaled transform or
Canvas::setDevicePixelRatio, and glyph quads snap to the pixel grid on axis-aligned draws.
Performance
- DirectWrite three-layer cache: repeat UI text draws pay only the
scissor + quad-submitcost per frame.- COM apartment + WIC/D2D factories cached process-wide.
- Rasterized bitmap + intrinsic metrics cached in an LRU (4 MB byte budget by default) keyed by
(text, paint, dpr, render-mode). Canvaskeeps a 256-entry LRU of GPU textures keyed by the backend-provided content id, so identical text skips the CPU→GPU upload entirely.
Rendering
- Default anti-aliasing:
Paintnow defaults to AA strokes and fills; opt out withPaint::setAntiAlias(false). - OpenGL
ClipFillprimitive support inexecuteDrawList: a newDrawClipFillProgrammirrors Vulkan's clip pipeline (mask.r × tint color) — closes an ADR-006 parity gap. - Shared encoder resilience:
CommandDrawListEncoderno longer aborts the whole encode on a clipped point/line/vector-text command; it warns and continues so the rest of the offscreen replay still produces output.
Fixes
- MSVC on non-English Windows:
CMakeLists.txtnow passes/utf-8to MSVC so UTF-8 source files decode consistently under the active ANSI code page.
Compatibility
- Public API: fully backwards compatible with 0.1.14.
TextRenderModeis a new opt-in enum withAutodefault. - CMake:
find_package(WhatsCanvas 0.1.15 CONFIG REQUIRED).
Validation
- Full ctest suite (39/39) green on Windows Debug throughout the release.
- Cross-Platform Validation matrix all SUCCESS: Windows / Linux / macOS unit, OpenGLES smoke, package-consumer, cmake-release, optional-font-stack, api-reference, Vulkan.
- Release preflight (
WhatsCanvasVersionConsistencyCheck,WhatsCanvasApiReferenceCheck,WhatsCanvasPackageConsumerSmoke): 3/3 PASS.
Documentation
- Refreshed
doc/DIRECTWRITE_DESIGN_REVIEW.mdwith a status table mapping each of the five original review issues to the PR(s) that closed it. doc/DIRECTWRITE_TEXT_BACKEND.mdknown-limitations section rewritten around the three-layer cache.- ADR-006 gained a Progress Log section (PR #42 / PR #44).
doc/DIRECT3D_DESIGN_REVIEW.mdadded under version control.
See CHANGELOG.md for the full entry.