sdfsdfs
This commit is contained in:
62
node_modules/pixi.js/lib/prepare/PrepareBase.d.ts
generated
vendored
Normal file
62
node_modules/pixi.js/lib/prepare/PrepareBase.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Container } from '../scene/container/Container';
|
||||
import type { TextureSource } from '../rendering/renderers/shared/texture/sources/TextureSource';
|
||||
import type { Texture } from '../rendering/renderers/shared/texture/Texture';
|
||||
import type { Renderer } from '../rendering/renderers/types';
|
||||
import type { GraphicsContext } from '../scene/graphics/shared/GraphicsContext';
|
||||
import type { Text } from '../scene/text/Text';
|
||||
/** The accepted types to pass to the prepare system */
|
||||
export type PrepareSourceItem = Container | TextureSource | Texture | GraphicsContext;
|
||||
/** The valid types resolved to the queue ready for upload */
|
||||
export type PrepareQueueItem = TextureSource | Text | GraphicsContext;
|
||||
/**
|
||||
* Part of the prepare system. Responsible for uploading all the items to the GPU.
|
||||
* This class provides the base functionality and handles processing the queue asynchronously.
|
||||
* @memberof rendering
|
||||
*/
|
||||
export declare abstract class PrepareBase {
|
||||
/** The number of uploads to process per frame */
|
||||
static uploadsPerFrame: number;
|
||||
/** Reference to the renderer */
|
||||
protected renderer: Renderer;
|
||||
/** The queue to process over a async timer */
|
||||
protected queue: PrepareQueueItem[];
|
||||
/** Collection of callbacks to call when the uploads are finished */
|
||||
protected resolves: ((value: void | PromiseLike<void>) => void)[];
|
||||
/** Timeout id for next processing call */
|
||||
protected timeout?: number;
|
||||
/**
|
||||
* @param {rendering.Renderer} renderer - A reference to the current renderer
|
||||
*/
|
||||
constructor(renderer: Renderer);
|
||||
/** Resolve the given resource type and return an item for the queue */
|
||||
protected abstract resolveQueueItem(source: PrepareSourceItem, queue: PrepareQueueItem[]): void;
|
||||
protected abstract uploadQueueItem(item: PrepareQueueItem): void;
|
||||
/**
|
||||
* Return a copy of the queue
|
||||
* @returns {PrepareQueueItem[]} The queue
|
||||
*/
|
||||
getQueue(): PrepareQueueItem[];
|
||||
/**
|
||||
* Add a textures or graphics resource to the queue
|
||||
* @param {PrepareSourceItem | PrepareSourceItem[]} resource
|
||||
*/
|
||||
add(resource: PrepareSourceItem | PrepareSourceItem[]): this;
|
||||
/**
|
||||
* Recursively add a container and its children to the queue
|
||||
* @param {Container} container - The container to add to the queue
|
||||
*/
|
||||
private _addContainer;
|
||||
/**
|
||||
* Upload all the textures and graphics to the GPU (optionally add more resources to the queue first)
|
||||
* @param {PrepareSourceItem | PrepareSourceItem[] | undefined} resource
|
||||
*/
|
||||
upload(resource?: PrepareSourceItem | PrepareSourceItem[]): Promise<void>;
|
||||
/** eliminate duplicates before processing */
|
||||
dedupeQueue(): void;
|
||||
/** called per frame by the ticker, defer processing to next tick */
|
||||
private readonly _tick;
|
||||
/** process the queue up to max item limit per frame */
|
||||
private readonly _processQueue;
|
||||
/** Call all the resolve callbacks */
|
||||
private _resolve;
|
||||
}
|
114
node_modules/pixi.js/lib/prepare/PrepareBase.js
generated
vendored
Normal file
114
node_modules/pixi.js/lib/prepare/PrepareBase.js
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
'use strict';
|
||||
|
||||
var Container = require('../scene/container/Container.js');
|
||||
var _const = require('../ticker/const.js');
|
||||
var Ticker = require('../ticker/Ticker.js');
|
||||
|
||||
"use strict";
|
||||
const _PrepareBase = class _PrepareBase {
|
||||
/**
|
||||
* @param {rendering.Renderer} renderer - A reference to the current renderer
|
||||
*/
|
||||
constructor(renderer) {
|
||||
/** called per frame by the ticker, defer processing to next tick */
|
||||
this._tick = () => {
|
||||
this.timeout = setTimeout(this._processQueue, 0);
|
||||
};
|
||||
/** process the queue up to max item limit per frame */
|
||||
this._processQueue = () => {
|
||||
const { queue } = this;
|
||||
let itemsProcessed = 0;
|
||||
while (queue.length && itemsProcessed < _PrepareBase.uploadsPerFrame) {
|
||||
const queueItem = queue.shift();
|
||||
this.uploadQueueItem(queueItem);
|
||||
itemsProcessed++;
|
||||
}
|
||||
if (queue.length) {
|
||||
Ticker.Ticker.system.addOnce(this._tick, this, _const.UPDATE_PRIORITY.UTILITY);
|
||||
} else {
|
||||
this._resolve();
|
||||
}
|
||||
};
|
||||
this.renderer = renderer;
|
||||
this.queue = [];
|
||||
this.resolves = [];
|
||||
}
|
||||
/**
|
||||
* Return a copy of the queue
|
||||
* @returns {PrepareQueueItem[]} The queue
|
||||
*/
|
||||
getQueue() {
|
||||
return [...this.queue];
|
||||
}
|
||||
/**
|
||||
* Add a textures or graphics resource to the queue
|
||||
* @param {PrepareSourceItem | PrepareSourceItem[]} resource
|
||||
*/
|
||||
add(resource) {
|
||||
const resourceArray = Array.isArray(resource) ? resource : [resource];
|
||||
for (const resourceItem of resourceArray) {
|
||||
if (resourceItem instanceof Container.Container) {
|
||||
this._addContainer(resourceItem);
|
||||
} else {
|
||||
this.resolveQueueItem(resourceItem, this.queue);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Recursively add a container and its children to the queue
|
||||
* @param {Container} container - The container to add to the queue
|
||||
*/
|
||||
_addContainer(container) {
|
||||
this.resolveQueueItem(container, this.queue);
|
||||
for (const child of container.children) {
|
||||
this._addContainer(child);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Upload all the textures and graphics to the GPU (optionally add more resources to the queue first)
|
||||
* @param {PrepareSourceItem | PrepareSourceItem[] | undefined} resource
|
||||
*/
|
||||
upload(resource) {
|
||||
if (resource) {
|
||||
this.add(resource);
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
if (this.queue.length) {
|
||||
this.resolves.push(resolve);
|
||||
this.dedupeQueue();
|
||||
Ticker.Ticker.system.addOnce(this._tick, this, _const.UPDATE_PRIORITY.UTILITY);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
/** eliminate duplicates before processing */
|
||||
dedupeQueue() {
|
||||
const hash = /* @__PURE__ */ Object.create(null);
|
||||
let nextUnique = 0;
|
||||
for (let i = 0; i < this.queue.length; i++) {
|
||||
const current = this.queue[i];
|
||||
if (!hash[current.uid]) {
|
||||
hash[current.uid] = true;
|
||||
this.queue[nextUnique++] = current;
|
||||
}
|
||||
}
|
||||
this.queue.length = nextUnique;
|
||||
}
|
||||
/** Call all the resolve callbacks */
|
||||
_resolve() {
|
||||
const { resolves } = this;
|
||||
const array = resolves.slice(0);
|
||||
resolves.length = 0;
|
||||
for (const resolve of array) {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
/** The number of uploads to process per frame */
|
||||
_PrepareBase.uploadsPerFrame = 4;
|
||||
let PrepareBase = _PrepareBase;
|
||||
|
||||
exports.PrepareBase = PrepareBase;
|
||||
//# sourceMappingURL=PrepareBase.js.map
|
1
node_modules/pixi.js/lib/prepare/PrepareBase.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareBase.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
112
node_modules/pixi.js/lib/prepare/PrepareBase.mjs
generated
vendored
Normal file
112
node_modules/pixi.js/lib/prepare/PrepareBase.mjs
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
import { Container } from '../scene/container/Container.mjs';
|
||||
import { UPDATE_PRIORITY } from '../ticker/const.mjs';
|
||||
import { Ticker } from '../ticker/Ticker.mjs';
|
||||
|
||||
"use strict";
|
||||
const _PrepareBase = class _PrepareBase {
|
||||
/**
|
||||
* @param {rendering.Renderer} renderer - A reference to the current renderer
|
||||
*/
|
||||
constructor(renderer) {
|
||||
/** called per frame by the ticker, defer processing to next tick */
|
||||
this._tick = () => {
|
||||
this.timeout = setTimeout(this._processQueue, 0);
|
||||
};
|
||||
/** process the queue up to max item limit per frame */
|
||||
this._processQueue = () => {
|
||||
const { queue } = this;
|
||||
let itemsProcessed = 0;
|
||||
while (queue.length && itemsProcessed < _PrepareBase.uploadsPerFrame) {
|
||||
const queueItem = queue.shift();
|
||||
this.uploadQueueItem(queueItem);
|
||||
itemsProcessed++;
|
||||
}
|
||||
if (queue.length) {
|
||||
Ticker.system.addOnce(this._tick, this, UPDATE_PRIORITY.UTILITY);
|
||||
} else {
|
||||
this._resolve();
|
||||
}
|
||||
};
|
||||
this.renderer = renderer;
|
||||
this.queue = [];
|
||||
this.resolves = [];
|
||||
}
|
||||
/**
|
||||
* Return a copy of the queue
|
||||
* @returns {PrepareQueueItem[]} The queue
|
||||
*/
|
||||
getQueue() {
|
||||
return [...this.queue];
|
||||
}
|
||||
/**
|
||||
* Add a textures or graphics resource to the queue
|
||||
* @param {PrepareSourceItem | PrepareSourceItem[]} resource
|
||||
*/
|
||||
add(resource) {
|
||||
const resourceArray = Array.isArray(resource) ? resource : [resource];
|
||||
for (const resourceItem of resourceArray) {
|
||||
if (resourceItem instanceof Container) {
|
||||
this._addContainer(resourceItem);
|
||||
} else {
|
||||
this.resolveQueueItem(resourceItem, this.queue);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Recursively add a container and its children to the queue
|
||||
* @param {Container} container - The container to add to the queue
|
||||
*/
|
||||
_addContainer(container) {
|
||||
this.resolveQueueItem(container, this.queue);
|
||||
for (const child of container.children) {
|
||||
this._addContainer(child);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Upload all the textures and graphics to the GPU (optionally add more resources to the queue first)
|
||||
* @param {PrepareSourceItem | PrepareSourceItem[] | undefined} resource
|
||||
*/
|
||||
upload(resource) {
|
||||
if (resource) {
|
||||
this.add(resource);
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
if (this.queue.length) {
|
||||
this.resolves.push(resolve);
|
||||
this.dedupeQueue();
|
||||
Ticker.system.addOnce(this._tick, this, UPDATE_PRIORITY.UTILITY);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
/** eliminate duplicates before processing */
|
||||
dedupeQueue() {
|
||||
const hash = /* @__PURE__ */ Object.create(null);
|
||||
let nextUnique = 0;
|
||||
for (let i = 0; i < this.queue.length; i++) {
|
||||
const current = this.queue[i];
|
||||
if (!hash[current.uid]) {
|
||||
hash[current.uid] = true;
|
||||
this.queue[nextUnique++] = current;
|
||||
}
|
||||
}
|
||||
this.queue.length = nextUnique;
|
||||
}
|
||||
/** Call all the resolve callbacks */
|
||||
_resolve() {
|
||||
const { resolves } = this;
|
||||
const array = resolves.slice(0);
|
||||
resolves.length = 0;
|
||||
for (const resolve of array) {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
/** The number of uploads to process per frame */
|
||||
_PrepareBase.uploadsPerFrame = 4;
|
||||
let PrepareBase = _PrepareBase;
|
||||
|
||||
export { PrepareBase };
|
||||
//# sourceMappingURL=PrepareBase.mjs.map
|
1
node_modules/pixi.js/lib/prepare/PrepareBase.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareBase.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/pixi.js/lib/prepare/PrepareMixins.d.ts
generated
vendored
Normal file
12
node_modules/pixi.js/lib/prepare/PrepareMixins.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
declare global
|
||||
{
|
||||
namespace PixiMixins
|
||||
{
|
||||
interface RendererSystems
|
||||
{
|
||||
prepare: import('./PrepareBase').PrepareBase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
28
node_modules/pixi.js/lib/prepare/PrepareQueue.d.ts
generated
vendored
Normal file
28
node_modules/pixi.js/lib/prepare/PrepareQueue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Container } from '../scene/container/Container';
|
||||
import { GraphicsContext } from '../scene/graphics/shared/GraphicsContext';
|
||||
import { PrepareBase } from './PrepareBase';
|
||||
import type { PrepareQueueItem, PrepareSourceItem } from './PrepareBase';
|
||||
/**
|
||||
* Part of the prepare system. Responsible for uploading all the items to the GPU.
|
||||
* This class extends the base functionality and resolves given resource items ready for the queue.
|
||||
* @memberof rendering
|
||||
*/
|
||||
export declare abstract class PrepareQueue extends PrepareBase {
|
||||
/**
|
||||
* Resolve the given resource type and return an item for the queue
|
||||
* @param source
|
||||
* @param queue
|
||||
*/
|
||||
protected resolveQueueItem(source: PrepareSourceItem, queue: PrepareQueueItem[]): void;
|
||||
/**
|
||||
* Resolve the given container and return an item for the queue
|
||||
* @param container
|
||||
* @param queue
|
||||
*/
|
||||
protected resolveContainerQueueItem(container: Container, queue: PrepareQueueItem[]): void;
|
||||
/**
|
||||
* Resolve the given graphics context and return an item for the queue
|
||||
* @param graphicsContext
|
||||
*/
|
||||
protected resolveGraphicsContextQueueItem(graphicsContext: GraphicsContext): PrepareQueueItem | null;
|
||||
}
|
75
node_modules/pixi.js/lib/prepare/PrepareQueue.js
generated
vendored
Normal file
75
node_modules/pixi.js/lib/prepare/PrepareQueue.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
'use strict';
|
||||
|
||||
var TextureSource = require('../rendering/renderers/shared/texture/sources/TextureSource.js');
|
||||
var Texture = require('../rendering/renderers/shared/texture/Texture.js');
|
||||
var Container = require('../scene/container/Container.js');
|
||||
var Graphics = require('../scene/graphics/shared/Graphics.js');
|
||||
var GraphicsContext = require('../scene/graphics/shared/GraphicsContext.js');
|
||||
var Mesh = require('../scene/mesh/shared/Mesh.js');
|
||||
var Sprite = require('../scene/sprite/Sprite.js');
|
||||
var AnimatedSprite = require('../scene/sprite-animated/AnimatedSprite.js');
|
||||
var TilingSprite = require('../scene/sprite-tiling/TilingSprite.js');
|
||||
var Text = require('../scene/text/Text.js');
|
||||
var PrepareBase = require('./PrepareBase.js');
|
||||
|
||||
"use strict";
|
||||
class PrepareQueue extends PrepareBase.PrepareBase {
|
||||
/**
|
||||
* Resolve the given resource type and return an item for the queue
|
||||
* @param source
|
||||
* @param queue
|
||||
*/
|
||||
resolveQueueItem(source, queue) {
|
||||
if (source instanceof Container.Container) {
|
||||
this.resolveContainerQueueItem(source, queue);
|
||||
} else if (source instanceof TextureSource.TextureSource || source instanceof Texture.Texture) {
|
||||
queue.push(source.source);
|
||||
} else if (source instanceof GraphicsContext.GraphicsContext) {
|
||||
queue.push(source);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Resolve the given container and return an item for the queue
|
||||
* @param container
|
||||
* @param queue
|
||||
*/
|
||||
resolveContainerQueueItem(container, queue) {
|
||||
if (container instanceof Sprite.Sprite || container instanceof TilingSprite.TilingSprite || container instanceof Mesh.Mesh) {
|
||||
queue.push(container.texture.source);
|
||||
} else if (container instanceof Text.Text) {
|
||||
queue.push(container);
|
||||
} else if (container instanceof Graphics.Graphics) {
|
||||
queue.push(container.context);
|
||||
} else if (container instanceof AnimatedSprite.AnimatedSprite) {
|
||||
container.textures.forEach((textureOrFrame) => {
|
||||
if (textureOrFrame.source) {
|
||||
queue.push(textureOrFrame.source);
|
||||
} else {
|
||||
queue.push(textureOrFrame.texture.source);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Resolve the given graphics context and return an item for the queue
|
||||
* @param graphicsContext
|
||||
*/
|
||||
resolveGraphicsContextQueueItem(graphicsContext) {
|
||||
this.renderer.graphicsContext.getContextRenderData(graphicsContext);
|
||||
const { instructions } = graphicsContext;
|
||||
for (const instruction of instructions) {
|
||||
if (instruction.action === "texture") {
|
||||
const { image } = instruction.data;
|
||||
return image.source;
|
||||
} else if (instruction.action === "fill") {
|
||||
const { texture } = instruction.data.style;
|
||||
return texture.source;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
exports.PrepareQueue = PrepareQueue;
|
||||
//# sourceMappingURL=PrepareQueue.js.map
|
1
node_modules/pixi.js/lib/prepare/PrepareQueue.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareQueue.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
73
node_modules/pixi.js/lib/prepare/PrepareQueue.mjs
generated
vendored
Normal file
73
node_modules/pixi.js/lib/prepare/PrepareQueue.mjs
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
import { TextureSource } from '../rendering/renderers/shared/texture/sources/TextureSource.mjs';
|
||||
import { Texture } from '../rendering/renderers/shared/texture/Texture.mjs';
|
||||
import { Container } from '../scene/container/Container.mjs';
|
||||
import { Graphics } from '../scene/graphics/shared/Graphics.mjs';
|
||||
import { GraphicsContext } from '../scene/graphics/shared/GraphicsContext.mjs';
|
||||
import { Mesh } from '../scene/mesh/shared/Mesh.mjs';
|
||||
import { Sprite } from '../scene/sprite/Sprite.mjs';
|
||||
import { AnimatedSprite } from '../scene/sprite-animated/AnimatedSprite.mjs';
|
||||
import { TilingSprite } from '../scene/sprite-tiling/TilingSprite.mjs';
|
||||
import { Text } from '../scene/text/Text.mjs';
|
||||
import { PrepareBase } from './PrepareBase.mjs';
|
||||
|
||||
"use strict";
|
||||
class PrepareQueue extends PrepareBase {
|
||||
/**
|
||||
* Resolve the given resource type and return an item for the queue
|
||||
* @param source
|
||||
* @param queue
|
||||
*/
|
||||
resolveQueueItem(source, queue) {
|
||||
if (source instanceof Container) {
|
||||
this.resolveContainerQueueItem(source, queue);
|
||||
} else if (source instanceof TextureSource || source instanceof Texture) {
|
||||
queue.push(source.source);
|
||||
} else if (source instanceof GraphicsContext) {
|
||||
queue.push(source);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Resolve the given container and return an item for the queue
|
||||
* @param container
|
||||
* @param queue
|
||||
*/
|
||||
resolveContainerQueueItem(container, queue) {
|
||||
if (container instanceof Sprite || container instanceof TilingSprite || container instanceof Mesh) {
|
||||
queue.push(container.texture.source);
|
||||
} else if (container instanceof Text) {
|
||||
queue.push(container);
|
||||
} else if (container instanceof Graphics) {
|
||||
queue.push(container.context);
|
||||
} else if (container instanceof AnimatedSprite) {
|
||||
container.textures.forEach((textureOrFrame) => {
|
||||
if (textureOrFrame.source) {
|
||||
queue.push(textureOrFrame.source);
|
||||
} else {
|
||||
queue.push(textureOrFrame.texture.source);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Resolve the given graphics context and return an item for the queue
|
||||
* @param graphicsContext
|
||||
*/
|
||||
resolveGraphicsContextQueueItem(graphicsContext) {
|
||||
this.renderer.graphicsContext.getContextRenderData(graphicsContext);
|
||||
const { instructions } = graphicsContext;
|
||||
for (const instruction of instructions) {
|
||||
if (instruction.action === "texture") {
|
||||
const { image } = instruction.data;
|
||||
return image.source;
|
||||
} else if (instruction.action === "fill") {
|
||||
const { texture } = instruction.data.style;
|
||||
return texture.source;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { PrepareQueue };
|
||||
//# sourceMappingURL=PrepareQueue.mjs.map
|
1
node_modules/pixi.js/lib/prepare/PrepareQueue.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareQueue.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
43
node_modules/pixi.js/lib/prepare/PrepareSystem.d.ts
generated
vendored
Normal file
43
node_modules/pixi.js/lib/prepare/PrepareSystem.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import { ExtensionType } from '../extensions/Extensions';
|
||||
import { PrepareUpload } from './PrepareUpload';
|
||||
import type { System } from '../rendering/renderers/shared/system/System';
|
||||
/**
|
||||
* The prepare system provides renderer-specific plugins for pre-rendering DisplayObjects. This is useful for
|
||||
* asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.
|
||||
*
|
||||
* Do not instantiate this plugin directly. It is available from the `renderer.prepare` property.
|
||||
* @example
|
||||
* import 'pixi.js/prepare';
|
||||
* import { Application, Graphics } from 'pixi.js';
|
||||
*
|
||||
* // Create a new application (prepare will be auto-added to renderer)
|
||||
* const app = new Application();
|
||||
* await app.init();
|
||||
* document.body.appendChild(app.view);
|
||||
*
|
||||
* // Don't start rendering right away
|
||||
* app.stop();
|
||||
*
|
||||
* // Create a display object
|
||||
* const rect = new Graphics()
|
||||
* .beginFill(0x00ff00)
|
||||
* .drawRect(40, 40, 200, 200);
|
||||
*
|
||||
* // Add to the stage
|
||||
* app.stage.addChild(rect);
|
||||
*
|
||||
* // Don't start rendering until the graphic is uploaded to the GPU
|
||||
* app.renderer.prepare.upload(app.stage, () => {
|
||||
* app.start();
|
||||
* });
|
||||
* @memberof rendering
|
||||
*/
|
||||
export declare class PrepareSystem extends PrepareUpload implements System {
|
||||
/** @ignore */
|
||||
static extension: {
|
||||
readonly type: readonly [ExtensionType.WebGLSystem, ExtensionType.WebGPUSystem];
|
||||
readonly name: "prepare";
|
||||
};
|
||||
/** Destroys the plugin, don't use after this. */
|
||||
destroy(): void;
|
||||
}
|
26
node_modules/pixi.js/lib/prepare/PrepareSystem.js
generated
vendored
Normal file
26
node_modules/pixi.js/lib/prepare/PrepareSystem.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../extensions/Extensions.js');
|
||||
var PrepareUpload = require('./PrepareUpload.js');
|
||||
|
||||
"use strict";
|
||||
class PrepareSystem extends PrepareUpload.PrepareUpload {
|
||||
/** Destroys the plugin, don't use after this. */
|
||||
destroy() {
|
||||
clearTimeout(this.timeout);
|
||||
this.renderer = null;
|
||||
this.queue = null;
|
||||
this.resolves = null;
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
PrepareSystem.extension = {
|
||||
type: [
|
||||
Extensions.ExtensionType.WebGLSystem,
|
||||
Extensions.ExtensionType.WebGPUSystem
|
||||
],
|
||||
name: "prepare"
|
||||
};
|
||||
|
||||
exports.PrepareSystem = PrepareSystem;
|
||||
//# sourceMappingURL=PrepareSystem.js.map
|
1
node_modules/pixi.js/lib/prepare/PrepareSystem.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareSystem.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PrepareSystem.js","sources":["../../src/prepare/PrepareSystem.ts"],"sourcesContent":["import { ExtensionType } from '../extensions/Extensions';\nimport { PrepareUpload } from './PrepareUpload';\n\nimport type { System } from '../rendering/renderers/shared/system/System';\n\n/**\n * The prepare system provides renderer-specific plugins for pre-rendering DisplayObjects. This is useful for\n * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.\n *\n * Do not instantiate this plugin directly. It is available from the `renderer.prepare` property.\n * @example\n * import 'pixi.js/prepare';\n * import { Application, Graphics } from 'pixi.js';\n *\n * // Create a new application (prepare will be auto-added to renderer)\n * const app = new Application();\n * await app.init();\n * document.body.appendChild(app.view);\n *\n * // Don't start rendering right away\n * app.stop();\n *\n * // Create a display object\n * const rect = new Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add to the stage\n * app.stage.addChild(rect);\n *\n * // Don't start rendering until the graphic is uploaded to the GPU\n * app.renderer.prepare.upload(app.stage, () => {\n * app.start();\n * });\n * @memberof rendering\n */\nexport class PrepareSystem extends PrepareUpload implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem,\n ],\n name: 'prepare',\n } as const;\n\n /** Destroys the plugin, don't use after this. */\n public destroy(): void\n {\n clearTimeout(this.timeout);\n this.renderer = null;\n this.queue = null;\n this.resolves = null;\n }\n}\n"],"names":["PrepareUpload","ExtensionType"],"mappings":";;;;;;AAoCO,MAAM,sBAAsBA,2BACnC,CAAA;AAAA;AAAA,EAWW,OACP,GAAA;AACI,IAAA,YAAA,CAAa,KAAK,OAAO,CAAA,CAAA;AACzB,IAAA,IAAA,CAAK,QAAW,GAAA,IAAA,CAAA;AAChB,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAA,CAAA;AACb,IAAA,IAAA,CAAK,QAAW,GAAA,IAAA,CAAA;AAAA,GACpB;AACJ,CAAA;AAAA;AAnBa,aAAA,CAGK,SAAY,GAAA;AAAA,EACtB,IAAM,EAAA;AAAA,IACFC,wBAAc,CAAA,WAAA;AAAA,IACdA,wBAAc,CAAA,YAAA;AAAA,GAClB;AAAA,EACA,IAAM,EAAA,SAAA;AACV,CAAA;;;;"}
|
24
node_modules/pixi.js/lib/prepare/PrepareSystem.mjs
generated
vendored
Normal file
24
node_modules/pixi.js/lib/prepare/PrepareSystem.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ExtensionType } from '../extensions/Extensions.mjs';
|
||||
import { PrepareUpload } from './PrepareUpload.mjs';
|
||||
|
||||
"use strict";
|
||||
class PrepareSystem extends PrepareUpload {
|
||||
/** Destroys the plugin, don't use after this. */
|
||||
destroy() {
|
||||
clearTimeout(this.timeout);
|
||||
this.renderer = null;
|
||||
this.queue = null;
|
||||
this.resolves = null;
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
PrepareSystem.extension = {
|
||||
type: [
|
||||
ExtensionType.WebGLSystem,
|
||||
ExtensionType.WebGPUSystem
|
||||
],
|
||||
name: "prepare"
|
||||
};
|
||||
|
||||
export { PrepareSystem };
|
||||
//# sourceMappingURL=PrepareSystem.mjs.map
|
1
node_modules/pixi.js/lib/prepare/PrepareSystem.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareSystem.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PrepareSystem.mjs","sources":["../../src/prepare/PrepareSystem.ts"],"sourcesContent":["import { ExtensionType } from '../extensions/Extensions';\nimport { PrepareUpload } from './PrepareUpload';\n\nimport type { System } from '../rendering/renderers/shared/system/System';\n\n/**\n * The prepare system provides renderer-specific plugins for pre-rendering DisplayObjects. This is useful for\n * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.\n *\n * Do not instantiate this plugin directly. It is available from the `renderer.prepare` property.\n * @example\n * import 'pixi.js/prepare';\n * import { Application, Graphics } from 'pixi.js';\n *\n * // Create a new application (prepare will be auto-added to renderer)\n * const app = new Application();\n * await app.init();\n * document.body.appendChild(app.view);\n *\n * // Don't start rendering right away\n * app.stop();\n *\n * // Create a display object\n * const rect = new Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add to the stage\n * app.stage.addChild(rect);\n *\n * // Don't start rendering until the graphic is uploaded to the GPU\n * app.renderer.prepare.upload(app.stage, () => {\n * app.start();\n * });\n * @memberof rendering\n */\nexport class PrepareSystem extends PrepareUpload implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem,\n ],\n name: 'prepare',\n } as const;\n\n /** Destroys the plugin, don't use after this. */\n public destroy(): void\n {\n clearTimeout(this.timeout);\n this.renderer = null;\n this.queue = null;\n this.resolves = null;\n }\n}\n"],"names":[],"mappings":";;;;AAoCO,MAAM,sBAAsB,aACnC,CAAA;AAAA;AAAA,EAWW,OACP,GAAA;AACI,IAAA,YAAA,CAAa,KAAK,OAAO,CAAA,CAAA;AACzB,IAAA,IAAA,CAAK,QAAW,GAAA,IAAA,CAAA;AAChB,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAA,CAAA;AACb,IAAA,IAAA,CAAK,QAAW,GAAA,IAAA,CAAA;AAAA,GACpB;AACJ,CAAA;AAAA;AAnBa,aAAA,CAGK,SAAY,GAAA;AAAA,EACtB,IAAM,EAAA;AAAA,IACF,aAAc,CAAA,WAAA;AAAA,IACd,aAAc,CAAA,YAAA;AAAA,GAClB;AAAA,EACA,IAAM,EAAA,SAAA;AACV,CAAA;;;;"}
|
28
node_modules/pixi.js/lib/prepare/PrepareUpload.d.ts
generated
vendored
Normal file
28
node_modules/pixi.js/lib/prepare/PrepareUpload.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { TextureSource } from '../rendering/renderers/shared/texture/sources/TextureSource';
|
||||
import { GraphicsContext } from '../scene/graphics/shared/GraphicsContext';
|
||||
import { Text } from '../scene/text/Text';
|
||||
import { BitmapText } from '../scene/text-bitmap/BitmapText';
|
||||
import { HTMLText } from '../scene/text-html/HTMLText';
|
||||
import { PrepareQueue } from './PrepareQueue';
|
||||
import type { PrepareQueueItem } from './PrepareBase';
|
||||
/**
|
||||
* Part of the prepare system. Responsible for uploading all the items to the GPU.
|
||||
* This class extends the resolver functionality and uploads the given queue items.
|
||||
* @memberof rendering
|
||||
*/
|
||||
export declare abstract class PrepareUpload extends PrepareQueue {
|
||||
/**
|
||||
* Upload the given queue item
|
||||
* @param item
|
||||
*/
|
||||
protected uploadQueueItem(item: PrepareQueueItem): void;
|
||||
protected uploadTextureSource(textureSource: TextureSource): void;
|
||||
protected uploadText(_text: Text): void;
|
||||
protected uploadBitmapText(_text: BitmapText): void;
|
||||
protected uploadHTMLText(_text: HTMLText): void;
|
||||
/**
|
||||
* Resolve the given graphics context and return an item for the queue
|
||||
* @param graphicsContext
|
||||
*/
|
||||
protected uploadGraphicsContext(graphicsContext: GraphicsContext): void;
|
||||
}
|
62
node_modules/pixi.js/lib/prepare/PrepareUpload.js
generated
vendored
Normal file
62
node_modules/pixi.js/lib/prepare/PrepareUpload.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
'use strict';
|
||||
|
||||
var TextureSource = require('../rendering/renderers/shared/texture/sources/TextureSource.js');
|
||||
var GraphicsContext = require('../scene/graphics/shared/GraphicsContext.js');
|
||||
var Text = require('../scene/text/Text.js');
|
||||
var BitmapText = require('../scene/text-bitmap/BitmapText.js');
|
||||
var HTMLText = require('../scene/text-html/HTMLText.js');
|
||||
var PrepareQueue = require('./PrepareQueue.js');
|
||||
|
||||
"use strict";
|
||||
class PrepareUpload extends PrepareQueue.PrepareQueue {
|
||||
/**
|
||||
* Upload the given queue item
|
||||
* @param item
|
||||
*/
|
||||
uploadQueueItem(item) {
|
||||
if (item instanceof TextureSource.TextureSource) {
|
||||
this.uploadTextureSource(item);
|
||||
} else if (item instanceof Text.Text) {
|
||||
this.uploadText(item);
|
||||
} else if (item instanceof HTMLText.HTMLText) {
|
||||
this.uploadHTMLText(item);
|
||||
} else if (item instanceof BitmapText.BitmapText) {
|
||||
this.uploadBitmapText(item);
|
||||
} else if (item instanceof GraphicsContext.GraphicsContext) {
|
||||
this.uploadGraphicsContext(item);
|
||||
}
|
||||
}
|
||||
uploadTextureSource(textureSource) {
|
||||
this.renderer.texture.initSource(textureSource);
|
||||
}
|
||||
uploadText(_text) {
|
||||
this.renderer.renderPipes.text.initGpuText(_text);
|
||||
}
|
||||
uploadBitmapText(_text) {
|
||||
this.renderer.renderPipes.bitmapText.initGpuText(_text);
|
||||
}
|
||||
uploadHTMLText(_text) {
|
||||
this.renderer.renderPipes.htmlText.initGpuText(_text);
|
||||
}
|
||||
/**
|
||||
* Resolve the given graphics context and return an item for the queue
|
||||
* @param graphicsContext
|
||||
*/
|
||||
uploadGraphicsContext(graphicsContext) {
|
||||
this.renderer.graphicsContext.getContextRenderData(graphicsContext);
|
||||
const { instructions } = graphicsContext;
|
||||
for (const instruction of instructions) {
|
||||
if (instruction.action === "texture") {
|
||||
const { image } = instruction.data;
|
||||
this.uploadTextureSource(image.source);
|
||||
} else if (instruction.action === "fill") {
|
||||
const { texture } = instruction.data.style;
|
||||
this.uploadTextureSource(texture.source);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
exports.PrepareUpload = PrepareUpload;
|
||||
//# sourceMappingURL=PrepareUpload.js.map
|
1
node_modules/pixi.js/lib/prepare/PrepareUpload.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareUpload.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PrepareUpload.js","sources":["../../src/prepare/PrepareUpload.ts"],"sourcesContent":["import { TextureSource } from '../rendering/renderers/shared/texture/sources/TextureSource';\nimport { GraphicsContext } from '../scene/graphics/shared/GraphicsContext';\nimport { Text } from '../scene/text/Text';\nimport { BitmapText } from '../scene/text-bitmap/BitmapText';\nimport { HTMLText } from '../scene/text-html/HTMLText';\nimport { PrepareQueue } from './PrepareQueue';\n\nimport type { FillInstruction, TextureInstruction } from '../scene/graphics/shared/GraphicsContext';\nimport type { PrepareQueueItem } from './PrepareBase';\n\n/**\n * Part of the prepare system. Responsible for uploading all the items to the GPU.\n * This class extends the resolver functionality and uploads the given queue items.\n * @memberof rendering\n */\nexport abstract class PrepareUpload extends PrepareQueue\n{\n /**\n * Upload the given queue item\n * @param item\n */\n protected uploadQueueItem(item: PrepareQueueItem): void\n {\n if (item instanceof TextureSource)\n {\n this.uploadTextureSource(item);\n }\n else if (item instanceof Text)\n {\n this.uploadText(item);\n }\n else if (item instanceof HTMLText)\n {\n this.uploadHTMLText(item);\n }\n else if (item instanceof BitmapText)\n {\n this.uploadBitmapText(item);\n }\n else if (item instanceof GraphicsContext)\n {\n this.uploadGraphicsContext(item);\n }\n }\n\n protected uploadTextureSource(textureSource: TextureSource): void\n {\n this.renderer.texture.initSource(textureSource);\n }\n\n protected uploadText(_text: Text): void\n {\n this.renderer.renderPipes.text.initGpuText(_text);\n }\n\n protected uploadBitmapText(_text: BitmapText): void\n {\n this.renderer.renderPipes.bitmapText.initGpuText(_text);\n }\n\n protected uploadHTMLText(_text: HTMLText): void\n {\n this.renderer.renderPipes.htmlText.initGpuText(_text);\n }\n\n /**\n * Resolve the given graphics context and return an item for the queue\n * @param graphicsContext\n */\n protected uploadGraphicsContext(graphicsContext: GraphicsContext): void\n {\n this.renderer.graphicsContext.getContextRenderData(graphicsContext);\n\n const { instructions } = graphicsContext;\n\n for (const instruction of instructions)\n {\n if (instruction.action === 'texture')\n {\n const { image } = (instruction as TextureInstruction).data;\n\n this.uploadTextureSource(image.source);\n }\n else if (instruction.action === 'fill')\n {\n const { texture } = (instruction as FillInstruction).data.style;\n\n this.uploadTextureSource(texture.source);\n }\n }\n\n return null;\n }\n}\n"],"names":["PrepareQueue","TextureSource","Text","HTMLText","BitmapText","GraphicsContext"],"mappings":";;;;;;;;;;AAeO,MAAe,sBAAsBA,yBAC5C,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKc,gBAAgB,IAC1B,EAAA;AACI,IAAA,IAAI,gBAAgBC,2BACpB,EAAA;AACI,MAAA,IAAA,CAAK,oBAAoB,IAAI,CAAA,CAAA;AAAA,KACjC,MAAA,IACS,gBAAgBC,SACzB,EAAA;AACI,MAAA,IAAA,CAAK,WAAW,IAAI,CAAA,CAAA;AAAA,KACxB,MAAA,IACS,gBAAgBC,iBACzB,EAAA;AACI,MAAA,IAAA,CAAK,eAAe,IAAI,CAAA,CAAA;AAAA,KAC5B,MAAA,IACS,gBAAgBC,qBACzB,EAAA;AACI,MAAA,IAAA,CAAK,iBAAiB,IAAI,CAAA,CAAA;AAAA,KAC9B,MAAA,IACS,gBAAgBC,+BACzB,EAAA;AACI,MAAA,IAAA,CAAK,sBAAsB,IAAI,CAAA,CAAA;AAAA,KACnC;AAAA,GACJ;AAAA,EAEU,oBAAoB,aAC9B,EAAA;AACI,IAAK,IAAA,CAAA,QAAA,CAAS,OAAQ,CAAA,UAAA,CAAW,aAAa,CAAA,CAAA;AAAA,GAClD;AAAA,EAEU,WAAW,KACrB,EAAA;AACI,IAAA,IAAA,CAAK,QAAS,CAAA,WAAA,CAAY,IAAK,CAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAAA,GACpD;AAAA,EAEU,iBAAiB,KAC3B,EAAA;AACI,IAAA,IAAA,CAAK,QAAS,CAAA,WAAA,CAAY,UAAW,CAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAAA,GAC1D;AAAA,EAEU,eAAe,KACzB,EAAA;AACI,IAAA,IAAA,CAAK,QAAS,CAAA,WAAA,CAAY,QAAS,CAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAAA,GACxD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,sBAAsB,eAChC,EAAA;AACI,IAAK,IAAA,CAAA,QAAA,CAAS,eAAgB,CAAA,oBAAA,CAAqB,eAAe,CAAA,CAAA;AAElE,IAAM,MAAA,EAAE,cAAiB,GAAA,eAAA,CAAA;AAEzB,IAAA,KAAA,MAAW,eAAe,YAC1B,EAAA;AACI,MAAI,IAAA,WAAA,CAAY,WAAW,SAC3B,EAAA;AACI,QAAM,MAAA,EAAE,KAAM,EAAA,GAAK,WAAmC,CAAA,IAAA,CAAA;AAEtD,QAAK,IAAA,CAAA,mBAAA,CAAoB,MAAM,MAAM,CAAA,CAAA;AAAA,OACzC,MAAA,IACS,WAAY,CAAA,MAAA,KAAW,MAChC,EAAA;AACI,QAAA,MAAM,EAAE,OAAA,EAAa,GAAA,WAAA,CAAgC,IAAK,CAAA,KAAA,CAAA;AAE1D,QAAK,IAAA,CAAA,mBAAA,CAAoB,QAAQ,MAAM,CAAA,CAAA;AAAA,OAC3C;AAAA,KACJ;AAEA,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AACJ;;;;"}
|
60
node_modules/pixi.js/lib/prepare/PrepareUpload.mjs
generated
vendored
Normal file
60
node_modules/pixi.js/lib/prepare/PrepareUpload.mjs
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import { TextureSource } from '../rendering/renderers/shared/texture/sources/TextureSource.mjs';
|
||||
import { GraphicsContext } from '../scene/graphics/shared/GraphicsContext.mjs';
|
||||
import { Text } from '../scene/text/Text.mjs';
|
||||
import { BitmapText } from '../scene/text-bitmap/BitmapText.mjs';
|
||||
import { HTMLText } from '../scene/text-html/HTMLText.mjs';
|
||||
import { PrepareQueue } from './PrepareQueue.mjs';
|
||||
|
||||
"use strict";
|
||||
class PrepareUpload extends PrepareQueue {
|
||||
/**
|
||||
* Upload the given queue item
|
||||
* @param item
|
||||
*/
|
||||
uploadQueueItem(item) {
|
||||
if (item instanceof TextureSource) {
|
||||
this.uploadTextureSource(item);
|
||||
} else if (item instanceof Text) {
|
||||
this.uploadText(item);
|
||||
} else if (item instanceof HTMLText) {
|
||||
this.uploadHTMLText(item);
|
||||
} else if (item instanceof BitmapText) {
|
||||
this.uploadBitmapText(item);
|
||||
} else if (item instanceof GraphicsContext) {
|
||||
this.uploadGraphicsContext(item);
|
||||
}
|
||||
}
|
||||
uploadTextureSource(textureSource) {
|
||||
this.renderer.texture.initSource(textureSource);
|
||||
}
|
||||
uploadText(_text) {
|
||||
this.renderer.renderPipes.text.initGpuText(_text);
|
||||
}
|
||||
uploadBitmapText(_text) {
|
||||
this.renderer.renderPipes.bitmapText.initGpuText(_text);
|
||||
}
|
||||
uploadHTMLText(_text) {
|
||||
this.renderer.renderPipes.htmlText.initGpuText(_text);
|
||||
}
|
||||
/**
|
||||
* Resolve the given graphics context and return an item for the queue
|
||||
* @param graphicsContext
|
||||
*/
|
||||
uploadGraphicsContext(graphicsContext) {
|
||||
this.renderer.graphicsContext.getContextRenderData(graphicsContext);
|
||||
const { instructions } = graphicsContext;
|
||||
for (const instruction of instructions) {
|
||||
if (instruction.action === "texture") {
|
||||
const { image } = instruction.data;
|
||||
this.uploadTextureSource(image.source);
|
||||
} else if (instruction.action === "fill") {
|
||||
const { texture } = instruction.data.style;
|
||||
this.uploadTextureSource(texture.source);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { PrepareUpload };
|
||||
//# sourceMappingURL=PrepareUpload.mjs.map
|
1
node_modules/pixi.js/lib/prepare/PrepareUpload.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/PrepareUpload.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PrepareUpload.mjs","sources":["../../src/prepare/PrepareUpload.ts"],"sourcesContent":["import { TextureSource } from '../rendering/renderers/shared/texture/sources/TextureSource';\nimport { GraphicsContext } from '../scene/graphics/shared/GraphicsContext';\nimport { Text } from '../scene/text/Text';\nimport { BitmapText } from '../scene/text-bitmap/BitmapText';\nimport { HTMLText } from '../scene/text-html/HTMLText';\nimport { PrepareQueue } from './PrepareQueue';\n\nimport type { FillInstruction, TextureInstruction } from '../scene/graphics/shared/GraphicsContext';\nimport type { PrepareQueueItem } from './PrepareBase';\n\n/**\n * Part of the prepare system. Responsible for uploading all the items to the GPU.\n * This class extends the resolver functionality and uploads the given queue items.\n * @memberof rendering\n */\nexport abstract class PrepareUpload extends PrepareQueue\n{\n /**\n * Upload the given queue item\n * @param item\n */\n protected uploadQueueItem(item: PrepareQueueItem): void\n {\n if (item instanceof TextureSource)\n {\n this.uploadTextureSource(item);\n }\n else if (item instanceof Text)\n {\n this.uploadText(item);\n }\n else if (item instanceof HTMLText)\n {\n this.uploadHTMLText(item);\n }\n else if (item instanceof BitmapText)\n {\n this.uploadBitmapText(item);\n }\n else if (item instanceof GraphicsContext)\n {\n this.uploadGraphicsContext(item);\n }\n }\n\n protected uploadTextureSource(textureSource: TextureSource): void\n {\n this.renderer.texture.initSource(textureSource);\n }\n\n protected uploadText(_text: Text): void\n {\n this.renderer.renderPipes.text.initGpuText(_text);\n }\n\n protected uploadBitmapText(_text: BitmapText): void\n {\n this.renderer.renderPipes.bitmapText.initGpuText(_text);\n }\n\n protected uploadHTMLText(_text: HTMLText): void\n {\n this.renderer.renderPipes.htmlText.initGpuText(_text);\n }\n\n /**\n * Resolve the given graphics context and return an item for the queue\n * @param graphicsContext\n */\n protected uploadGraphicsContext(graphicsContext: GraphicsContext): void\n {\n this.renderer.graphicsContext.getContextRenderData(graphicsContext);\n\n const { instructions } = graphicsContext;\n\n for (const instruction of instructions)\n {\n if (instruction.action === 'texture')\n {\n const { image } = (instruction as TextureInstruction).data;\n\n this.uploadTextureSource(image.source);\n }\n else if (instruction.action === 'fill')\n {\n const { texture } = (instruction as FillInstruction).data.style;\n\n this.uploadTextureSource(texture.source);\n }\n }\n\n return null;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAe,sBAAsB,YAC5C,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKc,gBAAgB,IAC1B,EAAA;AACI,IAAA,IAAI,gBAAgB,aACpB,EAAA;AACI,MAAA,IAAA,CAAK,oBAAoB,IAAI,CAAA,CAAA;AAAA,KACjC,MAAA,IACS,gBAAgB,IACzB,EAAA;AACI,MAAA,IAAA,CAAK,WAAW,IAAI,CAAA,CAAA;AAAA,KACxB,MAAA,IACS,gBAAgB,QACzB,EAAA;AACI,MAAA,IAAA,CAAK,eAAe,IAAI,CAAA,CAAA;AAAA,KAC5B,MAAA,IACS,gBAAgB,UACzB,EAAA;AACI,MAAA,IAAA,CAAK,iBAAiB,IAAI,CAAA,CAAA;AAAA,KAC9B,MAAA,IACS,gBAAgB,eACzB,EAAA;AACI,MAAA,IAAA,CAAK,sBAAsB,IAAI,CAAA,CAAA;AAAA,KACnC;AAAA,GACJ;AAAA,EAEU,oBAAoB,aAC9B,EAAA;AACI,IAAK,IAAA,CAAA,QAAA,CAAS,OAAQ,CAAA,UAAA,CAAW,aAAa,CAAA,CAAA;AAAA,GAClD;AAAA,EAEU,WAAW,KACrB,EAAA;AACI,IAAA,IAAA,CAAK,QAAS,CAAA,WAAA,CAAY,IAAK,CAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAAA,GACpD;AAAA,EAEU,iBAAiB,KAC3B,EAAA;AACI,IAAA,IAAA,CAAK,QAAS,CAAA,WAAA,CAAY,UAAW,CAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAAA,GAC1D;AAAA,EAEU,eAAe,KACzB,EAAA;AACI,IAAA,IAAA,CAAK,QAAS,CAAA,WAAA,CAAY,QAAS,CAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAAA,GACxD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,sBAAsB,eAChC,EAAA;AACI,IAAK,IAAA,CAAA,QAAA,CAAS,eAAgB,CAAA,oBAAA,CAAqB,eAAe,CAAA,CAAA;AAElE,IAAM,MAAA,EAAE,cAAiB,GAAA,eAAA,CAAA;AAEzB,IAAA,KAAA,MAAW,eAAe,YAC1B,EAAA;AACI,MAAI,IAAA,WAAA,CAAY,WAAW,SAC3B,EAAA;AACI,QAAM,MAAA,EAAE,KAAM,EAAA,GAAK,WAAmC,CAAA,IAAA,CAAA;AAEtD,QAAK,IAAA,CAAA,mBAAA,CAAoB,MAAM,MAAM,CAAA,CAAA;AAAA,OACzC,MAAA,IACS,WAAY,CAAA,MAAA,KAAW,MAChC,EAAA;AACI,QAAA,MAAM,EAAE,OAAA,EAAa,GAAA,WAAA,CAAgC,IAAK,CAAA,KAAA,CAAA;AAE1D,QAAK,IAAA,CAAA,mBAAA,CAAoB,QAAQ,MAAM,CAAA,CAAA;AAAA,OAC3C;AAAA,KACJ;AAEA,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AACJ;;;;"}
|
4
node_modules/pixi.js/lib/prepare/index.d.ts
generated
vendored
Normal file
4
node_modules/pixi.js/lib/prepare/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './PrepareBase';
|
||||
export * from './PrepareQueue';
|
||||
export * from './PrepareSystem';
|
||||
export * from './PrepareUpload';
|
14
node_modules/pixi.js/lib/prepare/index.js
generated
vendored
Normal file
14
node_modules/pixi.js/lib/prepare/index.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var PrepareBase = require('./PrepareBase.js');
|
||||
var PrepareQueue = require('./PrepareQueue.js');
|
||||
var PrepareSystem = require('./PrepareSystem.js');
|
||||
var PrepareUpload = require('./PrepareUpload.js');
|
||||
|
||||
"use strict";
|
||||
|
||||
exports.PrepareBase = PrepareBase.PrepareBase;
|
||||
exports.PrepareQueue = PrepareQueue.PrepareQueue;
|
||||
exports.PrepareSystem = PrepareSystem.PrepareSystem;
|
||||
exports.PrepareUpload = PrepareUpload.PrepareUpload;
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/pixi.js/lib/prepare/index.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
7
node_modules/pixi.js/lib/prepare/index.mjs
generated
vendored
Normal file
7
node_modules/pixi.js/lib/prepare/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export { PrepareBase } from './PrepareBase.mjs';
|
||||
export { PrepareQueue } from './PrepareQueue.mjs';
|
||||
export { PrepareSystem } from './PrepareSystem.mjs';
|
||||
export { PrepareUpload } from './PrepareUpload.mjs';
|
||||
|
||||
"use strict";
|
||||
//# sourceMappingURL=index.mjs.map
|
1
node_modules/pixi.js/lib/prepare/index.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
1
node_modules/pixi.js/lib/prepare/init.d.ts
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/init.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
8
node_modules/pixi.js/lib/prepare/init.js
generated
vendored
Normal file
8
node_modules/pixi.js/lib/prepare/init.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../extensions/Extensions.js');
|
||||
var PrepareSystem = require('./PrepareSystem.js');
|
||||
|
||||
"use strict";
|
||||
Extensions.extensions.add(PrepareSystem.PrepareSystem);
|
||||
//# sourceMappingURL=init.js.map
|
1
node_modules/pixi.js/lib/prepare/init.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/init.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"init.js","sources":["../../src/prepare/init.ts"],"sourcesContent":["import { extensions } from '../extensions/Extensions';\nimport { PrepareSystem } from './PrepareSystem';\n\nextensions.add(PrepareSystem);\n"],"names":["extensions","PrepareSystem"],"mappings":";;;;;;AAGAA,qBAAA,CAAW,IAAIC,2BAAa,CAAA;;"}
|
6
node_modules/pixi.js/lib/prepare/init.mjs
generated
vendored
Normal file
6
node_modules/pixi.js/lib/prepare/init.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { extensions } from '../extensions/Extensions.mjs';
|
||||
import { PrepareSystem } from './PrepareSystem.mjs';
|
||||
|
||||
"use strict";
|
||||
extensions.add(PrepareSystem);
|
||||
//# sourceMappingURL=init.mjs.map
|
1
node_modules/pixi.js/lib/prepare/init.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/prepare/init.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"init.mjs","sources":["../../src/prepare/init.ts"],"sourcesContent":["import { extensions } from '../extensions/Extensions';\nimport { PrepareSystem } from './PrepareSystem';\n\nextensions.add(PrepareSystem);\n"],"names":[],"mappings":";;;;AAGA,UAAA,CAAW,IAAI,aAAa,CAAA"}
|
Reference in New Issue
Block a user