-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Introduce paintSolidColorImageMask command to handle 1x1 solid image #4474
Introduce paintSolidColorImageMask command to handle 1x1 solid image #4474
Conversation
Awesome patch. Looks like it's a special case of fillRect. Using too much getImageData will slow down stuff on the main thread. Let's recognize 1x1 image pattern on the worker thread on convert that into (e.g. fillRect or something) -- we can get the color there without painting on the canvas. Could you check if you can add that to the https://github.com/mozilla/pdf.js/blob/master/src/core/evaluator.js#L1706 and introduce paintSolidColorImage command on the canvas? |
Ok, will look into that. |
Pushed an according fix. If that is ok i can squash the two commits to one. |
Awesome, thanks /botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/1b7b2dd7db23ca3/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/69c1037c64a7d80/output.txt |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/1b7b2dd7db23ca3/output.txt Total script time: 25.82 mins
Image differences available at: http://107.21.233.14:8877/1b7b2dd7db23ca3/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/69c1037c64a7d80/output.txt Total script time: 37.75 mins
Image differences available at: http://107.22.172.223:8877/69c1037c64a7d80/reftest-analyzer.html#web=eq.log |
The failing tests on Chrome are expected, Blink engine doesn't handle drawing lines with drawImage well (http://chriskr.github.io/tests/canvas-draw-line-with-image.html). About the failing tests on Firefox, i don't know, worked here locally without any errors. The differences seem to be minimal. |
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/d684de48ba6a6a0/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/cb9b08d169e2880/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/d684de48ba6a6a0/output.txt Total script time: 25.95 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/cb9b08d169e2880/output.txt Total script time: 36.51 mins
|
Introduce paintSolidColorImageMask command to handle 1x1 solid image
thank you for the patch |
You're welcome :) |
@@ -2128,6 +2128,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { | |||
} | |||
}, | |||
|
|||
paintSolidColorImageMask: | |||
function CanvasGraphics_paintSolidColorImageMask() { | |||
this.ctx.fillRect(0, 0, 1, 1); |
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.
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.
That's defect in Firefox 32 for Linux only. See https://bugzilla.mozilla.org/show_bug.cgi?id=1050788
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.
couldnt we eliminate the rendering of transparent items at all?
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.
@CodingFabian, color is set to black so it's not transparent. See source code of the minimal test case https://bug1050788.bugzilla.mozilla.org/attachment.cgi?id=8470100 that demonstrates issue with Firefox 32 for Linux.
Fixes #4436