Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const GIF_DEFAULTS = {
MAX_FPS: 50,
};

const ANGLE_MODES = {
GL: "gl",
GL_EGL: "gl-egl",
};

// the different capture modes
const CAPTURE_MODES = ["CANVAS", "VIEWPORT"];
// the different trigger modes
Expand Down Expand Up @@ -476,7 +481,11 @@ program
"--captureInterval <captureInterval>",
"Interval between frames for GIF"
)
.option("--playbackFps <playbackFps>", "Playback speed for GIF");
.option("--playbackFps <playbackFps>", "Playback speed for GIF")
.option(
"--angleMode <angleMode>",
"The angle mode to use for the capture (GL, GL_EGL)"
);

program.parse(process.argv);

Expand All @@ -499,6 +508,7 @@ const main = async () => {
frameCount = GIF_DEFAULTS.FRAME_COUNT,
captureInterval = GIF_DEFAULTS.CAPTURE_INTERVAL,
playbackFps = GIF_DEFAULTS.PLAYBACK_FPS,
angleMode = ANGLE_MODES.GL_EGL,
} = program.opts();

console.log("running capture with params:", {
Expand All @@ -513,6 +523,7 @@ const main = async () => {
frameCount,
captureInterval,
playbackFps,
angleMode,
});

// default parameter for triggerMode
Expand Down Expand Up @@ -577,12 +588,8 @@ const main = async () => {
"--disable-dev-shm-usage",
"--enable-logging",
"--use-gl=angle",
"--use-angle=gl",
`--use-angle=${angleMode}`,
"--use-cmd-decoder=passthrough",
"--ignore-gpu-blocklist",
"--enable-webgl",
"--enable-webgl2",
"--disable-gpu-driver-bug-workarounds",
],
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH,
});
Expand Down
Loading