77 static std::unique_ptr<HeadlessSurface>
create(
79 std::string* last_error_out =
nullptr);
107 std::string* error_out =
nullptr);
Definition canvas.hpp:240
One-call wrapper for the existing offscreen Dawn + Skia path (GpuSurface::create_dawn() + native_surf...
Definition headless_surface.hpp:40
virtual ~HeadlessSurface()=default
std::function< void(canvas::Canvas &)> PaintFn
Caller-supplied paint callback.
Definition headless_surface.hpp:71
virtual bool is_ready() const =0
True when the underlying GpuSurface + SkiaSurface are live and ready to accept paint callbacks.
virtual Rgba render_rgba(const PaintFn &paint)=0
Run one offscreen frame: begin_frame → fill → user paint → read pixels → end_frame.
static uint64_t rgba_fingerprint(const Rgba &rgba)
Cheap deterministic fingerprint of an RGBA buffer — FNV-1a 64.
virtual std::vector< uint8_t > render_png(const PaintFn &paint)=0
Convenience: render and PNG-encode in one call.
virtual std::string last_error() const =0
Last error message recorded by the wrapper. Empty when no error.
static std::vector< uint8_t > encode_png(const Rgba &rgba, std::string *error_out=nullptr)
PNG-encode an already-captured RGBA buffer.
static std::unique_ptr< HeadlessSurface > create(const Config &config, std::string *last_error_out=nullptr)
Create a headless offscreen surface, or nullptr if Skia/Dawn aren't available or the underlying GpuSu...
Definition affine_transform.hpp:24
TextRasterPolicy
Glyph preblend a surface is created with.
Definition text_raster_policy.hpp:33
@ legacy
Definition text_raster_policy.hpp:34
Definition gpu_fwd.hpp:31
Definition headless_surface.hpp:42
uint32_t width
Definition headless_surface.hpp:43
uint8_t clear_g
Definition headless_surface.hpp:52
canvas::TextRasterPolicy text_raster_policy
Glyph preblend handed to SkiaSurface::Config.
Definition headless_surface.hpp:56
uint8_t clear_r
Background fill applied before the user paint callback runs.
Definition headless_surface.hpp:51
uint32_t height
Definition headless_surface.hpp:44
uint8_t clear_a
Definition headless_surface.hpp:54
float scale_factor
HiDPI scale factor handed to SkiaSurface::Config.
Definition headless_surface.hpp:46
uint8_t clear_b
Definition headless_surface.hpp:53
Definition headless_surface.hpp:59
bool empty() const
Definition headless_surface.hpp:64
std::vector< uint8_t > pixels
RGBA, 4 bytes/pixel, row-major top→bottom.
Definition headless_surface.hpp:60
uint32_t height
Definition headless_surface.hpp:62
uint32_t width
Definition headless_surface.hpp:61
size_t pixel_count() const
Definition headless_surface.hpp:65