-
-
Notifications
You must be signed in to change notification settings - Fork 290
/
precompiles.jl
37 lines (35 loc) · 1000 Bytes
/
precompiles.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using PrecompileTools
macro compile(block)
return quote
let
figlike = $(esc(block))
Makie.colorbuffer(figlike)
return nothing
end
end
end
let
@setup_workload begin
x = rand(5)
@compile_workload begin
GLMakie.activate!()
screen = GLMakie.singleton_screen(false)
close(screen)
destroy!(screen)
base_path = normpath(joinpath(dirname(pathof(Makie)), "..", "precompile"))
shared_precompile = joinpath(base_path, "shared-precompile.jl")
include(shared_precompile)
try
display(plot(x); visible=false)
catch
end
Makie.CURRENT_FIGURE[] = nothing
empty!(atlas_texture_cache)
closeall()
@assert isempty(SCREEN_REUSE_POOL)
@assert isempty(ALL_SCREENS)
@assert isempty(SINGLETON_SCREEN)
end
end
nothing
end