Skip to content

Commit 090a3fb

Browse files
authored
Rebased version of beta 0.20 (#3113)
Continues #2831 ! Still needs to check, if I rebased correctly and didn't incorrectly apply some of the changes! ## Merged PRs - #2598 - #2746 - #2346 - #2544 - #3082 - #2868 - #3062 - #3106 - #3281 - #3246 ## TODOS - [x] fix flaky test `@test GLMakie.window_size(screen.glscreen) == scaled(screen, (W, H))` - [x] Merge axis type inferences from #2220 - [x] Test on different resolution screens, IJulia, Pluto, VSCode, Windowed - [x] rebase to only have merge commits from the PRs - [x] investigate unexpected speed ups - [x] reset camera settings from tests - [ ] check doc image generation - [x] rethink default near/far in Camera3D (compatability with OIT) - [x] merge #3246 - [x] fix WGLMakie issues/tests: - [x] fix line depth issues (see tests: ~~hexbin colorrange~~ (not new), LaTeXStrings in Axis3, Axis3 axis reversal) - [x] fix lighting of surface with nan points (fixed in #3246) - ~~volume/3D contour artifacts (see 3D Contour with 2D contour slices)~~ not new - ~~artifacting in "colorscale (lines)"~~ not new - [x] GLMakie: - [x] slight outline in "scatter image markers" test - ~~clipping/z-fighting in "volume translated"~~ not new - [x] CairoMakie: - ~~Artfiacting in `colorscale (lines)"~~ not new - ~~markersize in "scatter rotations" changed?~~ not new - ~~color change in "colorscale (poly)"~~ not new - ~~transparency/render order of "OldAxis + Surface"~~ not new - ~~render order in "Merged color mesh"~~ not new - ~~render order of "Surface + wireframe + contour"~~ not new - [x] Check "SpecApi in convert_arguments" (colors swapped?) ## Fixes the following errors - fixes #2721 via #2746 - fixes #1600 via #2746 - fixes #1236 via #2746 - fixes MakieOrg/GeoMakie.jl#133 via #2598 - closes #2522 - closes #3239 via #3246 - fixes #3238 via #3246 - fixes #2985 via #3246 - fixes #3307 via #3281
2 parents 7027768 + 2707505 commit 090a3fb

File tree

255 files changed

+14234
-4199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+14234
-4199
lines changed

.github/workflows/compilation-benchmark.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
branches:
88
- master
99
- sd/beta-20
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
1013
jobs:
1114
benchmark:
1215
name: ${{ matrix.package }}
@@ -26,6 +29,7 @@ jobs:
2629
- uses: julia-actions/setup-julia@v1
2730
with:
2831
version: '1'
32+
include-all-prereleases: true
2933
arch: x64
3034
- uses: julia-actions/cache@v1
3135
- name: Benchmark

.github/workflows/wglmakie.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- '*'
1313
branches:
1414
- master
15+
1516
concurrency:
1617
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1718
cancel-in-progress: true

CairoMakie/Project.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CairoMakie"
22
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
33
author = ["Simon Danisch <[email protected]>"]
4-
version = "0.10.12"
4+
version = "0.11.0"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -23,7 +23,7 @@ FFTW = "1"
2323
FileIO = "1.1"
2424
FreeType = "3, 4.0"
2525
GeometryBasics = "0.4.1"
26-
Makie = "=0.19.12"
26+
Makie = "=0.20.0"
2727
PrecompileTools = "1.0"
2828
SHA = "0.7, 1.6, 1.7"
2929
julia = "1.3"

CairoMakie/src/CairoMakie.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Cairo
88

99
using Makie: Scene, Lines, Text, Image, Heatmap, Scatter, @key_str, broadcast_foreach
1010
using Makie: convert_attribute, @extractvalue, LineSegments, to_ndim, NativeFont
11-
using Makie: @info, @get_attribute, Combined, MakieScreen
11+
using Makie: @info, @get_attribute, Plot, MakieScreen
1212
using Makie: to_value, to_colormap, extrema_nan
1313
using Makie.Observables
1414
using Makie: spaces, is_data_space, is_pixel_space, is_relative_space, is_clip_space

CairoMakie/src/display.jl

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ end
117117

118118
const DISABLED_MIMES = Set{String}()
119119
const SUPPORTED_MIMES = Set([
120+
map(x->string(x()), Makie.WEB_MIMES)...,
120121
"image/svg+xml",
121122
"application/pdf",
122123
"application/postscript",

CairoMakie/src/infrastructure.jl

+17-15
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function cairo_draw(screen::Screen, scene::Scene)
5757
end
5858

5959
"""
60-
is_cairomakie_atomic_plot(plot::Combined)::Bool
60+
is_cairomakie_atomic_plot(plot::Plot)::Bool
6161
6262
Returns whether the plot is considered atomic for the CairoMakie backend.
6363
This is overridden for `Poly`, `Band`, and `Tricontourf` so we can apply
@@ -66,14 +66,14 @@ CairoMakie can treat them as atomic plots and render them directly.
6666
Plots with children are by default recursed into. This can be overridden
6767
by defining specific dispatches for `is_cairomakie_atomic_plot` for a given plot type.
6868
"""
69-
is_cairomakie_atomic_plot(plot::Combined) = isempty(plot.plots) || to_value(get(plot, :rasterize, false)) != false
69+
is_cairomakie_atomic_plot(plot::Plot) = isempty(plot.plots) || to_value(get(plot, :rasterize, false)) != false
7070

7171
"""
72-
check_parent_plots(f, plot::Combined)::Bool
72+
check_parent_plots(f, plot::Plot)::Bool
7373
Returns whether the plot's parent tree satisfies the predicate `f`.
7474
`f` must return a `Bool` and take a plot as its only argument.
7575
"""
76-
function check_parent_plots(f, plot::Combined)
76+
function check_parent_plots(f, plot::Plot)
7777
if f(plot)
7878
check_parent_plots(f, parent(plot))
7979
else
@@ -87,11 +87,9 @@ end
8787

8888
function prepare_for_scene(screen::Screen, scene::Scene)
8989

90-
# get the root area to correct for its pixel size when translating
91-
root_area = Makie.root(scene).px_area[]
92-
93-
root_area_height = widths(root_area)[2]
94-
scene_area = pixelarea(scene)[]
90+
# get the root area to correct for its size when translating
91+
root_area_height = widths(Makie.root(scene))[2]
92+
scene_area = viewport(scene)[]
9593
scene_height = widths(scene_area)[2]
9694
scene_x_origin, scene_y_origin = scene_area.origin
9795

@@ -103,7 +101,7 @@ function prepare_for_scene(screen::Screen, scene::Scene)
103101
top_offset = root_area_height - scene_height - scene_y_origin
104102
Cairo.translate(screen.context, scene_x_origin, top_offset)
105103

106-
# clip the scene to its pixelarea
104+
# clip the scene to its viewport
107105
Cairo.rectangle(screen.context, 0, 0, widths(scene_area)...)
108106
Cairo.clip(screen.context)
109107

@@ -116,15 +114,15 @@ function draw_background(screen::Screen, scene::Scene)
116114
if scene.clear[]
117115
bg = scene.backgroundcolor[]
118116
Cairo.set_source_rgba(cr, red(bg), green(bg), blue(bg), alpha(bg));
119-
r = pixelarea(scene)[]
117+
r = viewport(scene)[]
120118
Cairo.rectangle(cr, origin(r)..., widths(r)...) # background
121119
fill(cr)
122120
end
123121
Cairo.restore(cr)
124122
foreach(child_scene-> draw_background(screen, child_scene), scene.children)
125123
end
126124

127-
function draw_plot(scene::Scene, screen::Screen, primitive::Combined)
125+
function draw_plot(scene::Scene, screen::Screen, primitive::Plot)
128126
if to_value(get(primitive, :visible, true))
129127
if isempty(primitive.plots)
130128
Cairo.save(screen.context)
@@ -145,11 +143,11 @@ end
145143
# instead of the whole Scene
146144
# - Recognize when a screen is an image surface, and set scale to render the plot
147145
# at the scale of the device pixel
148-
function draw_plot_as_image(scene::Scene, screen::Screen, primitive::Combined, scale::Number = 1)
146+
function draw_plot_as_image(scene::Scene, screen::Screen, primitive::Plot, scale::Number = 1)
149147
# you can provide `p.rasterize = scale::Int` or `p.rasterize = true`, both of which are numbers
150148

151-
# Extract scene width in pixels
152-
w, h = Int.(scene.px_area[].widths)
149+
# Extract scene width in device indepentent units
150+
w, h = size(scene)
153151
# Create a new Screen which renders directly to an image surface,
154152
# specifically for the plot's parent scene.
155153
scr = Screen(scene; px_per_unit = scale)
@@ -178,3 +176,7 @@ end
178176
function draw_atomic(::Scene, ::Screen, x)
179177
@warn "$(typeof(x)) is not supported by cairo right now"
180178
end
179+
180+
function draw_atomic(::Scene, ::Screen, x::Makie.PlotList)
181+
# Doesn't need drawing
182+
end

CairoMakie/src/overrides.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ complex and slower to draw than standard paths with single color.
99
function draw_plot(scene::Scene, screen::Screen, poly::Poly)
1010
# dispatch on input arguments to poly to use smarter drawing methods than
1111
# meshes if possible
12-
draw_poly(scene, screen, poly, to_value.(poly.input_args)...)
12+
return draw_poly(scene, screen, poly, to_value.(poly.args)...)
1313
end
1414

1515
# Override `is_cairomakie_atomic_plot` to allow `poly` to remain a unit,

CairoMakie/src/precompiles.jl

+6
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ let
1515
include(shared_precompile)
1616
end
1717
end
18+
precompile(draw_atomic_scatter, (Scene, Cairo.CairoContext, Tuple{typeof(identity),typeof(identity)},
19+
Vector{ColorTypes.RGBA{Float32}}, Vec{2,Float32}, ColorTypes.RGBA{Float32},
20+
Float32, BezierPath, Vec{2,Float32}, Quaternionf,
21+
Mat4f, Vector{Point{2,Float32}},
22+
Mat4f, Makie.FreeTypeAbstraction.FTFont, Symbol,
23+
Symbol))

0 commit comments

Comments
 (0)