Skip to content

[api-minor] Use a Path2D when doing a path operation in the canvas (bug 1946953) #19689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2025

Conversation

calixteman
Copy link
Contributor

With this patch, all the paths components are collected in the worker until a path operation is met (i.e., stroke, fill, ...).
Then in the canvas a Path2D is created and will replace the path data transfered from the worker, this way when rescaling, the Path2D can be reused.
In term of performances, using Path2D is very slightly improving speed when scaling the canvas. Since some maps can contain some consecutive operations like save, transform, path op, restore, this patch adds an optimizer for such a pattern.

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/095f00a8a6ef2ae/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/83995f36a07a9e9/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/83995f36a07a9e9/output.txt

Total script time: 37.21 mins

  • Unit tests: FAILED
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 628

Image differences available at: http://54.241.84.105:8877/83995f36a07a9e9/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/095f00a8a6ef2ae/output.txt

Total script time: 60.01 mins

@calixteman
Copy link
Contributor Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/c4b5171217b96f5/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/09e83d1b6f40b6d/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/09e83d1b6f40b6d/output.txt

Total script time: 15.99 mins

  • Regression tests: FAILED
  different ref/snapshot: 227

Image differences available at: http://54.241.84.105:8877/09e83d1b6f40b6d/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/c4b5171217b96f5/output.txt

Total script time: 29.72 mins

  • Regression tests: FAILED
  different ref/snapshot: 227

Image differences available at: http://54.193.163.58:8877/c4b5171217b96f5/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/338c785ae433d07/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/dc218d121ca7821/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/dc218d121ca7821/output.txt

Total script time: 9.57 mins

  • Regression tests: FAILED
  errors: 989
  different ref/snapshot: 19

Image differences available at: http://54.193.163.58:8877/dc218d121ca7821/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/338c785ae433d07/output.txt

Total script time: 78.87 mins

@calixteman
Copy link
Contributor Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9ce905da2ec03d8/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 1

Live output at: http://54.193.163.58:8877/ce4d058f5cc2cb0/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/9ce905da2ec03d8/output.txt

Total script time: 15.99 mins

  • Regression tests: FAILED
  different ref/snapshot: 170

Image differences available at: http://54.241.84.105:8877/9ce905da2ec03d8/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/ce4d058f5cc2cb0/output.txt

Total script time: 29.55 mins

  • Regression tests: FAILED
  different ref/snapshot: 170

Image differences available at: http://54.193.163.58:8877/ce4d058f5cc2cb0/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio-linux browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/4ce7207dc4ffac4/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/4ce7207dc4ffac4/output.txt

Total script time: 16.16 mins

  • Regression tests: FAILED
  different ref/snapshot: 177

Image differences available at: http://54.241.84.105:8877/4ce7207dc4ffac4/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/2362ae8f12f0648/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/a3aafd208837677/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/a3aafd208837677/output.txt

Total script time: 31.08 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 136

Image differences available at: http://54.241.84.105:8877/a3aafd208837677/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/2362ae8f12f0648/output.txt

Total script time: 59.54 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 136

Image differences available at: http://54.193.163.58:8877/2362ae8f12f0648/reftest-analyzer.html#web=eq.log

…ug 1946953)

With this patch, all the paths components are collected in the worker until a path
operation is met (i.e., stroke, fill, ...).
Then in the canvas a Path2D is created and will replace the path data transfered from the worker,
this way when rescaling, the Path2D can be reused.
In term of performances, using Path2D is very slightly improving speed when scaling the canvas.
@calixteman
Copy link
Contributor Author

/botio-linux browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/4f066dff73fff8a/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/4f066dff73fff8a/output.txt

Total script time: 17.16 mins

  • Regression tests: FAILED
  different ref/snapshot: 122

Image differences available at: http://54.241.84.105:8877/4f066dff73fff8a/reftest-analyzer.html#web=eq.log

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

While there's movement in many existing ref-tests, that's however not unexpected for a patch like this and the changes appear to be invisible to the naked eye.

r=me, thank you.

@calixteman
Copy link
Contributor Author

/botio unittest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/80bd0523ea3e8f9/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/df7dfc51a0b3f65/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/80bd0523ea3e8f9/output.txt

Total script time: 2.35 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/df7dfc51a0b3f65/output.txt

Total script time: 9.39 mins

  • Unit Tests: Passed

@calixteman calixteman merged commit d009e4b into mozilla:master Mar 22, 2025
9 checks passed
@calixteman
Copy link
Contributor Author

/botio makeref

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/aa9f337c4ad3370/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_makeref from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/790f4175d824d84/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/aa9f337c4ad3370/output.txt

Total script time: 16.74 mins

  • Make references: Passed
  • Check references: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/790f4175d824d84/output.txt

Total script time: 30.15 mins

  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: displaying a PDF that has undergone redactions PDF render problem on PDF.js Transform improperly applied to path
3 participants