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
//! Brush state shared across every engine in a `DarklySession`.
//!
//! `BrushState` is the brush module's entry in [`crate::tool::ToolSession`]
//! — the generic shared-state bag every tool's cross-engine state goes
//! through. The container has no knowledge of brushes; this file is the
//! brush module's local definition of what it stores there.
//!
//! Access from inside the engine:
//!
//! ```ignore
//! let session = engine.tool_session.read();
//! let brush = session.get::<BrushState>().expect("BrushState registered at session init");
//! // … read brush.graph, brush.version, … …
//! ```
//!
//! Per-engine derived caches (compiled stroke runner, dab pool, preview
//! version cursors) stay on [`crate::engine::DarklyEngine`] — they're
//! rebuildable from this state and don't need to be shared.
use HashMap;
use crateBrushWireType;
use crate;
/// One copy of the editable brush graph plus the bookkeeping needed to
/// invalidate downstream caches when it changes. Shared across all
/// engines spawned from a single `DarklySession` via `ToolSession`.