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

Fix broken SVGs by not using Cairo.pattern_set_extend(p, Cairo.EXTEND_PAD) #3967

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

jkrumbiegel
Copy link
Member

@jkrumbiegel jkrumbiegel commented Jun 17, 2024

Fixes #3016 for me on Firefox and Chrome and makes such SVGs editable in Inkscape. Firefox would not show SVGs with a continuous colorbar at all before and Chrome would glitch. The command Cairo.pattern_set_extend(p, Cairo.EXTEND_PAD) was present only because otherwise you'd get blurry edges when rendering pngs. Removing it for SVG surfaces does not seem to introduce any adverse effects. The effect of the pattern extend must have changed with some of the more recent Cairo updates.

@MakieBot
Copy link
Collaborator

MakieBot commented Jun 17, 2024

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(fig)
using create display create display
GLMakie 4.32s (4.29, 4.37) 0.02+- 105.78ms (103.69, 108.29) 1.81+- 488.18ms (479.45, 495.49) 5.02+- 8.57ms (8.35, 8.77) 0.16+- 25.76ms (25.53, 26.18) 0.21+-
master 4.32s (4.26, 4.39) 0.04+- 106.44ms (104.17, 109.75) 1.75+- 491.94ms (480.54, 505.31) 8.75+- 8.64ms (8.49, 8.82) 0.11+- 25.79ms (25.53, 26.19) 0.20+-
evaluation 1.00x invariant, 0.0s (0.00d, 0.99p, 0.03std) 1.01x invariant, -0.66ms (-0.37d, 0.50p, 1.78std) 1.01x invariant, -3.76ms (-0.53d, 0.35p, 6.88std) 1.01x invariant, -0.06ms (-0.44d, 0.43p, 0.14std) 1.00x invariant, -0.03ms (-0.14d, 0.79p, 0.21std)
CairoMakie 3.96s (3.84, 4.08) 0.08+- 109.91ms (103.81, 122.19) 6.68+- 133.21ms (127.65, 148.48) 7.52+- 8.38ms (8.15, 8.68) 0.20+- 986.74μs (971.85, 997.90) 9.10+-
master 3.72s (3.61, 3.85) 0.09+- 112.26ms (105.93, 123.56) 6.68+- 136.36ms (129.28, 146.82) 5.53+- 8.39ms (8.04, 9.07) 0.35+- 987.66μs (977.02, 1010.90) 11.34+-
evaluation 0.94x slower❌, 0.24s (2.70d, 0.00p, 0.09std) 1.02x invariant, -2.35ms (-0.35d, 0.52p, 6.68std) 1.02x invariant, -3.15ms (-0.48d, 0.39p, 6.53std) 1.00x invariant, -0.0ms (-0.01d, 0.98p, 0.27std) 1.00x invariant, -0.92μs (-0.09d, 0.87p, 10.22std)
WGLMakie 4.52s (4.38, 4.82) 0.18+- 108.85ms (103.86, 114.33) 4.29+- 9.31s (8.71, 10.02) 0.58+- 9.96ms (9.23, 10.49) 0.41+- 70.89ms (69.34, 72.52) 1.14+-
master 4.64s (4.41, 4.82) 0.17+- 112.35ms (102.75, 122.16) 6.89+- 9.40s (8.90, 10.10) 0.47+- 11.11ms (10.27, 14.94) 1.69+- 71.81ms (70.87, 73.83) 1.09+-
evaluation 1.03x invariant, -0.13s (-0.72d, 0.20p, 0.18std) 1.03x invariant, -3.49ms (-0.61d, 0.28p, 5.59std) 1.01x invariant, -0.09s (-0.18d, 0.75p, 0.52std) 1.12x noisy🤷‍♀️, -1.15ms (-0.94d, 0.13p, 1.05std) 1.01x invariant, -0.92ms (-0.83d, 0.15p, 1.11std)

@jkrumbiegel jkrumbiegel merged commit 1346cb9 into master Jun 17, 2024
16 of 18 checks passed
@jkrumbiegel jkrumbiegel deleted the jk/fix-svgs-with-colorbars branch June 17, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CairoMakie SVG-export, colorbar broken in firefox/illustrator but not chrome
2 participants