forked from 1b-agent/opencadstudio-upstream
refactor(viewport): unify content-viewport clipping on the stencil path
Rectangular paper viewports now go through the same GPU stencil clip as non-rectangular ones: viewport_clip_boundary_ndc returns the four rect corners (a full-target mask) instead of nothing, so the render path has no rect/non-rect special case — every content viewport carries a clip boundary and draws with stencil reference 0xFF. With a single clip path, the old per-wire / -image / -wipeout scissor mechanism is fully dead and removed: compute_*_scissors, the *_pixel_scissors buffers, the project_scissor helper, the per-pass set_scissor_rect blocks, the vp_scissor field threaded through WireModel / ImageModel / HatchModel and their GPU mirrors (WireGpu / ImageGpu / WipeoutGpu / HatchWebGpu), from_run's scissor parameter, the scissor grouping in build_wire_buffers, and the is_arena_eligible gate. Net -245 lines across 54 files. Rectangular viewports still clip exactly via their own render rectangle; the stencil mask is a redundant full-target no-op there, kept only so the clip code path stays uniform. XCLIP keeps its CPU wire clip. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
c97c2a8250
commit
626e8091f7
54 files changed
+32
-277
No files matched your search
@@ -1372,7 +1372,6 @@ fn tessellate_dimension_inner(
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: vec![],
|
||||
fill_tris_low: Vec::new(),
|
||||
});
|
||||
@@ -1399,7 +1398,6 @@ fn tessellate_dimension_inner(
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: vec![],
|
||||
fill_tris_low: Vec::new(),
|
||||
});
|
||||
@@ -1426,7 +1424,6 @@ fn tessellate_dimension_inner(
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: vec![],
|
||||
fill_tris_low: Vec::new(),
|
||||
});
|
||||
@@ -1454,7 +1451,6 @@ fn tessellate_dimension_inner(
|
||||
key_vertices,
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: geom.arrow_fill,
|
||||
// fill_tris_low intentionally empty: this fill renders on the top-level
|
||||
// path, where consumers (face3d_gpu, xclip) treat a short low half as
|
||||
@@ -1498,7 +1494,6 @@ fn tessellate_dimension_inner(
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: rect,
|
||||
// fill_tris_low intentionally empty: this fill renders on the
|
||||
// top-level path, where consumers (face3d_gpu, xclip) treat a
|
||||
|
||||
@@ -610,7 +610,6 @@ impl LeaderTess for Leader {
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: vec![],
|
||||
fill_tris_low: Vec::new(),
|
||||
};
|
||||
@@ -717,7 +716,6 @@ impl LeaderTess for Leader {
|
||||
key_vertices,
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris,
|
||||
fill_tris_low: Vec::new(),
|
||||
}
|
||||
|
||||
@@ -1424,7 +1424,6 @@ impl MultiLeaderTess for MultiLeader {
|
||||
key_vertices: key_verts,
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: arrow_fill,
|
||||
// fill_tris_low intentionally empty: this fill renders on the
|
||||
// top-level path, where consumers (face3d_gpu, xclip) treat a short
|
||||
@@ -1717,7 +1716,6 @@ impl MultiLeaderTess for MultiLeader {
|
||||
key_vertices: vec![],
|
||||
aabb: [nx as f32, ny as f32, xx as f32, xy as f32],
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: vec![],
|
||||
fill_tris_low: Vec::new(),
|
||||
});
|
||||
@@ -1782,7 +1780,6 @@ impl MultiLeaderTess for MultiLeader {
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris,
|
||||
fill_tris_low: Vec::new(),
|
||||
});
|
||||
@@ -1818,7 +1815,6 @@ impl MultiLeaderTess for MultiLeader {
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris: vec![],
|
||||
fill_tris_low: Vec::new(),
|
||||
});
|
||||
|
||||
@@ -773,7 +773,6 @@ pub fn tessellate_table(
|
||||
key_vertices: vec![],
|
||||
aabb: WireModel::UNBOUNDED_AABB,
|
||||
plinegen: true,
|
||||
vp_scissor: None,
|
||||
fill_tris,
|
||||
// fill_tris_low intentionally empty: this fill renders on the
|
||||
// top-level path, where consumers (face3d_gpu, xclip) treat a
|
||||
|
||||
Reference in new issue
Block a user