summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 562ed89f..7010c863 100644
--- a/build.zig
+++ b/build.zig
@@ -142,6 +142,7 @@ pub fn build(b: *std.Build) void {
const mupdf_check = b.step("mupdf-check", "compile, link, render, and search docs/design.pdf with MuPDF");
const pdf_bench_step = b.step("pdf-bench", "benchmark real MuPDF page rendering (-- [--json] [--reps N] [--warmup N] [--path FILE] [--page N] [--pages N])");
const pdf_sections_bench_step = b.step("pdf-sections-bench", "benchmark PDF outline/sections paths in ReleaseFast (-Doptimize=ReleaseFast -- [--json] [--reps N] [--warmup N])");
+ const pdf_pointer_bench_step = b.step("pdf-pointer-bench", "time PDF hover and selection gestures and prove their pixels (-Doptimize=ReleaseFast -- [--label L] [--reps N] [--path FILE] [--cell WxH])");
const pdf_scroll_bench_step = b.step("pdf-scroll-bench", "benchmark fast continuous-strip PDF scrolling in ReleaseFast (-Doptimize=ReleaseFast -- [--json] [--reps N] [--warmup N] [--path FILE])");
if (!enable_mupdf)
mupdf_check.dependOn(&b.addFail("mupdf-check is unavailable with -Dmupdf=false").step);
@@ -151,6 +152,8 @@ pub fn build(b: *std.Build) void {
pdf_sections_bench_step.dependOn(&b.addFail("pdf-sections-bench is unavailable with -Dmupdf=false").step);
if (!enable_mupdf)
pdf_scroll_bench_step.dependOn(&b.addFail("pdf-scroll-bench is unavailable with -Dmupdf=false").step);
+ if (!enable_mupdf)
+ pdf_pointer_bench_step.dependOn(&b.addFail("pdf-pointer-bench is unavailable with -Dmupdf=false").step);
const shaders_step = b.step("shaders", "refresh paired shaders/prebuilt/*.spv + *.glsl snapshots (glslc)");
const update_shaders = b.addUpdateSourceFiles();
@@ -482,6 +485,22 @@ pub fn build(b: *std.Build) void {
run_pdf_sections_bench.setCwd(b.path("."));
pdf_sections_bench_step.dependOn(&run_pdf_sections_bench.step);
+ const pdf_pointer_bench = b.addExecutable(.{
+ .name = "pardes-pdf-pointer-bench",
+ .root_module = b.createModule(.{
+ .target = target,
+ .optimize = .ReleaseFast,
+ .root_source_file = b.path("test/pdf_pointer_bench.zig"),
+ .link_libc = true,
+ }),
+ });
+ pdf_pointer_bench.root_module.addImport("pardes", core_module);
+ pdf_pointer_bench.root_module.addImport("mupdf", mupdf_mod);
+ const run_pdf_pointer_bench = b.addRunArtifact(pdf_pointer_bench);
+ if (b.args) |args| run_pdf_pointer_bench.addArgs(args);
+ run_pdf_pointer_bench.setCwd(b.path("."));
+ pdf_pointer_bench_step.dependOn(&run_pdf_pointer_bench.step);
+
const pdf_scroll_bench = b.addExecutable(.{
.name = "pardes-pdf-scroll-bench",
.root_module = b.createModule(.{