mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 02:09:18 +02:00
chore: add max-params eslint rule
This commit is contained in:
parent
3c2b57cfc5
commit
73a0af4613
17 changed files with 79 additions and 54 deletions
|
@ -70,17 +70,23 @@ export class WebCodecsVideoDecoder implements ScrcpyVideoDecoder {
|
|||
* Enable this option may reduce performance.
|
||||
* @param canvas Optional render target cavas element or offscreen canvas
|
||||
*/
|
||||
constructor(codec: ScrcpyVideoCodecId, enableCapture: boolean, canvas?: HTMLCanvasElement | OffscreenCanvas) {
|
||||
constructor(
|
||||
codec: ScrcpyVideoCodecId,
|
||||
enableCapture: boolean,
|
||||
canvas?: HTMLCanvasElement | OffscreenCanvas,
|
||||
) {
|
||||
this.#codec = codec;
|
||||
|
||||
if (canvas) {
|
||||
this.#canvas = canvas
|
||||
} else if (typeof document !== 'undefined') {
|
||||
this.#canvas = canvas;
|
||||
} else if (typeof document !== "undefined") {
|
||||
this.#canvas = document.createElement("canvas");
|
||||
} else if (typeof OffscreenCanvas !== 'undefined') {
|
||||
} else if (typeof OffscreenCanvas !== "undefined") {
|
||||
this.#canvas = new OffscreenCanvas(0, 0);
|
||||
} else {
|
||||
throw new Error('no canvas input found nor any canvas can be created');
|
||||
throw new Error(
|
||||
"no canvas input found nor any canvas can be created",
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -33,7 +33,10 @@ export class WebGLFrameRenderer implements FrameRenderer {
|
|||
* Whether to allow capturing the canvas content using APIs like `readPixels` and `toDataURL`.
|
||||
* Enable this option may reduce performance.
|
||||
*/
|
||||
constructor(canvas: HTMLCanvasElement | OffscreenCanvas, enableCapture: boolean) {
|
||||
constructor(
|
||||
canvas: HTMLCanvasElement | OffscreenCanvas,
|
||||
enableCapture: boolean,
|
||||
) {
|
||||
const gl =
|
||||
canvas.getContext("webgl2", {
|
||||
alpha: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue