Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 194 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions egui-tiny-skia/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "egui-tiny-skia"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license.workspace = true

[dependencies]
egui = { version = "0.33", default-features = false, features = ["default_fonts"] }
tiny-skia = "0.11"
44 changes: 44 additions & 0 deletions egui-tiny-skia/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# egui-tiny-skia

A small, platform-agnostic `egui` backend that renders into a `tiny-skia`
`Pixmap`.

This crate is intended for OpenZT UI experiments where the integration layer can
copy pixels into the game window. The pixmap is cleared to solid magenta before
each paint call so the Windows integration can treat untouched pixels as a
chroma-key transparent color.

## Current scope

- Owns an `egui::Context`, a `tiny_skia::Pixmap`, and a CPU texture store.
- Applies egui texture deltas.
- Tessellates egui shapes into clipped mesh primitives.
- Rasterizes mesh triangles on the CPU with vertex color, texture sampling, and
alpha blending.
- Handles `Primitive::Callback` as a no-op.

Text is rendered through egui's normal font atlas texture path. There is no
separate `fontdue` glyph pipeline at the moment.

## Run tests

From the workspace root:

```bash
cargo test --manifest-path egui-tiny-skia/Cargo.toml
```

## Render PNG example

From the workspace root:

```bash
cargo run --manifest-path egui-tiny-skia/Cargo.toml --example render_png
```

The example writes:

```text
egui-tiny-skia/target/egui-tiny-skia-render.png
```

Loading