-
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
Convert src/display/svg.js
to ES6 syntax and implement setRenderingIntent
and setFlatness
for the SVG backend
#10674
Conversation
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/7b561dc3fd5e84e/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/7b561dc3fd5e84e/output.txt Total script time: 2.16 mins Published |
@Snuffleupagus Would you perhaps, time permitting, be willing to review this? |
I don't really have any experience working with the SVG code, so unfortunately I don't think I'll have time until the next weekend; but if you don't mind waiting I'll see what I can do :-) |
No problem, and thanks! |
In particular, this should reduce intermediate string creation by using template strings and reduce variable lookup times by removing unneeded variables and caching `this.current` in more places.
This mirrors the canvas implementation where we ignore these operators. This avoids console spam regarding unimplemented operators we're not interested in. For the Tracemonkey paper, we're now down to one warning about tiling patterns which is in fact a valid one.
…ping only once There is no need to recompute this for every operator list we encounter.
aecc9c1
to
5a03b1c
Compare
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/5027f3167aabe00/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/5027f3167aabe00/output.txt Total script time: 1.83 mins Published |
The commit messages contain more information about the individual changes.
The objective is to modernize the SVG backend and bring it more in line with the canvas back-end. Once this is done, it becomes easier to include the open pull requests for the SVG backend as well as working towards implementing reference testing for the SVG backend. The latter is now difficult because the canvas and SVG backend don't share a common interface. After this patch, we can start to extract a common interface and have both backends implement that so they can be interchanged more easily. After that, the remaining drawing code and the test driver need to be made backend-agnostic.
In short, this pull request is the first step towards this goal (part of the open "SVG backend" project).
I recommend to use the
?w=1
flag to considerably reduce the size of the diff.