Skip to content
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

Apply transfer filters to any graphic commands #16115

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

calixteman
Copy link
Contributor

No description provided.

@calixteman calixteman linked an issue Mar 6, 2023 that may be closed by this pull request
@Snuffleupagus
Copy link
Collaborator

As far as I can tell, this won't actually work in environments without OffscreenCanvas support (i.e. older browsers and Node.js); do we consider that to be a problem?
My gut feeling is that the answer is no, especially considering just how rare transferMaps are in practice, but I wanted to ask nonetheless.

@calixteman
Copy link
Contributor Author

Good question.
Right now, you're right because I expected to only have transfer maps with images, hence the filter factory is only created when we've OffscreenCanvas.
So we could just always have the filter factory and only keep a ref on the maps array when we're in non-offscreencanvas mode.
Wdyt of filing a bug for this case and I'll fix that later (or someone else could it, it could be a good first bug) ?

@Snuffleupagus
Copy link
Collaborator

So we could just always have the filter factory and only keep a ref on the maps array when we're in non-offscreencanvas mode.

This situation seems to (mostly) apply to Node.js, and it's not clear to me if the node-canvas package first of all supports canvas-filters at all. Secondly the FilterFactory will definitely not work in Node.js, and it's again not clear to me if a Node-version of that code could actually be (easily) created.

Wdyt of filing a bug for this case and I'll fix that later (or someone else could it, it could be a good first bug) ?

Given the points above, I'm somewhat doubtful if we can even make it work (for Node.js) and thus it's probably not a good beginner bug unfortunately.

@Snuffleupagus
Copy link
Collaborator

Also, do we need to include the filter when copying the canvas state?

function copyCtxState(sourceCtx, destCtx) {
const properties = [
"strokeStyle",
"fillStyle",
"fillRule",
"globalAlpha",
"lineWidth",
"lineCap",
"lineJoin",
"miterLimit",
"globalCompositeOperation",
"font",
];

src/display/canvas.js Outdated Show resolved Hide resolved
src/display/canvas.js Outdated Show resolved Hide resolved
@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Mar 7, 2023

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/614c9287dfef61c/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 7, 2023

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/991d7b8748074a7/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 7, 2023

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/614c9287dfef61c/output.txt

Total script time: 27.11 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 10
  different first/second rendering: 1

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

@pdfjsbot
Copy link

pdfjsbot commented Mar 7, 2023

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/991d7b8748074a7/output.txt

Total script time: 32.87 mins

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

Image differences available at: http://54.193.163.58:8877/991d7b8748074a7/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.

r=me, with passing tests; thank you!

@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

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/c30d66f7338cf21/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Linux m4)


Failed

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

Total script time: 26.75 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 10
  different first/second rendering: 1

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

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Windows)


Failed

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

Total script time: 33.53 mins

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

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

@calixteman calixteman merged commit a0ef5a4 into mozilla:master Mar 8, 2023
@calixteman
Copy link
Contributor Author

/botio makeref

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

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/49458dc44daf339/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/497452f070874c5/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/49458dc44daf339/output.txt

Total script time: 22.77 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/497452f070874c5/output.txt

Total script time: 23.81 mins

  • Lint: Passed
  • Make references: FAILED

@calixteman
Copy link
Contributor Author

I had frequently this error with Firefox and local dev but when I switched to workerModule=true it disappeared.
@Snuffleupagus, should we enable workerModule for tests either ?

@calixteman
Copy link
Contributor Author

/botio-windows makeref

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/80df97a5578dcf3/output.txt

@Snuffleupagus
Copy link
Collaborator

I had frequently this error with Firefox and local dev but when I switched to workerModule=true it disappeared. @Snuffleupagus, should we enable workerModule for tests either ?

I don't understand how that option matters for the browser-tests, since the default viewer isn't actually being used there (the tests call the API directly).

@pdfjsbot
Copy link

pdfjsbot commented Mar 8, 2023

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/80df97a5578dcf3/output.txt

Total script time: 23.97 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

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

Successfully merging this pull request may close these issues.

Transfer Maps must applied with all the graphic commands
3 participants