-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
75 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
using FFMPEG | ||
|
||
"Represents an animation object" | ||
struct Animation | ||
dir::String | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using SnoopPrecompile | ||
|
||
if get(ENV, "PLOTS_PRECOMPILE", "true") == "true" | ||
@precompile_setup begin | ||
n = length(_examples) | ||
imports = sizehint!(Expr[], n) | ||
examples = sizehint!(Expr[], 10n) | ||
for i in setdiff(1:n, _backend_skips[:gr]) | ||
_examples[i].external && continue | ||
(imp = _examples[i].imports) === nothing || push!(imports, imp) | ||
func = gensym(string(i)) | ||
push!(examples, quote | ||
$func() = begin # evaluate each example in a local scope | ||
# @show $i # debug | ||
$(_examples[i].exprs) | ||
if $i == 1 # only for one example | ||
fn = tempname() | ||
pl = current() | ||
gui(pl) | ||
savefig(pl, "$fn.png") | ||
savefig(pl, "$fn.pdf") | ||
end | ||
nothing | ||
end | ||
$func() | ||
end) | ||
end | ||
withenv("GKSwstype" => "nul") do | ||
@precompile_all_calls begin | ||
eval.(imports) | ||
gr() | ||
eval.(examples) | ||
# eventually eval for another backend ... | ||
end | ||
end | ||
end | ||
end |