Skip to content
Merged
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
20 changes: 19 additions & 1 deletion ADR/006-shared-canvas-extraction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ADR 006 — Shared Canvas Extraction from Loki

**Status:** Proposed
**Status:** Accepted
**Date:** 2024-11-01
**Deciders:** AppThere core team

Expand Down Expand Up @@ -37,3 +37,21 @@ This gate is tracked in the Loki ADR backlog (Loki ADR TBD). The status field of
- Iris Phase 1 cannot begin `iris-canvas` implementation until the Loki extraction is complete. The workspace scaffold includes `iris-canvas` as a stub to maintain the dependency graph, but implementation is blocked.
- Any bug fix or improvement to the `CustomPaintSource` integration must be made in `appthere-canvas` and will benefit both Loki and Iris.
- `appthere-canvas` must be kept free of document semantics — it must not know about pages, layers, tiles, or paths.

## Implementation notes

The extraction target was loki-render-cache, not loki-vello as originally assumed.
loki-vello is entirely Loki-specific (document layout painters) and was not extracted.

appthere-canvas = loki-render-cache + FontDataCache + event-driven scroll helpers.

Changes made during extraction:
- PageCache<K: CacheKey> — generic key type (was PageIndex hardcoded)
- BlitPipeline struct — blit pipeline cached, not recreated per downsample
- FontDataCache — moved from loki-vello, re-exported there for API stability
- use_settle_detector — event-driven via tokio::sync::watch (was 16ms poll)
- LokiPageSource.renderer — shared Arc<Mutex<>> from RendererState (was per-page)
- loki-text migrated to loki-renderer; document_source.rs and wgpu_surface.rs deleted

iris-canvas uses iris_pixel::TileCoord as its CacheKey.
appthere-canvas lives at crates/appthere-canvas/ (excluded from workspace members).
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Check `ADR/006-shared-canvas-extraction.md` for current status.
| Crate | Gate condition |
|---|---|
| `iris-aif` | loki-opc path dep at `crates/loki-opc/` — GATE OPEN (ADR 008) |
| `iris-canvas` | `appthere-canvas` published and Loki updated to consume it |
| `iris-canvas` | appthere-canvas at crates/appthere-canvas/ — GATE OPEN (ADR 006) |

Until gates are open, these crates exist as stubs only (`lib.rs` with a `// TODO` comment).

Expand Down
Loading
Loading