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
//! Native drawing of custom series: a plugin
//! registered with [`crate::WgpuRenderer::register_series`] draws the
//! [`CustomDraw`] commands of its kind with its own pipelines.
use ChartDataView;
use ;
/// What a [`GpuSeries`] gets to prepare a draw.
/// A native implementation of a custom series kind.
///
/// For every [`CustomDraw`] of its kind, the renderer calls
/// [`prepare`](Self::prepare) while recording the frame and
/// [`draw`](Self::draw) when replaying it, in the order of the frame's
/// commands. A series may be drawn once per frame; key per-series state by
/// `draw.series` and upload incrementally with
/// `data.changes_since(draw.series, synced)`. Read the plugin's data with
/// `data.custom(draw.series)` (downcast through `&dyn Any`) and point
/// positions with `data.custom_index`.
///
/// The output must match the plugin's portable path within the golden
/// tolerance; keep CPU helpers and shaders in the same operation
/// order. Implementations must contain no chart logic (colors and
/// thresholds come from the style and `draw.params`).