forked from 1b-agent/opencadstudio-upstream
perf(hatch): drop the boundary outline wire from the render set (#131)
A HATCH was emitting its boundary as a dense outline polyline in the wire set on top of its fill. On hatch-heavy drawings that outline was the dominant wire-instance cost — 14.9M of 19.1M segments on the #131 sample — and on integrated GPUs (shared system RAM) the per-segment instances pushed memory past the OOM threshold on open. Skip the outline in `tessellate`: hatches render as a fill, are highlighted by their fill tint when selected (#71), and are still picked by their fill area via the existing `click_hit_hatch` path, so nothing else depends on it. Wire segments drop ~78% on the sample. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
21d0db0c25
commit
1831a63236
1 file changed
+10
@@ -116,6 +116,16 @@ pub fn tessellate(
|
||||
}
|
||||
};
|
||||
|
||||
// A HATCH is drawn as a fill by the hatch pipeline and highlighted via a
|
||||
// fill tint when selected (issue #71), so it carries no boundary outline in
|
||||
// the wire set. Skipping it here drops the dense boundary polyline — the
|
||||
// dominant wire-instance cost on hatch-heavy drawings (issue #131). Picking
|
||||
// is unaffected: hatches are caught by their fill area through the existing
|
||||
// `pick::hit_test::click_hit_hatch` path, not this outline.
|
||||
if matches!(entity, EntityType::Hatch(_)) {
|
||||
return vec![];
|
||||
}
|
||||
|
||||
// MultiLeader is handled by scene/mod.rs since it emits multiple WireModels
|
||||
// (leader, text, frame, fill) with distinct colors.
|
||||
if let EntityType::Leader(leader) = entity {
|
||||
|
||||
Reference in new issue
Block a user