/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/rendering/renderers/shared/renderTarget/isRenderingToScreen.ts
18 строк
689 B
Zyie
feat: WebGPU-first RenderTarget attachment architecture & TextureView depth sampling (#12091)
08 июл 2026, 13:22
Не верифицирован
08 июл 2026, 13:22
f4b382b
Код
Авторство
О чём код?
/* eslint-disable no-restricted-globals */ import type { RenderTarget } from './RenderTarget'; /** * Checks if the render target is viewable on the screen * Basically, is it a canvas element and is that canvas element in the DOM * @param renderTarget - the render target to check * @returns true if the render target is viewable on the screen * @internal */ export function isRenderingToScreen(renderTarget: RenderTarget): boolean { if (renderTarget.colorAttachments.length === 0) return false; const resource = renderTarget.colorTexture.resource; return ((globalThis.HTMLCanvasElement && resource instanceof HTMLCanvasElement) && document.body.contains(resource)); }