Skip to content

Add PAGX module with spec, importer, exporter, SVG converter, and web playground#3278

Merged
Hparty merged 798 commits intomainfrom
feature/domchen_pagx
Feb 13, 2026
Merged

Add PAGX module with spec, importer, exporter, SVG converter, and web playground#3278
Hparty merged 798 commits intomainfrom
feature/domchen_pagx

Conversation

@domchen
Copy link
Collaborator

@domchen domchen commented Feb 13, 2026

Summary

  • Migrate the PAGX module from tgfx to libpag, including a complete XML-based vector graphics format with spec documentation (EN/CN), strongly-typed node structures, importer/exporter, SVG-to-PAGX converter, and a web-based playground viewer
  • Add rendering support via LayerBuilder, FontEmbedder, Typesetter, and ShapedText for converting PAGX nodes to tgfx draw calls with full text shaping and font embedding
  • Include comprehensive test coverage (PAGXTest) with screenshot baseline comparisons for SVG conversion and PAGX rendering

Test plan

  • Verify cmake -G Ninja -DPAG_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -B cmake-build-debug && cmake --build cmake-build-debug --target PAGFullTest compiles successfully
  • Run PAGXTest suite and verify all screenshot baselines pass
  • Test web playground builds and renders PAGX files correctly in Chrome 69+ and Safari 15+
  • Verify SVG-to-PAGX conversion produces correct output for all test SVG files in resources/apitest/SVG/
  • Confirm PAGX spec samples in spec/samples/ render correctly in the playground

…d_map iteration with stable vector-based traversal order.
Comment on lines +46 to +55
for (int y = 0; y < height; y += tileSize) {
bool draw = (y / tileSize) % 2 == 1;
for (int x = 0; x < width; x += tileSize) {
if (draw) {
recorder->addRect(
tgfx::Rect::MakeXYWH(static_cast<float>(x), static_cast<float>(y),
static_cast<float>(tileSize), static_cast<float>(tileSize)),
tilePaint);
}
draw = !draw;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第二个for循环可以每次 x += 2 * tileSize,循环可以节省一半

@Hparty Hparty merged commit 4563d02 into main Feb 13, 2026
9 checks passed
@Hparty Hparty deleted the feature/domchen_pagx branch February 13, 2026 11:34
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.

5 participants