UNPKG

2.05 kBTypeScriptView Raw
1import { GC_MODES } from '@pixi/constants';
2import type { ISystem } from '../system/ISystem';
3import type { Renderer } from '../Renderer';
4import type { Texture } from './Texture';
5import type { RenderTexture } from '../renderTexture/RenderTexture';
6import type { ExtensionMetadata } from '@pixi/extensions';
7export interface IUnloadableTexture {
8 _texture: Texture | RenderTexture;
9 children: IUnloadableTexture[];
10}
11/**
12 * System plugin to the renderer to manage texture garbage collection on the GPU,
13 * ensuring that it does not get clogged up with textures that are no longer being used.
14 * @memberof PIXI
15 */
16export declare class TextureGCSystem implements ISystem {
17 /** @ignore */
18 static extension: ExtensionMetadata;
19 /**
20 * Count
21 * @readonly
22 */
23 count: number;
24 /**
25 * Check count
26 * @readonly
27 */
28 checkCount: number;
29 /**
30 * Maximum idle time, in seconds
31 * @see PIXI.settings.GC_MAX_IDLE
32 */
33 maxIdle: number;
34 /**
35 * Maximum number of item to check
36 * @see PIXI.settings.GC_MAX_CHECK_COUNT
37 */
38 checkCountMax: number;
39 /**
40 * Current garbage collection mode
41 * @see PIXI.settings.GC_MODE
42 */
43 mode: GC_MODES;
44 private renderer;
45 /** @param renderer - The renderer this System works for. */
46 constructor(renderer: Renderer);
47 /**
48 * Checks to see when the last time a texture was used
49 * if the texture has not been used for a specified amount of time it will be removed from the GPU
50 */
51 protected postrender(): void;
52 /**
53 * Checks to see when the last time a texture was used
54 * if the texture has not been used for a specified amount of time it will be removed from the GPU
55 */
56 run(): void;
57 /**
58 * Removes all the textures within the specified displayObject and its children from the GPU
59 * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.
60 */
61 unload(displayObject: IUnloadableTexture): void;
62 destroy(): void;
63}