1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// SPDX-FileCopyrightText: Copyright (c) 2026 Mike Li/Mikewolfli/Wei Li(mikewolfli@163.com)
// SPDX-License-Identifier: MIT
//! Rendering primitives and software surface baseline.
//!
//! # Coordinate System
//!
//! This module uses the framework's standard **screen coordinate system** with origin at **top-left**:
//!
//! - **X axis**: Increases from left to right (0 → width)
//! - **Y axis**: Increases from top to bottom (0 → height)
//!
//! All rendering operations (drawing text, shapes, images) expect coordinates in this system.
//! The rendering context automatically handles any necessary transformations when working with
//! widgets or other components that may use different coordinate systems internally.
//!
//! ## Drawing Operations
//!
//! - `draw_text()`: Draws text at the specified (x, y) position
//! - `draw_line()`: Draws a line from (x1, y1) to (x2, y2)
//! - `draw_rect()`: Draws a rectangle outline
//! - `fill_rect()`: Fills a rectangle with a solid color
//! - `draw_image()`: Draws an image at the specified position
//!
//! All coordinates are in logical pixels and use the screen coordinate system.
//!
//! # Module Structure (feature-layered)
//!
//! | Group | Path | Contents |
//! |-------|------|---------|
//! | **gpu** | `gpu/` | GPU-accelerated rendering traits and capability enums (gated behind `gpu-wgpu`) |
//! | **core** | `core/` | Data types (`TextMetrics`, `TextCluster`, `ShapedText`) and commands (`RenderCommand`) |
//! | **backend** | `backend/` | Rendering backends: software surface (`BackBuffer`, `SoftwareSurface`, `RenderContext`), paint trait (`PaintBackend`, `SoftwarePaintBackend`), batch (`BatchId`), scene (`SceneLayer`, `RenderScene`) |
//! | **pipeline** | `pipeline/` | Visual command pipeline for all widget types (controls, containers, dialogs, special, etc.) |
//! | **web** | `web/` | Web engine and web view rendering |
//! | **quality** | `quality/` | Adaptive rendering quality management |
//!
//! # Reachability
//!
//! **State:** Production callers: `src/widget/widget_trait.rs:1`; 181 files reference it (every control's `Draw` implementation).
// ─── Sub-module declarations ─────────────────────────────────────────────────
// Core data types and commands
// Rendering backends
// (controls/ directory was migrated to pipeline/special.rs — see pipeline module)
// Visual command pipeline for all widget types
// Projection/presentation-mode rendering (BLUE8 P4-5b, gated behind `projection`)
// GPU-accelerated rendering backend
// SVG rendering backend
// Text caching
// Text layer: glyph sources and the fallback stack (BLUE23 §0A.4 G-2b/G-4b)
// Text shaping (pre-layout measurement)
// Rich text rendering (multi-span styled text)
// Text overflow handling (ellipsis, clip, multi-line clamp)
// Unicode grapheme cluster support (emoji, combining marks, ZWJ)
// ─── Re-exports ──────────────────────────────────────────────────────────────
// Core
pub use ;
// SVG
pub use SvgPaintBackend;
// Backend
pub use ;
pub use ;
pub use software_render_config_test_lock;
// Pixel ops
pub use ;
// Text shaping
pub use ;
// The face-backed shaper, when a face is enabled (BLUE23 §0A.4, G-1).
pub use RustybuzzShaper;
// Rich text
pub use ;
// Text overflow
pub use ;
// Grapheme support
pub use ;
// GPU — re-export only when feature is active
pub use ;
// Projection types
pub use ;
/// Shared helper accessible to surface.rs and backend
pub use pixel_bytes_len;
/// Advancing/text-shaping helpers shared with the SVG backend, so the vector
/// output and the software rasteriser agree on text metrics (principle #51: one
/// heuristic, not two drifting copies).
/// The glyph geometry both renderers read, and the cluster predicates they classify with.
pub use glyph_rects;
/// Arc and circle drawing helpers.
pub use ;
// The bevel primitive: a face's light/shade pair and the edges it strokes. Added as its own module
// so a face's "which way is it turned" is one relationship rather than three copies — see the
// module docs for the two expressions it replaces and why the direction has to be explicit here.
pub use ;
// The surface declaration channel: what kind of face a control's rectangle is. Added as its own
// module — compiled in every profile, including `mini`/`embedded` — so a theme can say "this is a
// flat theme" or "this is a dimensional one" as data rather than every control deciding its own
// material. See the module docs for the three measurements that motivated it and the role table
// it replaces the fixed per-control shadow literal with.
pub use ;