render: replay equations in native Skia PNG output#626
Closed
seo-rii wants to merge 3 commits into
Closed
Conversation
Owner
PR #626 처리 결과cherry-pick 머지 완료 ( 처리 옵션옵션 A — 3 commits 단계별 cherry-pick (author seorii 보존, committer edward). 본 환경 결정적 검증 (모두 통과)
신규 native-skia 테스트 영역 (PR 본문 정합)
메인테이너 PNG 시각 판정 ★ 통과권위 영역 —
본 PR 의 본질 영역 정체성
후속 영역 (PR 본문 명시)
본 PR 의 가치 영역
긴 시간 + 717 LOC ( |
edwardkim
added a commit
that referenced
this pull request
May 7, 2026
PR #626 (Follow-up to #599, P5 단계 native Skia equation replay) 처리 완료 후속 영역: - mydocs/pr/archives/pr_626_review.md (1차 검토 + 옵션 분석 + cherry-pick simulation) - mydocs/pr/archives/pr_626_report.md (처리 결과 + native-skia 검증 + PNG 시각 판정 통과) - mydocs/orders/20260507.md PR #626 entry 추가 처리 결과 요약: - 옵션 A: 3 commits 단계별 cherry-pick (author seorii 보존) - devel commits: 067a18b (본질 +717 LOC equation_conv.rs) + dac1caa (docs P5) + 2f6918a (atop fix) - cargo test --lib (default) 1155 / cargo test --features native-skia skia --lib 22 (수식 replay 신규 테스트 포함) - clippy default + native-skia 0 / WASM 4,578,641 bytes (native-skia 영역 외) - 메인테이너 PNG 시각 판정 ★ 통과 (samples/exam_math.hwp 20 페이지 1.5MB) - PR #626 close + 한글 댓글 (연결 이슈 부재 — Follow-up to #599) 본 PR 의 정체성: - opt-in feature 영역 (native-skia) — 기본 빌드 영역 영향 부재 - PR #599 의 follow-up — P4 → P5 단계 진행 - DTP 엔진 (project_dtp_identity) native PNG 렌더링 영역 본질 영역 강화 본 사이클 (5/7) PR 처리 누적: 11건
This was referenced May 7, 2026
Closed
edwardkim
added a commit
that referenced
this pull request
May 7, 2026
PR #627 (Task #624 exam_science p2 7번 글상자 ㉠ 사각형 y 회귀 정정 — Task #520 부분 회귀 복원) 처리 완료 후속 영역: - mydocs/pr/archives/pr_627_review.md (1차 검토 + 옵션 분석 + 본 환경 cherry-pick simulation + 권위 영역 직접 측정) - mydocs/pr/archives/pr_627_report.md (처리 결과 + TDD 흐름 영역 + 결정적 검증 + 권위 영역 100% 일치 + 시각 판정 통과) - mydocs/orders/20260507.md PR #627 entry 추가 처리 결과 요약: - 옵션 A: 5 commits 단계별 cherry-pick (TDD 흐름 영역 보존) - mydocs/orders/20260506.md add/add 충돌 → ours 영역 본 환경 보존 (PR #622 패턴 정합) - devel commits: fc8675c (Stage 0) + dc94a55 (Stage 1 RED) + e042a15 (Stage 2 분석) + f8085c8 (Stage 2 정정) + c55ee3c (Stage 3) — author Jaeook Ryu + Co-Authored-By Claude 5 commits 모두 보존 - cargo test --lib 1156 (test_624 RED → GREEN 정합) / svg_snapshot 7/7 / issue_546/554/418/501 통과 / clippy 0 - WASM 4,578,751 bytes (PR #626 baseline +110) - rhwp-studio/public/{rhwp_bg.wasm,rhwp.js} 갱신 (vite dev server web 영역) - 권위 영역 100% 일치: ㉠ rect y=235.413 + ㉠ text y=251.453 (PR 본문 정확 일치) - 메인테이너 web editor 시각 판정 ★ 통과 - PR #627 close + Issue #624 수동 close + 한글 댓글 본질 정정의 가치: - TDD 흐름 영역의 권위 패턴 (Stage 1 RED → Stage 2 정정 → Stage 3 GREEN) - feedback_close_issue_verify_merged 권위 사례 강화 누적 (PR #620 Task #519 누락 + 본 PR Task #520 누락 = PR #561 cherry-pick base diff 점검 누락 패턴) - 회귀 차단 가드 영구 보존 (test_624_textbox_inline_shape_y_on_line2_p2_q7) 본 사이클 (5/7) PR 처리 누적: 12건
This was referenced May 8, 2026
edwardkim
added a commit
that referenced
this pull request
May 9, 2026
본질: PR #599 (P4 PNG raster backend) + PR #626 (P5 equation replay) 후속의 P6 단계. native Skia 경로 영역 의 RawSvg leaf 영역 placeholder fallback 영역 → 실제 raster (resvg + tiny-skia 영역) 정합. 기존 (renderer.rs:763): PaintOp::RawSvg { bbox, .. } => draw_placeholder(*bbox, "svg") 정정: rasterize_svg_fragment_to_png + draw_image_bytes 영역 재사용 영역. 신규 함수 (image_conv.rs +82 LOC): - draw_svg_fragment(canvas, fragment, x, y, w, h, sampling) -> bool - rasterize_svg_fragment_to_png(fragment, w, h) -> Option<Vec<u8>> - svg_parse_options() -> usvg::Options<'static> renderer.rs:760+ (line +88/-6): - PaintOp::RawSvg { bbox, raw } 영역 의 draw_svg_fragment 호출 - invalid SVG 영역 fallback placeholder 영역 보존 보안 가드 (영향 좁힘): - MAX_SVG_FRAGMENT_BYTES = 4 MB (fragment 크기 가드) - MAX_SVG_RASTER_PIXELS = 67M (8192x8192 영역 raster 가드) - resolve_string = Box::new(|_, _| None) (external href 차단 — file:// / http:// / https:// 등) - resolve_data = usvg 기본 data: URI resolver (data: URI 만 허용) - resources_dir = None (디렉터리 자동 탐색 차단) - Wrapper SVG: <svg xmlns="..." width="..." height="..." viewBox="...">{fragment}</svg> 의존성 (Cargo.toml): - native-skia feature 영역 의 dep:resvg 추가 - resvg = { version = "0.45", optional = true } 회귀 가드 테스트 (2건 신규): - renders_raw_svg_fragment_as_colored_ink: green rect 100+ green 픽셀 검증 - raw_svg_replay_does_not_load_external_file_hrefs: 외부 file href 영역 red 0 픽셀 검증 (보안 가드 작동 입증) 영향 범위: - native Skia PNG/VLM 경로 영역 의 차트/OLE/내장 SVG 영역 fragment 영역 실제 렌더링 - WASM/browser SVG / CanvasKit / form replay 영역 무영향 (별건) - 다른 PaintOp 영역 (Image, Equation, Path, Text 등) 무영향 비목표 명시 (PR 본문): - browser/WASM SVG replay / CanvasKit raw SVG replay - full SVG security policy 설계 - network/file resource loading - animated SVG / SVG filter 전체 parity - form native replay / VLM preset 확장 (#613) - PNG DPI metadata (#614) 검증: - cargo test --release: lib 1173 + 통합 ALL GREEN, failed 0 - cargo test --release --features native-skia skia --lib: 24/24 PASS (신규 2건 회귀 가드 + 기존 22건) - cargo clippy --release --features native-skia --lib -- -D warnings: 통과 - 광범위 sweep 7 fixture / 170 페이지 / 회귀 0 (Skia 영역 무관 영역, native-skia 미사용 영역 sweep 정합 확정) @seo-rii 7번째 사이클 PR (Skia 영역 트래킹 #536 영역 의 단계적 진전 영역). PR #165 (skia 도입) → #419 (PageLayerTree) → #456 (Canvas 라우팅) → #498 (visual diff) → #599 (P4 PNG) → #626 (P5 equation) → #720 (P6 raw SVG). refs #536 Co-Authored-By: seorii <me@seorii.page> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim
added a commit
that referenced
this pull request
May 10, 2026
PR #740 (@oksure) 옵션 A 처리 — 4 commits cherry-pick + 자기 정정 + no-ff merge. 본질 정정 (1 file, +245/-2): - src/renderer/skia/renderer.rs (+245/-2): · 양식 개체 5종 정적 드로잉 (placeholder 영역 영역 실제 외형 변환) - PushButton: 둥근 사각형(RRect) + 중앙 캡션 - CheckBox: 사각 체크박스 + 체크마크(V자) + 캡션 - RadioButton: 원형 테두리 + 내부 점 + 캡션 - ComboBox: 입력 필드 + 드롭다운 화살표 + 텍스트 - Edit: 입력 필드 + 텍스트 · CSS #rrggbb → Skia Color 변환 utility (parse_css_color) · CJK fallback chain (맑은 고딕/나눔고딕/AppleGothic → custom_typefaces → font_mgr → legacy) · glyph 크기 bbox 비례 자동 조정 (8~14px) 원본 commits (4건): - 58b839a Task #536 P7: native Skia form control static replay - 2889d9f Copilot 리뷰 반영: RRect import + bg_color 일관 + ComboBox/Edit text-only - a8093f2 CI 수정: Path::new() → PathBuilder (native-skia 호환) - 3b5a027 fix: form control 텍스트 렌더링 CJK fallback 적용 본 환경 자기 정정 (commit `4be49daa`): - impl SkiaLayerRenderer (line 793) 닫힘 brace 누락 발견 — CI Build & Test job 75178101688 (native-skia tests) 동일 결함 발생 - 4번째 commit 85c05bc (CJK fallback) 에서 standalone fn → method 변환 시 impl 닫힘 brace 누락 - 자기 정정 1줄 추가 (line 1025) 자기 검증: - cherry-pick 충돌 0건 (auto-merge 정합) - cargo build --release --features native-skia ✅ 통과 (자기 정정 후) - cargo test --release --features native-skia --lib skia ✅ 24/24 PASS - rhwp export-png samples/form-01.hwp ✅ form-01.png 13353 bytes 생성 - 작업지시자 SVG 시각 판정 ✅ 통과 PR supersede 체인: - PR #599 (P4) → PR #626 (P5) → PR #720 (P6) → PR #740 (P7) — Issue #536 단계적 진전 - 동일 컨트리뷰터 @oksure (PR #599/#626/#720 영역 영역 P4-P6) → @oksure (P7) 영역 영역 정합 Part of #536
This was referenced May 10, 2026
edwardkim
added a commit
that referenced
this pull request
May 10, 2026
P9 단계 — native Skia text replay 영역 기존 TextRunNode payload 영역 더 많이 소비. 단순 glyph drawing 영역 layer payload 의 text metadata 영역 가능 범위 영역 replay. Skia native raster 트래킹 (Issue #536) 의 단계적 진전: - P4 #599 → P5 #626 → P6 #720 → P8 #761 → P9 #769 P9 본질 보강: - char overlap / tab leader / text decoration (underline/strike/overline) - shade/shadow/outline-style effect - emphasis dot (한글 강조점) - vertical rotation (세로쓰기) - output options 영역 control mark replay 인프라 도입 — text_replay.rs 모듈 분리 (P10 → P9 통합): - src/renderer/skia/text_replay.rs 신규 (+748) - renderer.rs 영역 page/layer replay orchestration 영역 집중 - src/renderer/skia/mod.rs 모듈 등록 본 환경 cherry-pick: - 49b540a (P8) → empty (PR #761 머지 완료 영역 동일 본질) → skip - 8f079b1 (P9 본질 1) → cherry-pick - c74fb92 (P9 본질 2, split) → cherry-pick Non-goals (PR 본문 명시): - full text source table / glyph-run IR 미포함 - Skia 영역 기본 public render path 전환 부재 - targeted raster test 외 visual/pixel regression infrastructure 추가 부재 검증: - cargo build/test/clippy --release ALL GREEN - cargo test --features native-skia --lib skia → 28/28 PASS (신규 4건 + 기존 24건) - renders_char_overlap_text_run_as_ink - renders_decorated_text_as_ink - renders_tab_leader_for_empty_text_run - renders_output_control_marks_as_ink - cargo clippy --release --features native-skia --lib -- -D warnings 통과 - 광범위 sweep 7 fixture / 170 페이지 / 회귀 0 (skia 만 영역 svg sweep 무영향 입증) - 시각 판정 면제 (작업지시자 결정 — targeted raster + sweep 통과 + Skia 만 변경) Refs #536
edwardkim
added a commit
that referenced
this pull request
May 11, 2026
…ract (P11) P11 단계 — P9 영역 영역 text replay parity 후속 영역 영역 Text IR v2 compatibility contract 추가. Skia native raster Issue #536 트래킹 단계적 진전: P4 #599 → P5 #626 → P6 #720 → P8 #761 → P9 #769 → P11 #797 중요: 본 PR 은 GlyphRun 을 기본 경로로 만드는 PR 이 아니라 TextRun v2 compatibility contract 를 완성하는 PR. 4 본질 원칙: - Compatibility first — 모든 backend 가 TextRun fallback 으로 렌더링 가능 - Additive schema — schemaMinorVersion + feature negotiation (기존 consumer 미파괴) - Source traceability — text_sources + TextRun.source span - Placement/cluster metadata — paintStyle/projectionKind/orientation/placement/clusterBasis/clusters/legacyVisuals 신규 인프라: - PaintOp::{CharOverlap, TextControlMark, TabLeader, TextDecoration} — explicit visual ops - PageLayerTree.text_sources + TextSourceTable (export-local) - TextRun.source span + 7 신규 metadata - schemaMinorVersion + resourceTableMinorVersion + feature negotiation - docs/text-ir-v2.md migration contract Renderer 정정 — 4 backend 동기 (feedback_image_renderer_paths_separate 권위 사례): - svg_layer.rs / canvas.rs / skia/renderer.rs / web_canvas.rs — 신규 special visual op skip (double-painting 방지) Non-goals (Still designing): - GlyphRun eligibility / font resource table / cluster basis / fallback diagnostics — P12+ 분리 검증: - cargo build/test/clippy --release ALL GREEN (clippy -D warnings) - native-skia 28/28 PASS (PR #769 인프라 보존) - 광범위 sweep 7 fixture / 170 페이지 / 회귀 0 (Compatibility first 원칙 입증) - 시각 판정 면제 (작업지시자 결정 — contract 정합 단계 + 결정적 검증 + sweep 통과) Refs #536
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 요약
이번 PR은 P4에서 들어간 native Skia PNG 렌더링 경로에 수식 replay를 추가합니다.
P4까지는
PaintOp::Equation이 native Skia 경로에서 placeholder 박스로만 그려졌는데, 이 PR에서는 기존 equation layout tree(EquationNode.layout_box)를 Skia canvas에 직접 replay하도록 바꿉니다. 그래서render_page_png_native나export-png처럼 native Skia PNG 경로를 타는 출력에서 수식이 빈 박스처럼 빠지지 않습니다.구현 범위는 일부러 좁게 잡았습니다.
src/renderer/skia/equation_conv.rs를 추가해서 equation layout node를 Skia draw call로 변환합니다.PaintOp::Equation처리에서EquationNode.layout_box를 사용하고, bbox 폭 차이가 있을 때는 x축 scale로 맞춥니다.#599에서
export-png와 VLM/Vision 쪽 사용 흐름이 들어왔기 때문에, 이 PR은 그 PNG 출력 품질을 바로 보강하는 성격입니다. 다만 #613 같은 VLM preset 확장이나 #614 DPI metadata는 이 PR 범위에 넣지 않습니다.관련 이슈
테스트
cargo test --features native-skia skia --lib통과cargo clippy --features native-skia --lib -- -D warnings통과cargo clippy -- -D warnings통과cargo check --target wasm32-unknown-unknown --lib통과cargo test통과스크린샷
없음.
이 PR은 native Skia raster backend 내부 replay 보강이고, 테스트는 수식이 placeholder가 아니라 실제 colored ink로 렌더링되는지 확인하는 방식으로 추가했습니다.