-
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
minor improvements and code cleanup for canvas.js #5446
minor improvements and code cleanup for canvas.js #5446
Conversation
|
||
var glyph = this.processingType3; | ||
|
||
if (COMPILE_TYPE3_GLYPHS && glyph && !('compiled' in glyph)) { | ||
var MAX_SIZE_TO_COMPILE = 1000; | ||
if (COMPILE_TYPE3_GLYPHS && glyph && glyph['compiled'] !== undefined) { |
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.
The last comparison looks off. The old code is !('compiled' in glyph)
, so shouldn't it be !glyph['compiled']
in the new code?
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.
correct. I reverted this once and seemed to have missed that when retyping. thanks!
81fcf8f
to
00b95d9
Compare
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/6ec16c70295539f/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/6bd5b60d74ddd8d/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/6bd5b60d74ddd8d/output.txt Total script time: 17.10 mins
Image differences available at: http://107.22.172.223:8877/6bd5b60d74ddd8d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/6ec16c70295539f/output.txt Total script time: 22.36 mins
Image differences available at: http://107.21.233.14:8877/6ec16c70295539f/reftest-analyzer.html#web=eq.log |
hu, the image diffs are interesting. need to check whats with that. |
00b95d9
to
6869697
Compare
okay, pretty stupid math error. |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/0b989db6ebb4dd6/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/8557598532920fb/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/8557598532920fb/output.txt Total script time: 17.11 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/0b989db6ebb4dd6/output.txt Total script time: 22.39 mins
|
|
||
var glyph = this.processingType3; | ||
|
||
if (COMPILE_TYPE3_GLYPHS && glyph && !('compiled' in glyph)) { | ||
var MAX_SIZE_TO_COMPILE = 1000; | ||
if (COMPILE_TYPE3_GLYPHS && glyph && glyph['compiled'] === undefined) { |
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.
nit: glyph.compiled === undefined
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.
i am fine with changing, but there are more places.
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 fine -- we can fix that latter. I'm looking at that in this code context. Thanks
Good to go with comment above fixed. Thanks |
d034a32
to
c1b8e01
Compare
@@ -829,7 +829,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { | |||
}, | |||
setDash: function CanvasGraphics_setDash(dashArray, dashPhase) { | |||
var ctx = this.ctx; | |||
if ('setLineDash' in ctx) { | |||
if (ctx['setLineDash'] !== undefined) { |
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.
Oh, are you talking about these? Yeah, let's fix these too.
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.
done
c1b8e01
to
6ffcafe
Compare
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/9f550d10b0c6b14/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/e3038493bfc1e31/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/9f550d10b0c6b14/output.txt Total script time: 17.52 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/e3038493bfc1e31/output.txt Total script time: 22.70 mins
|
destCtx.setLineDash(sourceCtx.getLineDash()); | ||
destCtx.lineDashOffset = sourceCtx.lineDashOffset; | ||
} else if ('mozDash' in sourceCtx) { | ||
} else if (sourceCtx.mozDash !== undefined) { |
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.
I remember mozDash property has to create an array, can we switch that to the mozDashOffset check?
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.
done
6ffcafe
to
5405b1c
Compare
minor improvements and code cleanup for canvas.js
Excellent! Thank you. |
…Canvasjs minor improvements and code cleanup for canvas.js
These changes are by products of my investigations on slow pdfs.
The impact disappears in the noise, but I still would like to merge them:
What I find interesting is that a (possibly flawed) benchmark for the
floor+ceil code vs the modulo variant shows so dramatic differences:
http://jsperf.com/floor-and-ceil-or-modulo
I had expected that modulo is faster than invoking the methods, but
the safari 8 result blows my mind. Additionally, I am wondering about
the reason for the Firefox regression for a calculation which has a
modulo !== 0