Spawns and communicates with the sandbox child binary. Not thread-safe: construct one instance per thread that needs to render.
More...
#include "donner/editor/sandbox/SandboxHost.h"
|
| | SandboxHost (std::string childBinaryPath) |
| RenderResult | renderToBackend (std::string_view svgBytes, int width, int height, svg::RendererInterface &target) |
| | Renders svgBytes into a caller-provided RendererInterface via the sandbox child + host-side ReplayingRenderer. The child's wire stream is decoded into target — after this call returns with kOk, the target has received beginFrame(), a sequence of drawing calls, and endFrame(), same as if the driver had run in-process.
|
|
RenderResult | render (std::string_view svgBytes, int width, int height) |
| | Convenience wrapper: renders via renderToBackend into a host-side Renderer and encodes the snapshot to PNG. Preserves the S1 public contract so existing callers (tests, CLIs) don't have to change.
|
Spawns and communicates with the sandbox child binary. Not thread-safe: construct one instance per thread that needs to render.
◆ SandboxHost()
| donner::editor::sandbox::SandboxHost::SandboxHost |
( |
std::string | childBinaryPath | ) |
|
|
explicit |
- Parameters
-
| childBinaryPath | Absolute path to the donner_parser_child executable. Callers in tests should resolve this via donner::Runfiles. |
◆ renderToBackend()
Renders svgBytes into a caller-provided RendererInterface via the sandbox child + host-side ReplayingRenderer. The child's wire stream is decoded into target — after this call returns with kOk, the target has received beginFrame(), a sequence of drawing calls, and endFrame(), same as if the driver had run in-process.
- Parameters
-
| svgBytes | Raw SVG source (may contain any bytes; not NUL-terminated). |
| width | Canvas width in CSS pixels. |
| height | Canvas height in CSS pixels. |
| target | Destination renderer. Must outlive this call. |
The documentation for this class was generated from the following file: