feat(pineal): cierra stub export — PlanRecorder + exporter SVG

Fase F: primer stub de pineal cerrado.

pineal-render:
- PlanRecorder — un Canvas que graba cada llamada como RenderCmd en un
  RenderPlan. Es el puente painter→backend-diferido y la infraestructura
  de testing (snapshot de planes).

pineal-export:
- svg::to_svg(plan, w, h) — RenderPlan → documento SVG completo.
  Cubre FillRect/StrokeRect/StrokeLine/StrokePolyline/DrawText +
  FillTriangleStrip (strip→polígonos con color promedio). XML-escape
  en texto. v1: clips ignorados (documentado).
- pdf queda como placeholder documentado.

Tests: 1 recorder + 4 svg (well-formed, primitivas, xml-escape,
triangle-strip→polygons). cargo check --workspace verde.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
sergio
2026-05-20 14:11:03 +00:00
parent 8cd8003dd5
commit b75e22fa91
4 changed files with 335 additions and 17 deletions
+2
View File
@@ -23,6 +23,7 @@ pub mod color;
pub mod geom;
pub mod canvas;
pub mod plan;
pub mod recorder;
#[cfg(feature = "gpui")]
pub mod gpui_backend;
@@ -31,6 +32,7 @@ pub use color::Color;
pub use geom::{Point, Rect};
pub use canvas::{Canvas, StrokeStyle};
pub use plan::{RenderCmd, RenderPlan};
pub use recorder::PlanRecorder;
#[cfg(feature = "gpui")]
pub use gpui_backend::WindowCanvas;