-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[api-minor] Remove the use of (get/put)ImageData when drawing SMasks (bug 1874013) #18029
Conversation
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/0feb0b21b97d482/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/0a021c7af3d4282/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/0feb0b21b97d482/output.txt Total script time: 27.54 mins
Image differences available at: http://54.241.84.105:8877/0feb0b21b97d482/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/0a021c7af3d4282/output.txt Total script time: 42.37 mins
Image differences available at: http://54.193.163.58:8877/0a021c7af3d4282/reftest-analyzer.html#web=eq.log |
b2a7b21
to
f9bf4bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems generally fine, with the movement in the reference-tests inline with what you'd expect from this sort of patch (since there's mostly off-by-one changes in the pixel-values).
One thing to note, that however should not block this PR: This will "break", and essentially regress, SMask rendering in Node.js environments.
Given that the PDF.js library is still usable for general PDF parsing in Node.js, with only rendering affected, combined with Node.js being listed as "mostly" supported in the FAQ this seems fine to me.
Users affected by this should thus be encouraged to implement/polyfill (general) filter-support for Node.js environments.
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/a3d493b8457d6dc/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/a3d493b8457d6dc/output.txt Total script time: 1.18 mins Published |
Did you already test pdf.js with https://www.npmjs.com/package/skia-canvas ? or with CanvasKit: https://www.npmjs.com/package/canvaskit-wasm ? CanvasKit looks interesting: |
I've not done that, however it'd probably not help without additional work on the PDF.js side of things. (But as said above that should not block this PR, I just wanted to mention that to prevent surprises later.) Note how nothing filter-related currently works in Node.js, since it's using pdf.js/src/display/node_utils.js Line 83 in 77e2182
which simply extends pdf.js/src/display/base_factory.js Lines 18 to 38 in 77e2182
|
…(bug 1874013) and implement then in using some SVG filters and composition. Composing in using destination-in in order to multiply RGB components by the alpha from the mask isn't perfect: it'd be a way better to natively have alpha masks support, it induces some small rounding errors and consequently computed RGB are approximatively correct. In term of performance, it's a real improvement, for example, the pdf in issue mozilla#17779 is now rendered in few seconds. There are still some room for improvement, but overall it should be a way better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me, thank you!
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/31cf2e12253af63/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/706e735560c221e/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/31cf2e12253af63/output.txt Total script time: 19.98 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/706e735560c221e/output.txt Total script time: 25.33 mins
|
/botio-windows makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/adec702218bff64/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/adec702218bff64/output.txt Total script time: 25.37 mins
|
Good job, and When are we going to release it? |
It fixes mozilla#18956. In the patch mozilla#18029, for performance reasons and because I thought it was useless, I deliberately chose to not fill the mask with the backdrop color when it's full black: it was a bad idea. So in this patch we always add the backdrop color to the mask.
It fixes mozilla#18956. In the patch mozilla#18029, for performance reasons and because I thought it was useless, I deliberately chose to not fill the mask with the backdrop color when it's full black: it was a bad idea. So in this patch we always add the backdrop color to the mask.
and implement then in using some SVG filters and composition. Composing in using destination-in in order to multiply RGB components by the alpha from the mask isn't perfect: it'd be a way better to natively have alpha masks support, it induces some small rounding errors and consequently computed RGB are approximatively correct.
In term of performance, it's a real improvement, for example, the pdf in issue #17779 is now rendered in few seconds.
There are still some room for improvement, but overall it should be a way better.