Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
798 commits
Select commit Hold shift + click to select a range
e2ad715
Improve samples page with equal-width nav buttons and square thumbnai…
domchen Feb 12, 2026
1c42260
Fix SVG converter to skip zero-width strokes and empty layers and ful…
domchen Feb 12, 2026
d411fa2
Redesign TrimPath sample with four circles comparing separate and con…
domchen Feb 12, 2026
a10f3cf
Redesign playground page navigation with hash-based routing and simpl…
domchen Feb 12, 2026
91df693
Fix TrimPath continuous mode not being converted to the TGFX represen…
domchen Feb 12, 2026
7e8a293
Increase curved caption size for clarity.
domchen Feb 12, 2026
18f6292
Update TrimPath sample to use 0.2~0.8 range for clearer demonstration.
domchen Feb 12, 2026
297c1d4
Fix missing field conversions in PAGX to TGFX node conversion functions.
domchen Feb 12, 2026
865cc1f
Refactor navigation to preserve playback state when visiting samples …
domchen Feb 12, 2026
a5587f0
Use file URL parameter for sample playback and simplify hash routing …
domchen Feb 12, 2026
fcee81b
Clear file URL parameter when loading local files to prevent stale re…
domchen Feb 12, 2026
68d1757
Update TrimPath sample to use 0.2~0.9 range for clearer demonstration.
domchen Feb 12, 2026
7023913
Add trim range numbers to TrimPath sample labels.
domchen Feb 12, 2026
24852c2
Avoid URL encoding in file parameter by using raw path string.
domchen Feb 12, 2026
3e0c50b
Shrink TrimPath sample circles and fix vertical centering.
domchen Feb 12, 2026
afe736e
Fix URL hash leaking into file parameter and avoid trailing empty hash.
domchen Feb 12, 2026
8e1eede
Use checkerboard pattern background for sample thumbnails.
domchen Feb 12, 2026
c634fa5
Add sample file references and update TrimPath examples in both spec …
domchen Feb 12, 2026
57ee9e7
Optimize all PAGX sample files and fix Repeater default values in SKI…
domchen Feb 12, 2026
47909bf
Improve samples page UI and add browser history navigation support.
domchen Feb 12, 2026
85abfe8
Eliminate nondeterminism in PAGX text rendering by replacing unordere…
domchen Feb 12, 2026
fde5acc
Add performance optimization section to SKILL.md and optimize B.4 hex…
domchen Feb 12, 2026
23f750c
Rewrite performance optimization section with rendering cost model an…
domchen Feb 12, 2026
996a8c1
Restore original B.4 visual design while keeping canvas-clipping opti…
domchen Feb 12, 2026
a268cc0
Add fundamental constraint to SKILL.md that all optimizations must pr…
domchen Feb 12, 2026
d5f52f5
Add cross-layer style merging direction for identical DropShadowStyle…
domchen Feb 12, 2026
032767d
Add scrollRect to B.4 hex grid for precise canvas-bound clipping with…
domchen Feb 12, 2026
e4ee3b0
Add scrollRect technique to canvas-bound clipping in SKILL.md.
domchen Feb 12, 2026
19f4156
Remove scrollRect from SKILL.md optimization directions.
domchen Feb 12, 2026
11518c4
Add rule 15.8 to prefer primitive geometry over Path under Repeater f…
domchen Feb 12, 2026
d0189a5
Restore center attribute on scanning line Rectangle to fix triangle g…
domchen Feb 12, 2026
ca7fa83
Add non-obvious defaults table to SKILL.md Section 3 to prevent optim…
domchen Feb 12, 2026
a169043
update cr.md
domchen Feb 12, 2026
096cd3e
Restore center attribute on decorative tech bits Rectangle in B.4.
domchen Feb 12, 2026
e2cd2d2
Restore required startPoint attribute on LinearGradient elements acro…
domchen Feb 12, 2026
8a7f143
Move triangleMask and Resources back to top of B.4 to fix glow clippi…
domchen Feb 12, 2026
df72e08
Add mask layer position rule and required attribute warnings to SKILL…
domchen Feb 12, 2026
8ed8b5b
Add required-but-looks-optional attributes table and remove code refe…
domchen Feb 12, 2026
3b49194
Replace hex grid with three sets of parallel lines in B.4 for simpler…
domchen Feb 12, 2026
371967a
Use Group rotation instead of Layer for diagonal lines in B.4 hex grid.
domchen Feb 12, 2026
779fdaa
Fix SVG radial gradient double-transform by keeping original center a…
domchen Feb 12, 2026
7b0e378
Accept baseline changes after fixing SVG radial gradient double-trans…
domchen Feb 12, 2026
7109442
Remove redundant disabled test cases from PAGXTest and clean up unuse…
domchen Feb 12, 2026
edc9728
Fix horizontal line center to cover full canvas width in B.4 hex grid.
domchen Feb 12, 2026
9b85162
Accept baseline changes for PAGXTest after removing disabled test cases.
domchen Feb 12, 2026
ce5b92b
Add Section 15.9 decompose polygon grid into parallel line sets to SK…
domchen Feb 12, 2026
78db4f5
Replace XML code examples in PAGX spec with updated sample files.
domchen Feb 12, 2026
dd4fba7
Fix incorrect sample link filenames in Chinese PAGX spec document.
domchen Feb 12, 2026
59ea6d6
Rewrite Section 15.9 as a general rule to replace PathData with simpl…
domchen Feb 12, 2026
c570ae5
Update Appendix B with new sample content and add B.2-B.5 example sec…
domchen Feb 12, 2026
d0b9533
Replace XML code examples in Chinese PAGX spec with updated sample fi…
domchen Feb 12, 2026
5740e6e
Update B.1 code block and add B.2-B.5 example sections to Chinese PAG…
domchen Feb 12, 2026
137ff72
Add missing sample links for B.1 and update TextModifier link format …
domchen Feb 12, 2026
a3f9db9
Restructure pagx-optimize skill into three-layer progressive disclosu…
domchen Feb 12, 2026
f3bf61b
Replace std::stof and std::stoi with strtof and strtol to eliminate C…
domchen Feb 12, 2026
dbb4e82
Eliminate Path-to-SVG-to-PathData roundtrip in FontEmbedder by conver…
domchen Feb 12, 2026
7ef8073
Cache glyph type classification to avoid redundant path and image loo…
domchen Feb 12, 2026
7471548
Add Data::MakeAdopt to eliminate double allocation in Base64Decode.
domchen Feb 12, 2026
4615fed
Merge dual-pass loops into single pass for RSXform and Matrix positio…
domchen Feb 12, 2026
4e8a2bb
Optimize writeIndent and escapeXML in XMLBuilder to reduce memory rea…
domchen Feb 12, 2026
145a8fa
Remove source file links from pagx spec keeping only preview links.
domchen Feb 12, 2026
d0575d2
Simplify the text modifier processing example in section 5.5.1 to a n…
domchen Feb 12, 2026
aa11f6a
Optimize string building in XML parser and add vector reserve in shap…
domchen Feb 12, 2026
54ba55d
Remove remaining source file links from pagx spec keeping only previe…
domchen Feb 12, 2026
792950a
Embed sample code blocks for Text runtime layout and TextModifier int…
domchen Feb 12, 2026
f5d5ef6
Fix three performance issues in SVGImporter.
domchen Feb 12, 2026
f28ad00
Optimize ParseFloatList to parse floats directly from the source stri…
domchen Feb 12, 2026
a3e9ca3
Optimize Text example to demonstrate both point text and paragraph te…
domchen Feb 12, 2026
4885546
Replace lambda expressions with static functions and fix naming conve…
domchen Feb 12, 2026
b38040b
Extract ParseSemicolonSeparatedPoints helper to eliminate duplicated …
domchen Feb 12, 2026
d03b5b9
Eliminate three code duplication issues in SVGImporter by extracting …
domchen Feb 12, 2026
4ddf204
Extract ExtractGradientStops to eliminate duplicated colorStops conve…
domchen Feb 12, 2026
c54d376
Replace hardcoded Pi values with pagx::Pi constant and change static …
domchen Feb 12, 2026
bf70833
Fix low-priority issues including overflow check and reserve and swit…
domchen Feb 12, 2026
ef63c2a
Remove unnecessary XML comments from PAGX sample files while keeping …
domchen Feb 12, 2026
559ffe9
Remove unnecessary XML comments from PAGX layer and feature sample fi…
domchen Feb 12, 2026
d781f3e
Remove unnecessary XML comments from PAGX shape sample files.
domchen Feb 12, 2026
3892d1d
Remove unnecessary XML comments from PAGX paint and modifier sample f…
domchen Feb 12, 2026
bc8a61b
Remove unnecessary XML comments from PAGX text and group sample files.
domchen Feb 12, 2026
d55601e
Remove unnecessary XML comments from PAGX features overview sample file.
domchen Feb 12, 2026
8596ce0
Add PAGX quick reference with complete attribute defaults and enumera…
domchen Feb 12, 2026
04211d1
Revert Text example back to three-layer point text layout without aut…
domchen Feb 12, 2026
206dfbf
Revert Text example to original three-layer point text layout and rem…
domchen Feb 12, 2026
2ab9cec
Accept baseline changes for PAGXTest after strtof replacement and Pat…
domchen Feb 12, 2026
00f7843
Fix inaccurate descriptions in section 3.3.3 and remove incorrect fea…
domchen Feb 12, 2026
adaba80
Swap Appendix B and C so that node attribute reference comes before u…
domchen Feb 12, 2026
2ed76c9
Revert remove unnecessary XML comments from PAGX layer and feature sa…
domchen Feb 12, 2026
054bd8f
Swap Appendix B and C so that node attribute reference comes before u…
domchen Feb 12, 2026
1866f07
Accept baseline changes after swapping Appendix B and C section order…
domchen Feb 12, 2026
12c822d
Replace inline XML code blocks with sample links for sections 4.3 thr…
domchen Feb 12, 2026
91d45fa
Add PAGX_TEST macro with isolated GPU context and extract inline XML …
domchen Feb 12, 2026
2550344
Merge branch 'main' into feature/domchen_pagx
domchen Feb 12, 2026
41dcda4
Replace inline XML code blocks with sample file links and add publish…
domchen Feb 12, 2026
54ea814
Add floating preview buttons on code blocks with relative URLs instea…
domchen Feb 12, 2026
89c529f
Add left blue border to previewable code blocks and always-visible pr…
domchen Feb 12, 2026
d2a60e7
Add green sticky header bar to previewable code blocks for always-acc…
domchen Feb 12, 2026
b704a66
Switch code header to blue theme and add JS-based sticky behavior wit…
domchen Feb 12, 2026
845e5af
Use XML syntax highlight green (#22863a) for code block header and le…
domchen Feb 12, 2026
e0fe962
Use reliable marker-based preview button injection and auto-update UR…
domchen Feb 12, 2026
6d7178f
Add green left border to all XML code blocks not just previewable ones.
domchen Feb 12, 2026
37e27c9
Fix playground creating duplicate browser history entries on initial …
domchen Feb 12, 2026
7d8e446
Fix code review issues including elliptical arc conversion bug and ap…
domchen Feb 12, 2026
1caada9
Change the Chinese locale Spec button label to a localized text.
domchen Feb 13, 2026
7867a3e
Remove duplicate attribute tables from Appendix B and keep only the e…
domchen Feb 13, 2026
f0f0c4a
Fix 11 issues in PAGX spec including TrimPath edge case clarification…
domchen Feb 13, 2026
bdd9fa1
Replace matrix multiplication formulas with step-by-step transform or…
domchen Feb 13, 2026
0ea79a5
Fix code review issues including shared path converter extraction and…
domchen Feb 13, 2026
9b69f0d
Improve PAGX spec clarity on rendering pipeline order and Polystar ro…
domchen Feb 13, 2026
adfee4e
Fix Repeater opacity interpolation formula to use ceil(copies) as den…
domchen Feb 13, 2026
5dc82b4
Fix code review issues including replacing exception-throwing std::st…
domchen Feb 13, 2026
4b4c658
Fix Safari compatibility issues in playground including wasm OOB cras…
domchen Feb 13, 2026
67455ef
Remove hand-written XMLTokenizer from PAGXImporter and reuse shared X…
domchen Feb 13, 2026
961ee52
Handle CDATA sections correctly in XMLParser by flushing text at CDAT…
domchen Feb 13, 2026
efb47df
Fix spec publish script extracting wrong date from code sample conten…
domchen Feb 13, 2026
98237a8
Hide canvas during file switching and draw first frame before showing…
domchen Feb 13, 2026
01cde6d
Fix mobile touch pinch-to-zoom being too fast by switching to absolut…
domchen Feb 13, 2026
b7d0e8d
Increase curved text path radius by 5px in PAGX features sample.
domchen Feb 13, 2026
1cf4a41
Change curved text path radius from 145 to 142 to only offset 2px fro…
domchen Feb 13, 2026
ce29376
Change curved text path radius from 142 to 141 to only offset 1px fro…
domchen Feb 13, 2026
d58acd8
Accept baseline change for C.5_pagx_features after curved text path r…
domchen Feb 13, 2026
4fef460
Optimize samples page grid layout for mobile screens to show 3 column…
domchen Feb 13, 2026
a74d349
Fix data URI parsing without base64 check and simplify ColorSource ca…
domchen Feb 13, 2026
1a956d4
Move mobile samples styles after base styles to fix CSS specificity o…
domchen Feb 13, 2026
6d884b2
Refactor to reduce code duplication and improve performance across PA…
domchen Feb 13, 2026
5968530
Make nav buttons smaller and equal width for a more compact appearance.
domchen Feb 13, 2026
6d69de6
Slightly increase nav button size for better readability.
domchen Feb 13, 2026
6944244
Restore nav button height and font size while keeping equal fixed width.
domchen Feb 13, 2026
601e781
Revert nav button style changes back to original.
domchen Feb 13, 2026
7a5af22
Reduce nav button horizontal padding from 12px to 6px for a more comp…
domchen Feb 13, 2026
09a134e
Change nav button padding to uniform 8px on all sides.
domchen Feb 13, 2026
dca05b5
Add type safety to findNode and defensive checks to SVG importer.
domchen Feb 13, 2026
ef649bc
Optimize PAGX parsers and reduce code duplication across importer and…
domchen Feb 13, 2026
c9d4962
Replace browser compatibility alert with inline error UI showing mini…
domchen Feb 13, 2026
96e77e4
Update minimum browser version requirements to Chrome 69+ and Firefox…
domchen Feb 13, 2026
b7804be
Update minimum Safari version requirement from 11.3 to 15 for WebGL2 …
domchen Feb 13, 2026
192ae7f
Add minor version numbers to Chrome and Safari requirements for consi…
domchen Feb 13, 2026
60f0e76
Fix code review issues including Base64 invalid character validation …
domchen Feb 13, 2026
6c428ae
Fix code review issues in PAGX module including empty Resources outpu…
domchen Feb 13, 2026
ac4480f
Reduce unnecessary string copies in PAGXImporter and PAGXExporter and…
domchen Feb 13, 2026
c498181
Cache parsed style and CSS class properties per DOMNode to avoid repe…
domchen Feb 13, 2026
cec9971
Add adaptive tile refinement and zoom performance optimization to pla…
jinwuwu001 Feb 13, 2026
2affbb9
Forward TGFX_BUILD_LAYERS and TGFX_BUILD_SVG options to tgfx build in…
domchen Feb 13, 2026
897c28b
Refactor internal code to remove duplication and improve efficiency i…
domchen Feb 13, 2026
1fb9dce
Remove IsTypeOf from public node headers and revert findNode to direc…
domchen Feb 13, 2026
88490e1
Revert Options struct layout in SVGImporter.h to original style.
domchen Feb 13, 2026
ef520a9
Remove TGFX_BUILD_SVG option and unused tgfx SVG includes since pagx …
domchen Feb 13, 2026
71bd085
Merge branch 'feature/domchen_pagx' of github.com:Tencent/libpag into…
jinwuwu001 Feb 13, 2026
aaa9764
Fix incorrect claims and add missing caveats in pagx-optimize skill r…
domchen Feb 13, 2026
3460999
Use in-class member initializers for SVGImporter Options and remove r…
domchen Feb 13, 2026
c99f04e
Replace empty string literal initializers with brace initialization f…
domchen Feb 13, 2026
0d9b70e
Add type safety documentation to PAGXDocument findNode template method.
domchen Feb 13, 2026
3839e7a
Add documentation comments to RepeaterOrder enum values.
domchen Feb 13, 2026
abcecaf
Remove mutable from _stylePropertyCache and make getStyleProperties g…
domchen Feb 13, 2026
5e871ed
Add class documentation to ColorStop explaining its value-based stora…
domchen Feb 13, 2026
ec3f59d
Add buffer pre-allocation and move semantics to XMLBuilder for reduce…
domchen Feb 13, 2026
8a52e0b
Remove unused tuple header and fix findAttribute return type comment …
domchen Feb 13, 2026
c4ac34f
Cache fallback Font objects in shapeText to avoid repeated constructi…
domchen Feb 13, 2026
d20d78d
Sort include directives alphabetically within groups in SVGParserInte…
domchen Feb 13, 2026
2df3863
Reorder include directives alphabetically in PAGXImporter and PAGXExp…
domchen Feb 13, 2026
50e84bf
Reorder include directives in LayerBuilder.cpp by group and alphabeti…
domchen Feb 13, 2026
6ae317e
Add bounds cache to getShapeBounds to avoid redundant SVG path string…
domchen Feb 13, 2026
88c52c7
Check callback return values in XMLParser expat handlers and call XML…
domchen Feb 13, 2026
21b4f82
Remove unused DOMNode countChildren method.
domchen Feb 13, 2026
beb0d21
Remove unused SplitString and TrimString dead code from StringParser.
domchen Feb 13, 2026
91f2a59
Change getAttribute to return const string reference instead of value…
domchen Feb 13, 2026
edc899a
Extract DecodeBase64DataURI utility function to eliminate duplicate d…
domchen Feb 13, 2026
94fbedb
Add explicit default constructor to SVGImporter Options for nested st…
domchen Feb 13, 2026
5010e6c
Accept baseline changes for blendMode rendering fix in C.1_complete_e…
domchen Feb 13, 2026
487be0f
Replace manual data URI parsing with DecodeBase64DataURI in parseImag…
domchen Feb 13, 2026
24d9b0c
Remove 6 unused includes from StringParser.h.
domchen Feb 13, 2026
b01e584
Replace snprintf with FloatToString in pointToString sizeToString rec…
domchen Feb 13, 2026
72452d3
Add explicit default value parameter to DEFINE_ENUM_CONVERSION macro …
domchen Feb 13, 2026
c6c9ff6
Replace snprintf with std::to_string for glyph ID serialization in Gl…
domchen Feb 13, 2026
bcd26a9
Clarify PathData getBounds returns a control-point bounding box not t…
domchen Feb 13, 2026
42fa9be
Add reserve to ParseFloatList to reduce dynamic reallocations.
domchen Feb 13, 2026
e080e19
Replace snprintf with std::to_string in XMLBuilder::addAttribute(int)…
domchen Feb 13, 2026
06cf6ea
Avoid unnecessary substr allocation in DecodeBase64DataURI by searchi…
domchen Feb 13, 2026
b94124c
Replace manual strtof with getFloatAttribute for strokeWidth parsing …
domchen Feb 13, 2026
6d8f833
Delete copy and move operations for Data class to prevent accidental …
domchen Feb 13, 2026
816739f
Fix inaccurate comments in parseResources to reflect actual parsing l…
domchen Feb 13, 2026
eea9f5f
Reorder public API functions in PAGXImporter.cpp to match header file…
domchen Feb 13, 2026
e2db619
Remove unused tileWidth and tileHeight variables from convertPattern.
domchen Feb 13, 2026
839947e
Remove unused imageWidth and imageHeight variables from convertPattern.
domchen Feb 13, 2026
42b2241
Replace hardcoded pi calculation with DegreesToRadians in parseTransf…
domchen Feb 13, 2026
e6fdef6
Use std::move for normalized string assignment in convertText to avoi…
domchen Feb 13, 2026
6ce6ef0
Add reserve to parsePoints to reduce dynamic reallocations.
domchen Feb 13, 2026
e5e8a00
Add CSS comment skipping in ParseStyleString and parseStyleElement.
domchen Feb 13, 2026
2110e50
Preserve original layer id when merging adjacent fill and stroke layers.
domchen Feb 13, 2026
2884b47
Fix extra letterSpacing after the last glyph in shapeText.
domchen Feb 13, 2026
f026561
Fix totalWidth including extra letterSpacing after the last glyph in …
domchen Feb 13, 2026
bf10279
Cache glyph path in ClassifyGlyph to avoid duplicate getPath calls.
domchen Feb 13, 2026
435f5dd
Add fontSize guard in CollectBitmapGlyph to prevent division by zero.
domchen Feb 13, 2026
b758161
Add reserve for glyph run position containers in CreateGlyphRunForInd…
domchen Feb 13, 2026
cef1cb5
Remove unused _document member from LayerBuilderContext.
domchen Feb 13, 2026
6654027
Add defensive fontSize and unitsPerEm checks to prevent division by z…
domchen Feb 13, 2026
9e03377
Remove unnecessary clear calls on containers that are about to be des…
domchen Feb 13, 2026
19ca3ea
Add reserve for vectorIndices and bitmapIndices in FontEmbedder fourt…
domchen Feb 13, 2026
e2f5b52
Remove redundant ToTGFXPath and ToTGFXPoint wrappers and use TGFXConv…
domchen Feb 13, 2026
1665e13
Remove 4w_node SVG test file and its baseline entry from PAGXTest.
domchen Feb 13, 2026
6bc2d74
Replace static_cast enum conversions with explicit ToTGFX functions f…
domchen Feb 13, 2026
388c949
Fix incorrect include path for MathUtil.h in SVGImporter.
domchen Feb 13, 2026
73b2cfb
Revert glyph path caching in ClassifyGlyph that caused incorrect font…
domchen Feb 13, 2026
8b6899c
Remove unnecessary buffer.reserve(4096) pre-allocation in XMLBuilder.
domchen Feb 13, 2026
6b3c20f
Remove unnecessary reserve calls for vectorIndices and bitmapIndices …
domchen Feb 13, 2026
db31389
Remove _shapeBoundsCache from getShapeBounds to compute bounds direct…
domchen Feb 13, 2026
60bf2da
Remove unnecessary vector.reserve calls for contents selectors styles…
domchen Feb 13, 2026
28b14ef
Revert find-end pattern back to count in FontEmbedder glyph lookups.
domchen Feb 13, 2026
a3d7a56
Remove per-node _stylePropertyCache and compute style properties dire…
domchen Feb 13, 2026
20c4210
Remove unused #include <memory> from Layer.h Composition.h Group.h Fi…
domchen Feb 13, 2026
f8fdc90
Remove unnecessary greater-than sign escaping from escapeXML.
domchen Feb 13, 2026
9c5a895
Move duplicate node ID warning from makeNode template in header to re…
domchen Feb 13, 2026
3ae190a
Fix totalWidth being reduced by letterSpacing twice after the last gl…
domchen Feb 13, 2026
7d886e6
Remove unused SVGPathParser include from Typesetter.
domchen Feb 13, 2026
93bfaae
Simplify convertPath by passing node reversed value directly to setRe…
domchen Feb 13, 2026
552d244
Change addAttribute name parameter from const string reference to con…
domchen Feb 13, 2026
6c8f22a
Add reserve calls for shapedInfos vectors to avoid dynamic reallocation.
domchen Feb 13, 2026
dea34f2
Use snprintf with fixed buffer for pointToString sizeToString and rec…
domchen Feb 13, 2026
26cb2f6
Add symmetric rx/ry handling for SVG rect elements when one radius is…
domchen Feb 13, 2026
d21b4fb
Cache GridBackgroundLayer in PAGXView to avoid rebuilding it every fr…
domchen Feb 13, 2026
6b80e32
Merge duplicate gradient coordinate branches in convertLinearGradient…
domchen Feb 13, 2026
1a86204
Unify loop advancement in parseLayer parseResources parseContents par…
domchen Feb 13, 2026
2ef740a
Use verb count based dynamic reserve estimation in PathDataToSVGString.
domchen Feb 13, 2026
b07abb4
Replace magic number 200.0 with named constant InitialUpgradeDelayMs …
domchen Feb 13, 2026
af6e4ec
Parse glyph IDs directly as integers using strtol instead of converti…
domchen Feb 13, 2026
fd61146
Extract shared loading logic from loadPAGXFile and loadPAGXFromURL in…
domchen Feb 13, 2026
ef9b6da
Change XMLParser internal callback methods from public to private wit…
domchen Feb 13, 2026
c2e4eb0
Deduplicate DOM queries in showLoadingUI and showDropZoneUI and showE…
domchen Feb 13, 2026
cacd015
Add explicit to PAGXView single-parameter constructor to prevent impl…
domchen Feb 13, 2026
077e39b
Add use element support in parseMaskChildren for SVG mask parsing.
domchen Feb 13, 2026
7c7a7b5
Fix PathDataToSVGString reserve using verbs before its declaration.
domchen Feb 13, 2026
a9e6b30
Update pr.md.
domchen Feb 13, 2026
dc622d8
Merge FontEmbedder multi-pass scanning into single pass and extract s…
domchen Feb 13, 2026
96a62b1
Add style, title, desc, and metadata tags to the skip list in convert…
domchen Feb 13, 2026
b2e525e
Update FontEmbedder comment to accurately describe font merging strat…
domchen Feb 13, 2026
5d04970
Remove redundant static_cast<float> for Composition width and height …
domchen Feb 13, 2026
e5f2112
Add mask check in isSimpleShapeLayer to prevent merging masked layers.
domchen Feb 13, 2026
46e4788
Change CollectSpacingGlyph bitmapBuilders parameter to non-const refe…
domchen Feb 13, 2026
4fc6ae3
Remove obsolete commented-out code for group name assignment in PAGXI…
domchen Feb 13, 2026
3e0be49
Add circular reference protection for use elements in getShapeBounds.
domchen Feb 13, 2026
597cf58
Fix comment in Element.h to use Text instead of TextSpan.
domchen Feb 13, 2026
ddc7ac9
Remove extra blank line in Typesetter.cpp.
domchen Feb 13, 2026
6ab036d
Handle mask and clip-path coexistence by wrapping into a parent layer.
domchen Feb 13, 2026
7e05b85
Remove unnecessary includes of string and unordered_map from public h…
domchen Feb 13, 2026
05ec9bd
Remove unused colorToHex declaration and implementation.
domchen Feb 13, 2026
86ce592
Move parseStyleElement declaration to method section in SVGParserInte…
domchen Feb 13, 2026
ce5d5da
Support comma-separated multi-selectors in CSS parsing of parseStyleE…
domchen Feb 13, 2026
0edf6a1
Unify float member initial values to use explicit float literal style…
domchen Feb 13, 2026
652bb0f
Reorder function implementations in SVGImporter.cpp to match SVGParse…
domchen Feb 13, 2026
e9fc0d8
Reorganize pagx directory structure and extract ToTGFX converter util…
domchen Feb 13, 2026
96ceed9
Rename DOM class to XMLDOM to match the file name for better clarity.
domchen Feb 13, 2026
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
9 changes: 5 additions & 4 deletions .codebuddy/commands/cr.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ done
# 拉取最新的 main 分支
git fetch origin main

# 当前分支相对 origin/main 的完整变更(已提交 + 暂存区 + 工作区的最终结果)
git diff origin/main
# 当前分支相对 origin/main 分叉点的完整变更(已提交 + 暂存区 + 工作区的最终结果)
git diff $(git merge-base origin/main HEAD)

# 查看文件状态(用于识别未跟踪文件)
git status
Expand Down Expand Up @@ -105,8 +105,8 @@ cd /tmp/pr-review-{pr_number}
# 拉取最新的 main 分支
git fetch origin main

# 当前分支相对 origin/main 的完整变更
git diff origin/main
# 当前分支相对 origin/main 分叉点的完整变更
git diff $(git merge-base origin/main HEAD)

gh pr view {pr_number} --comments
```
Expand Down Expand Up @@ -233,3 +233,4 @@ echo "已清理临时审查环境"
9. **潜在风险**:是否引入回归风险或影响其他模块
10. **模块架构**:模块职责是否清晰,依赖方向是否合理(如核心模块不应反向依赖平台特定实现)
11. **整体设计**:结合关联代码评估修改后的整体合理性,必要时建议扩大修改范围

1 change: 0 additions & 1 deletion .codebuddy/commands/pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ description: 提交 PR - 自动识别新建或追加提交
## 前置检查

```bash
git fetch origin main && \
CURRENT_BRANCH=$(git branch --show-current) && \
echo "CURRENT_BRANCH:$CURRENT_BRANCH" && \
gh pr list --head "$CURRENT_BRANCH" --state open --json number,url && \
Expand Down
4 changes: 2 additions & 2 deletions .codebuddy/rules/Code.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ alwaysApply: true
## 编码规范

- 对话用中文,代码和注释用英语
- 所有说明文件、方案设计文件统一放在 `.codebuddy/designs/` 目录(已加入 .gitignore,不参与提交)
- 新需求禁止直接编码,先输出详细方案设计文件,穷尽疑问向用户提问,用户明确确认后再按方案编码
- 永远优先追求答案的正确性而不只是迎合用户的具体要求,特别是当用户的具体要求和正确性有冲突时要及时指出来
- 新需求的编码任务禁止直接编码,先输出关键接口和伪代码,穷尽所有疑问向用户提问,方案确认后才可编码
- 复用项目已有功能,保持变更简洁,避免重复代码
- 重构时审查关联代码合理性,顺带清理冗余,不考虑向后兼容
- 版权声明里的年份对新增的文件要使用当前年份(如 `Copyright (C) 2026 Tencent`),已有文件保持原年份不变
Expand Down
122 changes: 122 additions & 0 deletions .codebuddy/skills/pagx-optimize/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
name: pagx-optimize
description: Optimize PAGX file structure by removing redundancy, merging shared painters, extracting reusable resources, and improving readability. Use this skill when asked to optimize, simplify, or clean up a PAGX file.
argument-hint: "[file-path]"
---

# PAGX File Structure Optimization

This skill provides a systematic checklist for optimizing PAGX file structure. The goals are
to simplify file structure, reduce file size, and improve rendering performance.

## Fundamental Constraint

**All optimizations must preserve the original design appearance.** This is a hard requirement
that overrides any individual optimization direction below.

- **Allowed**: Structural transformations that produce identical or near-identical rendering
(minor pixel-level differences from node reordering or painter merging are acceptable).
- **Allowed**: Removing provably invisible content — elements entirely outside the canvas
bounds, unused resources, zero-width strokes, fully transparent elements, and other content
that contributes nothing to the final rendered image.
- **Forbidden**: Modifying any parameter that affects design intent — blur radius, spacing,
density, colors, alpha, gradient stops, font sizes, shadow offsets, stroke widths, or any
other visual attribute — unless the user explicitly approves the change.
- **Forbidden**: Reducing Repeater density (increasing spacing), lowering blur values, changing
opacity, or simplifying geometry in ways that alter the visual result, even if the change
seems minor. These are design decisions, not optimization decisions.
- **When in doubt**: If an optimization might change the rendered appearance, do not apply it.
Instead, describe the potential optimization and its visual impact to the user, and ask for
explicit approval before proceeding.

---

## Optimization Checklist

### Structure Cleanup (Sections 1-7)

| # | Optimization | When to Apply |
|---|--------------|---------------|
| 1 | Move Resources to End | `<Resources>` appears before layer tree |
| 2 | Remove Empty Elements | Empty `<Layer/>`, empty `<Resources>`, `width="0"` strokes |
| 3 | Omit Default Values | Attributes explicitly set to spec default |
| 4 | Simplify Transforms | Translation-only matrix, identity matrix, cascaded translations |
| 5 | Normalize Numerics | Scientific notation near zero, trailing decimals, short hex |
| 6 | Remove Unused Resources | Resource `id` has no `@id` reference |
| 7 | Remove Redundant Wrappers | Group/Layer with no attributes wrapping single element |

> For detailed examples and default value tables, read `references/structure-cleanup.md`.
### Painter Merging (Sections 8-9)

| # | Optimization | When to Apply |
|---|--------------|---------------|
| 8 | Merge Geometry Sharing Identical Painters | Multiple geometry elements use same Fill/Stroke |
| 9 | Merge Painters on Identical Geometry | Same geometry appears twice with different painters |

**Critical caveat (Section 8)**: Different geometry needing different painters must be isolated
with Groups. This is the most common source of errors.

> For detailed examples and scope isolation patterns, read `references/painter-merging.md`.
### Resource Reuse (Sections 10-14)

| # | Optimization | When to Apply |
|---|--------------|---------------|
| 10 | Composition Reuse | 2+ identical layer subtrees differing only in position |
| 11 | PathData Reuse | Same path data string appears 2+ times |
| 12 | Color Source Sharing | Identical gradient definitions inline in multiple places |
| 13 | Replace Path with Primitive | Path describes a Rectangle or Ellipse |
| 14 | Remove Full-Canvas Clips | Clip mask covers entire canvas |

> For detailed examples and coordinate conversion formulas, read `references/resource-reuse.md`.
### Performance Optimization (Section 15)

**Rendering Cost Model**:
- **Repeater**: N copies = N× full rendering cost (no GPU instancing)
- **Nested Repeaters**: Multiplicative (A×B elements)
- **BlurFilter / DropShadowStyle**: Cost proportional to blur radius
- **Dashed Stroke under Repeater**: Dash computation per copy
- **Layer vs Group**: Layer creates extra surface; Group is lighter

**Two categories**:
1. **Equivalent (auto-apply)**: Downgrade Layer to Group, clip Repeater to canvas bounds
2. **Suggestions (never auto-apply)**: Reduce density, lower blur, simplify geometry

> For detailed optimization techniques, read `references/performance.md`.
---

## Appendix: Core Concepts

### Painter Scope

Painters (Fill / Stroke) render **all geometry accumulated in the current scope up to that
painter's position**. Subsequent painters continue to render the same geometry.

### Group Scope Isolation

Group creates an isolated scope. Internal geometry accumulates only within the Group, and
after the Group ends, its geometry propagates upward to the parent scope.

### Layer vs Group

| Feature | Layer | Group |
|---------|-------|-------|
| Geometry propagation | No (boundary) | Yes (to parent) |
| Styles / Filters / Mask | Supported | Not supported |
| Composition / BlendMode | Supported | Not supported |
| Transform | matrix | position/rotation/scale |

**Selection rule**: Use Layer for styles/filters/mask/composition/blendMode. Otherwise prefer Group.

> For DropShadowStyle scope and color source coordinate system, see `references/painter-merging.md`
> and `references/resource-reuse.md` respectively.
---

## PAGX Specification Quick Reference

For complete attribute defaults, required attributes, and enumeration values extracted from
the PAGX spec, see `references/pagx-quick-reference.md`.
Loading