Skip to content

fix(jian-skia): upgrade skia-safe to 0.97 for OpenPencil downstream#1

Closed
Kayshen-X wants to merge 1 commit intoZSeven-W:mainfrom
Kayshen-X:feat/skia-safe-0.97-op
Closed

fix(jian-skia): upgrade skia-safe to 0.97 for OpenPencil downstream#1
Kayshen-X wants to merge 1 commit intoZSeven-W:mainfrom
Kayshen-X:feat/skia-safe-0.97-op

Conversation

@Kayshen-X
Copy link
Copy Markdown
Contributor

Summary

升级 jian-skia 用的 skia-safe 0.78 → 0.97 以与 OpenPencil 的 P0 dep-stack 对齐(OP 已验证 skia-safe 0.97 + glutin 0.32 + glow 0.17 三 OS)。

Changes

  1. crates/jian-skia/Cargo.toml: skia-safe = "0.78""0.97.0"
  2. crates/jian-skia/src/path.rs: Path::move_to/line_to/quad_to/cubic_to/closePathBuilder::* + builder.detach() (skia-safe 0.97 拆 Path/PathBuilder 风格)
  3. crates/jian-skia/src/backend.rs: path.transform(&m)path.with_transform(&m) (0.97 改 builder pattern)
  4. crates/jian-skia/src/backend.rs: gradient_shader 模块 → gradient::shaders::{linear_gradient, radial_gradient} (deprecation 修)
  5. crates/jian-skia/src/backend.rs: 加 pub fn draw_on_canvas(&mut self, canvas: &skia_safe::Canvas, op: &DrawOp) (OpenPencil 需要在自管 GL surface canvas 上 dispatch DrawOp,原有 draw_canvas 是私有 helper)

Verification

  • cargo build -p jian-skia --features textlayout PASS (skia-safe 0.97)
  • cargo test --workspace --exclude jian-host-desktop 1000+ tests, 0 failures
  • cargo test -p jian-host-desktop --no-default-features 7 test suites PASS
  • cargo test -p jian-host-desktop --features run 7 test suites PASS
  • cargo check -p jian-core --target wasm32-unknown-unknown PASS
  • cargo clippy --workspace --all-targets --features jian-skia/textlayout -- -D warnings PASS

Why downstream

OpenPencil Step 1a (Rust-ification G1) 复用 jian-skia 作 SkiaBackend;spec v19 + plan v7 双 FROZEN 后 P0.5 prereq 必须升 skia-safe 0.97 以对齐 OP P0 dep-stack。OP 暂 pin 此 commit(<commit-sha>)作 fork pin,等待 upstream merge 后切回 ZSeven-W/jian。

Notes

draw_on_canvas API 是为 OP 自管 GPU canvas 路径加的 utility;不影响 Jian 自身 SkiaSurface flow。

@Kayshen-X
Copy link
Copy Markdown
Contributor Author

Superseded by direct branch on origin (no fork needed; ZSeven-W is owner). Reopening as origin PR.

skia-safe 0.97 split path mutation onto `PathBuilder` (`detach()`-finishes
to an immutable `Path`), replaced `Path::transform(&Matrix)` with
`Path::with_transform(&Matrix) -> Path`, and re-shaped the gradient
shader builders into `gradient::Gradient { Colors, Interpolation }`.
Also adds `SkiaBackend::draw_on_canvas(&Canvas, &DrawOp)` for hosts
that own a GPU canvas outside `SkiaSurface` (OpenPencil's
`SharedSkiaContext`).

Why: unblock GPU-canvas integration on the OP host, and pull in the
upstream renderer fixes between 0.78 and 0.97 before the
openpencil-shell kill-spike lands. Codex review (CLEAN) confirmed
API-equivalence on gradient color-space + interpolation.

cargo test -p jian-skia: 32/32 (incl. golden_corpus PNG diff).
cargo test --workspace: all green.
cargo clippy --workspace: clean under -D warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant