sdfsdfs
This commit is contained in:
28
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.d.ts
generated
vendored
Normal file
28
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { Effect, EffectConstructor } from '../../scene/container/Effect';
|
||||
import type { PoolItem } from '../../utils/pool/Pool';
|
||||
interface MaskConversionTest {
|
||||
test: (item: any) => boolean;
|
||||
maskClass: new (item: any) => Effect & PoolItem;
|
||||
}
|
||||
export type MaskEffect = {
|
||||
mask: unknown;
|
||||
} & Effect;
|
||||
/**
|
||||
* A class that manages the conversion of masks to mask effects.
|
||||
* @memberof rendering
|
||||
* @ignore
|
||||
*/
|
||||
export declare class MaskEffectManagerClass {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
readonly _effectClasses: EffectConstructor[];
|
||||
private readonly _tests;
|
||||
private _initialized;
|
||||
init(): void;
|
||||
add(test: MaskConversionTest): void;
|
||||
getMaskEffect(item: any): MaskEffect;
|
||||
returnMaskEffect(effect: Effect & PoolItem): void;
|
||||
}
|
||||
export declare const MaskEffectManager: MaskEffectManagerClass;
|
||||
export {};
|
50
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.js
generated
vendored
Normal file
50
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../extensions/Extensions.js');
|
||||
var PoolGroup = require('../../utils/pool/PoolGroup.js');
|
||||
|
||||
"use strict";
|
||||
class MaskEffectManagerClass {
|
||||
constructor() {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
this._effectClasses = [];
|
||||
this._tests = [];
|
||||
this._initialized = false;
|
||||
}
|
||||
init() {
|
||||
if (this._initialized)
|
||||
return;
|
||||
this._initialized = true;
|
||||
this._effectClasses.forEach((test) => {
|
||||
this.add({
|
||||
test: test.test,
|
||||
maskClass: test
|
||||
});
|
||||
});
|
||||
}
|
||||
add(test) {
|
||||
this._tests.push(test);
|
||||
}
|
||||
getMaskEffect(item) {
|
||||
if (!this._initialized)
|
||||
this.init();
|
||||
for (let i = 0; i < this._tests.length; i++) {
|
||||
const test = this._tests[i];
|
||||
if (test.test(item)) {
|
||||
return PoolGroup.BigPool.get(test.maskClass, item);
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
returnMaskEffect(effect) {
|
||||
PoolGroup.BigPool.return(effect);
|
||||
}
|
||||
}
|
||||
const MaskEffectManager = new MaskEffectManagerClass();
|
||||
Extensions.extensions.handleByList(Extensions.ExtensionType.MaskEffect, MaskEffectManager._effectClasses);
|
||||
|
||||
exports.MaskEffectManager = MaskEffectManager;
|
||||
exports.MaskEffectManagerClass = MaskEffectManagerClass;
|
||||
//# sourceMappingURL=MaskEffectManager.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MaskEffectManager.js","sources":["../../../src/rendering/mask/MaskEffectManager.ts"],"sourcesContent":["import { extensions, ExtensionType } from '../../extensions/Extensions';\nimport { BigPool } from '../../utils/pool/PoolGroup';\n\nimport type { Effect, EffectConstructor } from '../../scene/container/Effect';\nimport type { PoolItem, PoolItemConstructor } from '../../utils/pool/Pool';\n\ninterface MaskConversionTest\n{\n test: (item: any) => boolean;\n maskClass: new (item: any) => Effect & PoolItem;\n}\n\nexport type MaskEffect = {mask: unknown} & Effect;\n\n/**\n * A class that manages the conversion of masks to mask effects.\n * @memberof rendering\n * @ignore\n */\nexport class MaskEffectManagerClass\n{\n /**\n * @private\n */\n public readonly _effectClasses: EffectConstructor[] = [];\n private readonly _tests: MaskConversionTest[] = [];\n private _initialized = false;\n\n public init()\n {\n if (this._initialized) return;\n\n this._initialized = true;\n\n this._effectClasses.forEach((test) =>\n {\n this.add({\n test: test.test,\n maskClass: test\n });\n });\n }\n\n public add(test: MaskConversionTest)\n {\n this._tests.push(test);\n }\n\n public getMaskEffect(item: any): MaskEffect\n {\n if (!this._initialized) this.init();\n\n for (let i = 0; i < this._tests.length; i++)\n {\n const test = this._tests[i];\n\n if (test.test(item))\n {\n return BigPool.get(test.maskClass as PoolItemConstructor<MaskEffect & PoolItem>, item);\n }\n }\n\n return item;\n }\n\n public returnMaskEffect(effect: Effect & PoolItem)\n {\n BigPool.return(effect);\n }\n}\n\nexport const MaskEffectManager = new MaskEffectManagerClass();\n\n// Handle registration of extensions\nextensions\n .handleByList(ExtensionType.MaskEffect, MaskEffectManager._effectClasses);\n"],"names":["BigPool","extensions","ExtensionType"],"mappings":";;;;;;AAmBO,MAAM,sBACb,CAAA;AAAA,EADO,WAAA,GAAA;AAKH;AAAA;AAAA;AAAA,IAAA,IAAA,CAAgB,iBAAsC,EAAC,CAAA;AACvD,IAAA,IAAA,CAAiB,SAA+B,EAAC,CAAA;AACjD,IAAA,IAAA,CAAQ,YAAe,GAAA,KAAA,CAAA;AAAA,GAAA;AAAA,EAEhB,IACP,GAAA;AACI,IAAA,IAAI,IAAK,CAAA,YAAA;AAAc,MAAA,OAAA;AAEvB,IAAA,IAAA,CAAK,YAAe,GAAA,IAAA,CAAA;AAEpB,IAAK,IAAA,CAAA,cAAA,CAAe,OAAQ,CAAA,CAAC,IAC7B,KAAA;AACI,MAAA,IAAA,CAAK,GAAI,CAAA;AAAA,QACL,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,SAAW,EAAA,IAAA;AAAA,OACd,CAAA,CAAA;AAAA,KACJ,CAAA,CAAA;AAAA,GACL;AAAA,EAEO,IAAI,IACX,EAAA;AACI,IAAK,IAAA,CAAA,MAAA,CAAO,KAAK,IAAI,CAAA,CAAA;AAAA,GACzB;AAAA,EAEO,cAAc,IACrB,EAAA;AACI,IAAA,IAAI,CAAC,IAAK,CAAA,YAAA;AAAc,MAAA,IAAA,CAAK,IAAK,EAAA,CAAA;AAElC,IAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,IAAK,CAAA,MAAA,CAAO,QAAQ,CACxC,EAAA,EAAA;AACI,MAAM,MAAA,IAAA,GAAO,IAAK,CAAA,MAAA,CAAO,CAAC,CAAA,CAAA;AAE1B,MAAI,IAAA,IAAA,CAAK,IAAK,CAAA,IAAI,CAClB,EAAA;AACI,QAAA,OAAOA,iBAAQ,CAAA,GAAA,CAAI,IAAK,CAAA,SAAA,EAAyD,IAAI,CAAA,CAAA;AAAA,OACzF;AAAA,KACJ;AAEA,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AAAA,EAEO,iBAAiB,MACxB,EAAA;AACI,IAAAA,iBAAA,CAAQ,OAAO,MAAM,CAAA,CAAA;AAAA,GACzB;AACJ,CAAA;AAEa,MAAA,iBAAA,GAAoB,IAAI,sBAAuB,GAAA;AAG5DC,qBAAA,CACK,YAAa,CAAAC,wBAAA,CAAc,UAAY,EAAA,iBAAA,CAAkB,cAAc,CAAA;;;;;"}
|
47
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.mjs
generated
vendored
Normal file
47
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.mjs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { extensions, ExtensionType } from '../../extensions/Extensions.mjs';
|
||||
import { BigPool } from '../../utils/pool/PoolGroup.mjs';
|
||||
|
||||
"use strict";
|
||||
class MaskEffectManagerClass {
|
||||
constructor() {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
this._effectClasses = [];
|
||||
this._tests = [];
|
||||
this._initialized = false;
|
||||
}
|
||||
init() {
|
||||
if (this._initialized)
|
||||
return;
|
||||
this._initialized = true;
|
||||
this._effectClasses.forEach((test) => {
|
||||
this.add({
|
||||
test: test.test,
|
||||
maskClass: test
|
||||
});
|
||||
});
|
||||
}
|
||||
add(test) {
|
||||
this._tests.push(test);
|
||||
}
|
||||
getMaskEffect(item) {
|
||||
if (!this._initialized)
|
||||
this.init();
|
||||
for (let i = 0; i < this._tests.length; i++) {
|
||||
const test = this._tests[i];
|
||||
if (test.test(item)) {
|
||||
return BigPool.get(test.maskClass, item);
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
returnMaskEffect(effect) {
|
||||
BigPool.return(effect);
|
||||
}
|
||||
}
|
||||
const MaskEffectManager = new MaskEffectManagerClass();
|
||||
extensions.handleByList(ExtensionType.MaskEffect, MaskEffectManager._effectClasses);
|
||||
|
||||
export { MaskEffectManager, MaskEffectManagerClass };
|
||||
//# sourceMappingURL=MaskEffectManager.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MaskEffectManager.mjs","sources":["../../../src/rendering/mask/MaskEffectManager.ts"],"sourcesContent":["import { extensions, ExtensionType } from '../../extensions/Extensions';\nimport { BigPool } from '../../utils/pool/PoolGroup';\n\nimport type { Effect, EffectConstructor } from '../../scene/container/Effect';\nimport type { PoolItem, PoolItemConstructor } from '../../utils/pool/Pool';\n\ninterface MaskConversionTest\n{\n test: (item: any) => boolean;\n maskClass: new (item: any) => Effect & PoolItem;\n}\n\nexport type MaskEffect = {mask: unknown} & Effect;\n\n/**\n * A class that manages the conversion of masks to mask effects.\n * @memberof rendering\n * @ignore\n */\nexport class MaskEffectManagerClass\n{\n /**\n * @private\n */\n public readonly _effectClasses: EffectConstructor[] = [];\n private readonly _tests: MaskConversionTest[] = [];\n private _initialized = false;\n\n public init()\n {\n if (this._initialized) return;\n\n this._initialized = true;\n\n this._effectClasses.forEach((test) =>\n {\n this.add({\n test: test.test,\n maskClass: test\n });\n });\n }\n\n public add(test: MaskConversionTest)\n {\n this._tests.push(test);\n }\n\n public getMaskEffect(item: any): MaskEffect\n {\n if (!this._initialized) this.init();\n\n for (let i = 0; i < this._tests.length; i++)\n {\n const test = this._tests[i];\n\n if (test.test(item))\n {\n return BigPool.get(test.maskClass as PoolItemConstructor<MaskEffect & PoolItem>, item);\n }\n }\n\n return item;\n }\n\n public returnMaskEffect(effect: Effect & PoolItem)\n {\n BigPool.return(effect);\n }\n}\n\nexport const MaskEffectManager = new MaskEffectManagerClass();\n\n// Handle registration of extensions\nextensions\n .handleByList(ExtensionType.MaskEffect, MaskEffectManager._effectClasses);\n"],"names":[],"mappings":";;;;AAmBO,MAAM,sBACb,CAAA;AAAA,EADO,WAAA,GAAA;AAKH;AAAA;AAAA;AAAA,IAAA,IAAA,CAAgB,iBAAsC,EAAC,CAAA;AACvD,IAAA,IAAA,CAAiB,SAA+B,EAAC,CAAA;AACjD,IAAA,IAAA,CAAQ,YAAe,GAAA,KAAA,CAAA;AAAA,GAAA;AAAA,EAEhB,IACP,GAAA;AACI,IAAA,IAAI,IAAK,CAAA,YAAA;AAAc,MAAA,OAAA;AAEvB,IAAA,IAAA,CAAK,YAAe,GAAA,IAAA,CAAA;AAEpB,IAAK,IAAA,CAAA,cAAA,CAAe,OAAQ,CAAA,CAAC,IAC7B,KAAA;AACI,MAAA,IAAA,CAAK,GAAI,CAAA;AAAA,QACL,MAAM,IAAK,CAAA,IAAA;AAAA,QACX,SAAW,EAAA,IAAA;AAAA,OACd,CAAA,CAAA;AAAA,KACJ,CAAA,CAAA;AAAA,GACL;AAAA,EAEO,IAAI,IACX,EAAA;AACI,IAAK,IAAA,CAAA,MAAA,CAAO,KAAK,IAAI,CAAA,CAAA;AAAA,GACzB;AAAA,EAEO,cAAc,IACrB,EAAA;AACI,IAAA,IAAI,CAAC,IAAK,CAAA,YAAA;AAAc,MAAA,IAAA,CAAK,IAAK,EAAA,CAAA;AAElC,IAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,IAAK,CAAA,MAAA,CAAO,QAAQ,CACxC,EAAA,EAAA;AACI,MAAM,MAAA,IAAA,GAAO,IAAK,CAAA,MAAA,CAAO,CAAC,CAAA,CAAA;AAE1B,MAAI,IAAA,IAAA,CAAK,IAAK,CAAA,IAAI,CAClB,EAAA;AACI,QAAA,OAAO,OAAQ,CAAA,GAAA,CAAI,IAAK,CAAA,SAAA,EAAyD,IAAI,CAAA,CAAA;AAAA,OACzF;AAAA,KACJ;AAEA,IAAO,OAAA,IAAA,CAAA;AAAA,GACX;AAAA,EAEO,iBAAiB,MACxB,EAAA;AACI,IAAA,OAAA,CAAQ,OAAO,MAAM,CAAA,CAAA;AAAA,GACzB;AACJ,CAAA;AAEa,MAAA,iBAAA,GAAoB,IAAI,sBAAuB,GAAA;AAG5D,UAAA,CACK,YAAa,CAAA,aAAA,CAAc,UAAY,EAAA,iBAAA,CAAkB,cAAc,CAAA;;;;"}
|
23
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.d.ts
generated
vendored
Normal file
23
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { ExtensionMetadata } from '../../../extensions/Extensions';
|
||||
import type { Point } from '../../../maths/point/Point';
|
||||
import type { Bounds } from '../../../scene/container/bounds/Bounds';
|
||||
import type { Container } from '../../../scene/container/Container';
|
||||
import type { Effect } from '../../../scene/container/Effect';
|
||||
import type { PoolItem } from '../../../utils/pool/Pool';
|
||||
export declare class AlphaMask implements Effect, PoolItem {
|
||||
static extension: ExtensionMetadata;
|
||||
priority: number;
|
||||
mask: Container;
|
||||
pipe: string;
|
||||
renderMaskToTexture: boolean;
|
||||
constructor(options?: {
|
||||
mask: Container;
|
||||
});
|
||||
init(mask: Container): void;
|
||||
reset(): void;
|
||||
addBounds(bounds: Bounds, skipUpdateTransform?: boolean): void;
|
||||
addLocalBounds(bounds: Bounds, localRoot: Container): void;
|
||||
containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean;
|
||||
destroy(): void;
|
||||
static test(mask: any): boolean;
|
||||
}
|
48
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.js
generated
vendored
Normal file
48
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../../extensions/Extensions.js');
|
||||
var Sprite = require('../../../scene/sprite/Sprite.js');
|
||||
var addMaskBounds = require('../utils/addMaskBounds.js');
|
||||
var addMaskLocalBounds = require('../utils/addMaskLocalBounds.js');
|
||||
|
||||
"use strict";
|
||||
class AlphaMask {
|
||||
constructor(options) {
|
||||
this.priority = 0;
|
||||
this.pipe = "alphaMask";
|
||||
if (options?.mask) {
|
||||
this.init(options.mask);
|
||||
}
|
||||
}
|
||||
init(mask) {
|
||||
this.mask = mask;
|
||||
this.renderMaskToTexture = !(mask instanceof Sprite.Sprite);
|
||||
this.mask.renderable = this.renderMaskToTexture;
|
||||
this.mask.includeInBuild = !this.renderMaskToTexture;
|
||||
this.mask.measurable = false;
|
||||
}
|
||||
reset() {
|
||||
this.mask.measurable = true;
|
||||
this.mask = null;
|
||||
}
|
||||
addBounds(bounds, skipUpdateTransform) {
|
||||
addMaskBounds.addMaskBounds(this.mask, bounds, skipUpdateTransform);
|
||||
}
|
||||
addLocalBounds(bounds, localRoot) {
|
||||
addMaskLocalBounds.addMaskLocalBounds(this.mask, bounds, localRoot);
|
||||
}
|
||||
containsPoint(point, hitTestFn) {
|
||||
const mask = this.mask;
|
||||
return hitTestFn(mask, point);
|
||||
}
|
||||
destroy() {
|
||||
this.reset();
|
||||
}
|
||||
static test(mask) {
|
||||
return mask instanceof Sprite.Sprite;
|
||||
}
|
||||
}
|
||||
AlphaMask.extension = Extensions.ExtensionType.MaskEffect;
|
||||
|
||||
exports.AlphaMask = AlphaMask;
|
||||
//# sourceMappingURL=AlphaMask.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AlphaMask.js","sources":["../../../../src/rendering/mask/alpha/AlphaMask.ts"],"sourcesContent":["import { ExtensionType } from '../../../extensions/Extensions';\nimport { Sprite } from '../../../scene/sprite/Sprite';\nimport { addMaskBounds } from '../utils/addMaskBounds';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds';\n\nimport type { ExtensionMetadata } from '../../../extensions/Extensions';\nimport type { Point } from '../../../maths/point/Point';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\nimport type { Effect } from '../../../scene/container/Effect';\nimport type { PoolItem } from '../../../utils/pool/Pool';\n\nexport class AlphaMask implements Effect, PoolItem\n{\n public static extension: ExtensionMetadata = ExtensionType.MaskEffect;\n\n public priority = 0;\n public mask: Container;\n public pipe = 'alphaMask';\n public renderMaskToTexture: boolean;\n\n constructor(options?: {mask: Container})\n {\n if (options?.mask)\n {\n this.init(options.mask);\n }\n }\n\n public init(mask: Container): void\n {\n this.mask = mask;\n\n // TODO - might want to change this to adjust on the fly\n // user may add children to the sprite..\n this.renderMaskToTexture = !(mask instanceof Sprite);\n\n this.mask.renderable = this.renderMaskToTexture;\n this.mask.includeInBuild = !this.renderMaskToTexture;\n\n this.mask.measurable = false;\n }\n\n public reset()\n {\n this.mask.measurable = true;\n this.mask = null;\n }\n\n public addBounds(bounds: Bounds, skipUpdateTransform?: boolean): void\n {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n\n public addLocalBounds(bounds: Bounds, localRoot: Container): void\n {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n\n public containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean\n {\n const mask = this.mask as any;\n\n // if the point is in the mask, yay!\n return hitTestFn(mask, point);\n }\n\n public destroy(): void\n {\n this.reset();\n }\n\n public static test(mask: any): boolean\n {\n return mask instanceof Sprite;\n }\n}\n"],"names":["Sprite","addMaskBounds","addMaskLocalBounds","ExtensionType"],"mappings":";;;;;;;;AAYO,MAAM,SACb,CAAA;AAAA,EAQI,YAAY,OACZ,EAAA;AANA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,WAAA,CAAA;AAKV,IAAA,IAAI,SAAS,IACb,EAAA;AACI,MAAK,IAAA,CAAA,IAAA,CAAK,QAAQ,IAAI,CAAA,CAAA;AAAA,KAC1B;AAAA,GACJ;AAAA,EAEO,KAAK,IACZ,EAAA;AACI,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAIZ,IAAK,IAAA,CAAA,mBAAA,GAAsB,EAAE,IAAgB,YAAAA,aAAA,CAAA,CAAA;AAE7C,IAAK,IAAA,CAAA,IAAA,CAAK,aAAa,IAAK,CAAA,mBAAA,CAAA;AAC5B,IAAK,IAAA,CAAA,IAAA,CAAK,cAAiB,GAAA,CAAC,IAAK,CAAA,mBAAA,CAAA;AAEjC,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AAAA,GAC3B;AAAA,EAEO,KACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,IAAA,CAAA;AACvB,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,SAAA,CAAU,QAAgB,mBACjC,EAAA;AACI,IAAcC,2BAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,mBAAmB,CAAA,CAAA;AAAA,GACxD;AAAA,EAEO,cAAA,CAAe,QAAgB,SACtC,EAAA;AACI,IAAmBC,qCAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,SAAS,CAAA,CAAA;AAAA,GACnD;AAAA,EAEO,aAAA,CAAc,OAAc,SACnC,EAAA;AACI,IAAA,MAAM,OAAO,IAAK,CAAA,IAAA,CAAA;AAGlB,IAAO,OAAA,SAAA,CAAU,MAAM,KAAK,CAAA,CAAA;AAAA,GAChC;AAAA,EAEO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAM,EAAA,CAAA;AAAA,GACf;AAAA,EAEA,OAAc,KAAK,IACnB,EAAA;AACI,IAAA,OAAO,IAAgB,YAAAF,aAAA,CAAA;AAAA,GAC3B;AACJ,CAAA;AAhEa,SAAA,CAEK,YAA+BG,wBAAc,CAAA,UAAA;;;;"}
|
46
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.mjs
generated
vendored
Normal file
46
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.mjs
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions.mjs';
|
||||
import { Sprite } from '../../../scene/sprite/Sprite.mjs';
|
||||
import { addMaskBounds } from '../utils/addMaskBounds.mjs';
|
||||
import { addMaskLocalBounds } from '../utils/addMaskLocalBounds.mjs';
|
||||
|
||||
"use strict";
|
||||
class AlphaMask {
|
||||
constructor(options) {
|
||||
this.priority = 0;
|
||||
this.pipe = "alphaMask";
|
||||
if (options?.mask) {
|
||||
this.init(options.mask);
|
||||
}
|
||||
}
|
||||
init(mask) {
|
||||
this.mask = mask;
|
||||
this.renderMaskToTexture = !(mask instanceof Sprite);
|
||||
this.mask.renderable = this.renderMaskToTexture;
|
||||
this.mask.includeInBuild = !this.renderMaskToTexture;
|
||||
this.mask.measurable = false;
|
||||
}
|
||||
reset() {
|
||||
this.mask.measurable = true;
|
||||
this.mask = null;
|
||||
}
|
||||
addBounds(bounds, skipUpdateTransform) {
|
||||
addMaskBounds(this.mask, bounds, skipUpdateTransform);
|
||||
}
|
||||
addLocalBounds(bounds, localRoot) {
|
||||
addMaskLocalBounds(this.mask, bounds, localRoot);
|
||||
}
|
||||
containsPoint(point, hitTestFn) {
|
||||
const mask = this.mask;
|
||||
return hitTestFn(mask, point);
|
||||
}
|
||||
destroy() {
|
||||
this.reset();
|
||||
}
|
||||
static test(mask) {
|
||||
return mask instanceof Sprite;
|
||||
}
|
||||
}
|
||||
AlphaMask.extension = ExtensionType.MaskEffect;
|
||||
|
||||
export { AlphaMask };
|
||||
//# sourceMappingURL=AlphaMask.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AlphaMask.mjs","sources":["../../../../src/rendering/mask/alpha/AlphaMask.ts"],"sourcesContent":["import { ExtensionType } from '../../../extensions/Extensions';\nimport { Sprite } from '../../../scene/sprite/Sprite';\nimport { addMaskBounds } from '../utils/addMaskBounds';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds';\n\nimport type { ExtensionMetadata } from '../../../extensions/Extensions';\nimport type { Point } from '../../../maths/point/Point';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\nimport type { Effect } from '../../../scene/container/Effect';\nimport type { PoolItem } from '../../../utils/pool/Pool';\n\nexport class AlphaMask implements Effect, PoolItem\n{\n public static extension: ExtensionMetadata = ExtensionType.MaskEffect;\n\n public priority = 0;\n public mask: Container;\n public pipe = 'alphaMask';\n public renderMaskToTexture: boolean;\n\n constructor(options?: {mask: Container})\n {\n if (options?.mask)\n {\n this.init(options.mask);\n }\n }\n\n public init(mask: Container): void\n {\n this.mask = mask;\n\n // TODO - might want to change this to adjust on the fly\n // user may add children to the sprite..\n this.renderMaskToTexture = !(mask instanceof Sprite);\n\n this.mask.renderable = this.renderMaskToTexture;\n this.mask.includeInBuild = !this.renderMaskToTexture;\n\n this.mask.measurable = false;\n }\n\n public reset()\n {\n this.mask.measurable = true;\n this.mask = null;\n }\n\n public addBounds(bounds: Bounds, skipUpdateTransform?: boolean): void\n {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n\n public addLocalBounds(bounds: Bounds, localRoot: Container): void\n {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n\n public containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean\n {\n const mask = this.mask as any;\n\n // if the point is in the mask, yay!\n return hitTestFn(mask, point);\n }\n\n public destroy(): void\n {\n this.reset();\n }\n\n public static test(mask: any): boolean\n {\n return mask instanceof Sprite;\n }\n}\n"],"names":[],"mappings":";;;;;;AAYO,MAAM,SACb,CAAA;AAAA,EAQI,YAAY,OACZ,EAAA;AANA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,WAAA,CAAA;AAKV,IAAA,IAAI,SAAS,IACb,EAAA;AACI,MAAK,IAAA,CAAA,IAAA,CAAK,QAAQ,IAAI,CAAA,CAAA;AAAA,KAC1B;AAAA,GACJ;AAAA,EAEO,KAAK,IACZ,EAAA;AACI,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAIZ,IAAK,IAAA,CAAA,mBAAA,GAAsB,EAAE,IAAgB,YAAA,MAAA,CAAA,CAAA;AAE7C,IAAK,IAAA,CAAA,IAAA,CAAK,aAAa,IAAK,CAAA,mBAAA,CAAA;AAC5B,IAAK,IAAA,CAAA,IAAA,CAAK,cAAiB,GAAA,CAAC,IAAK,CAAA,mBAAA,CAAA;AAEjC,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AAAA,GAC3B;AAAA,EAEO,KACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,IAAA,CAAA;AACvB,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,SAAA,CAAU,QAAgB,mBACjC,EAAA;AACI,IAAc,aAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,mBAAmB,CAAA,CAAA;AAAA,GACxD;AAAA,EAEO,cAAA,CAAe,QAAgB,SACtC,EAAA;AACI,IAAmB,kBAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,SAAS,CAAA,CAAA;AAAA,GACnD;AAAA,EAEO,aAAA,CAAc,OAAc,SACnC,EAAA;AACI,IAAA,MAAM,OAAO,IAAK,CAAA,IAAA,CAAA;AAGlB,IAAO,OAAA,SAAA,CAAU,MAAM,KAAK,CAAA,CAAA;AAAA,GAChC;AAAA,EAEO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAM,EAAA,CAAA;AAAA,GACf;AAAA,EAEA,OAAc,KAAK,IACnB,EAAA;AACI,IAAA,OAAO,IAAgB,YAAA,MAAA,CAAA;AAAA,GAC3B;AACJ,CAAA;AAhEa,SAAA,CAEK,YAA+B,aAAc,CAAA,UAAA;;;;"}
|
48
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.d.ts
generated
vendored
Normal file
48
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions';
|
||||
import { FilterEffect } from '../../../filters/FilterEffect';
|
||||
import { Sprite } from '../../../scene/sprite/Sprite';
|
||||
import { Texture } from '../../renderers/shared/texture/Texture';
|
||||
import type { Container } from '../../../scene/container/Container';
|
||||
import type { Effect } from '../../../scene/container/Effect';
|
||||
import type { PoolItem } from '../../../utils/pool/Pool';
|
||||
import type { Instruction } from '../../renderers/shared/instructions/Instruction';
|
||||
import type { InstructionSet } from '../../renderers/shared/instructions/InstructionSet';
|
||||
import type { InstructionPipe } from '../../renderers/shared/instructions/RenderPipe';
|
||||
import type { RenderTarget } from '../../renderers/shared/renderTarget/RenderTarget';
|
||||
import type { Renderer } from '../../renderers/types';
|
||||
import type { AlphaMask } from './AlphaMask';
|
||||
type MaskMode = 'pushMaskBegin' | 'pushMaskEnd' | 'popMaskBegin' | 'popMaskEnd';
|
||||
declare class AlphaMaskEffect extends FilterEffect implements PoolItem {
|
||||
constructor();
|
||||
get sprite(): Sprite;
|
||||
set sprite(value: Sprite);
|
||||
init: () => void;
|
||||
}
|
||||
export interface AlphaMaskInstruction extends Instruction {
|
||||
renderPipeId: 'alphaMask';
|
||||
action: MaskMode;
|
||||
mask: AlphaMask;
|
||||
maskedContainer: Container;
|
||||
renderMask: boolean;
|
||||
}
|
||||
export interface AlphaMaskData {
|
||||
filterEffect: AlphaMaskEffect;
|
||||
maskedContainer: Container;
|
||||
previousRenderTarget?: RenderTarget;
|
||||
filterTexture?: Texture;
|
||||
}
|
||||
export declare class AlphaMaskPipe implements InstructionPipe<AlphaMaskInstruction> {
|
||||
/** @ignore */
|
||||
static extension: {
|
||||
readonly type: readonly [ExtensionType.WebGLPipes, ExtensionType.WebGPUPipes, ExtensionType.CanvasPipes];
|
||||
readonly name: "alphaMask";
|
||||
};
|
||||
private _renderer;
|
||||
private _activeMaskStage;
|
||||
constructor(renderer: Renderer);
|
||||
push(mask: Effect, maskedContainer: Container, instructionSet: InstructionSet): void;
|
||||
pop(mask: Effect, _maskedContainer: Container, instructionSet: InstructionSet): void;
|
||||
execute(instruction: AlphaMaskInstruction): void;
|
||||
destroy(): void;
|
||||
}
|
||||
export {};
|
156
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.js
generated
vendored
Normal file
156
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.js
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../../extensions/Extensions.js');
|
||||
var FilterEffect = require('../../../filters/FilterEffect.js');
|
||||
var MaskFilter = require('../../../filters/mask/MaskFilter.js');
|
||||
var Bounds = require('../../../scene/container/bounds/Bounds.js');
|
||||
var getGlobalBounds = require('../../../scene/container/bounds/getGlobalBounds.js');
|
||||
var buildInstructions = require('../../../scene/container/utils/buildInstructions.js');
|
||||
var Sprite = require('../../../scene/sprite/Sprite.js');
|
||||
var PoolGroup = require('../../../utils/pool/PoolGroup.js');
|
||||
var Texture = require('../../renderers/shared/texture/Texture.js');
|
||||
var TexturePool = require('../../renderers/shared/texture/TexturePool.js');
|
||||
var types = require('../../renderers/types.js');
|
||||
|
||||
"use strict";
|
||||
const tempBounds = new Bounds.Bounds();
|
||||
class AlphaMaskEffect extends FilterEffect.FilterEffect {
|
||||
constructor() {
|
||||
super();
|
||||
this.filters = [new MaskFilter.MaskFilter({
|
||||
sprite: new Sprite.Sprite(Texture.Texture.EMPTY),
|
||||
resolution: "inherit",
|
||||
antialias: "inherit"
|
||||
})];
|
||||
}
|
||||
get sprite() {
|
||||
return this.filters[0].sprite;
|
||||
}
|
||||
set sprite(value) {
|
||||
this.filters[0].sprite = value;
|
||||
}
|
||||
}
|
||||
class AlphaMaskPipe {
|
||||
constructor(renderer) {
|
||||
this._activeMaskStage = [];
|
||||
this._renderer = renderer;
|
||||
}
|
||||
push(mask, maskedContainer, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "alphaMask",
|
||||
action: "pushMaskBegin",
|
||||
mask,
|
||||
canBundle: false,
|
||||
maskedContainer
|
||||
});
|
||||
if (mask.renderMaskToTexture) {
|
||||
const maskContainer = mask.mask;
|
||||
maskContainer.includeInBuild = true;
|
||||
buildInstructions.collectAllRenderables(
|
||||
maskContainer,
|
||||
instructionSet,
|
||||
renderer
|
||||
);
|
||||
maskContainer.includeInBuild = false;
|
||||
}
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "alphaMask",
|
||||
action: "pushMaskEnd",
|
||||
mask,
|
||||
maskedContainer,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
pop(mask, _maskedContainer, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "alphaMask",
|
||||
action: "popMaskEnd",
|
||||
mask,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
execute(instruction) {
|
||||
const renderer = this._renderer;
|
||||
const renderMask = instruction.mask.renderMaskToTexture;
|
||||
if (instruction.action === "pushMaskBegin") {
|
||||
const filterEffect = PoolGroup.BigPool.get(AlphaMaskEffect);
|
||||
if (renderMask) {
|
||||
instruction.mask.mask.measurable = true;
|
||||
const bounds = getGlobalBounds.getGlobalBounds(instruction.mask.mask, true, tempBounds);
|
||||
instruction.mask.mask.measurable = false;
|
||||
bounds.ceil();
|
||||
const colorTextureSource = renderer.renderTarget.renderTarget.colorTexture.source;
|
||||
const filterTexture = TexturePool.TexturePool.getOptimalTexture(
|
||||
bounds.width,
|
||||
bounds.height,
|
||||
colorTextureSource._resolution,
|
||||
colorTextureSource.antialias
|
||||
);
|
||||
renderer.renderTarget.push(filterTexture, true);
|
||||
renderer.globalUniforms.push({
|
||||
offset: bounds,
|
||||
worldColor: 4294967295
|
||||
});
|
||||
const sprite = filterEffect.sprite;
|
||||
sprite.texture = filterTexture;
|
||||
sprite.worldTransform.tx = bounds.minX;
|
||||
sprite.worldTransform.ty = bounds.minY;
|
||||
this._activeMaskStage.push({
|
||||
filterEffect,
|
||||
maskedContainer: instruction.maskedContainer,
|
||||
filterTexture
|
||||
});
|
||||
} else {
|
||||
filterEffect.sprite = instruction.mask.mask;
|
||||
this._activeMaskStage.push({
|
||||
filterEffect,
|
||||
maskedContainer: instruction.maskedContainer
|
||||
});
|
||||
}
|
||||
} else if (instruction.action === "pushMaskEnd") {
|
||||
const maskData = this._activeMaskStage[this._activeMaskStage.length - 1];
|
||||
if (renderMask) {
|
||||
if (renderer.type === types.RendererType.WEBGL) {
|
||||
renderer.renderTarget.finishRenderPass();
|
||||
}
|
||||
renderer.renderTarget.pop();
|
||||
renderer.globalUniforms.pop();
|
||||
}
|
||||
renderer.filter.push({
|
||||
renderPipeId: "filter",
|
||||
action: "pushFilter",
|
||||
container: maskData.maskedContainer,
|
||||
filterEffect: maskData.filterEffect,
|
||||
canBundle: false
|
||||
});
|
||||
} else if (instruction.action === "popMaskEnd") {
|
||||
renderer.filter.pop();
|
||||
const maskData = this._activeMaskStage.pop();
|
||||
if (renderMask) {
|
||||
TexturePool.TexturePool.returnTexture(maskData.filterTexture);
|
||||
}
|
||||
PoolGroup.BigPool.return(maskData.filterEffect);
|
||||
}
|
||||
}
|
||||
destroy() {
|
||||
this._renderer = null;
|
||||
this._activeMaskStage = null;
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
AlphaMaskPipe.extension = {
|
||||
type: [
|
||||
Extensions.ExtensionType.WebGLPipes,
|
||||
Extensions.ExtensionType.WebGPUPipes,
|
||||
Extensions.ExtensionType.CanvasPipes
|
||||
],
|
||||
name: "alphaMask"
|
||||
};
|
||||
|
||||
exports.AlphaMaskPipe = AlphaMaskPipe;
|
||||
//# sourceMappingURL=AlphaMaskPipe.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
154
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.mjs
generated
vendored
Normal file
154
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.mjs
generated
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions.mjs';
|
||||
import { FilterEffect } from '../../../filters/FilterEffect.mjs';
|
||||
import { MaskFilter } from '../../../filters/mask/MaskFilter.mjs';
|
||||
import { Bounds } from '../../../scene/container/bounds/Bounds.mjs';
|
||||
import { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds.mjs';
|
||||
import { collectAllRenderables } from '../../../scene/container/utils/buildInstructions.mjs';
|
||||
import { Sprite } from '../../../scene/sprite/Sprite.mjs';
|
||||
import { BigPool } from '../../../utils/pool/PoolGroup.mjs';
|
||||
import { Texture } from '../../renderers/shared/texture/Texture.mjs';
|
||||
import { TexturePool } from '../../renderers/shared/texture/TexturePool.mjs';
|
||||
import { RendererType } from '../../renderers/types.mjs';
|
||||
|
||||
"use strict";
|
||||
const tempBounds = new Bounds();
|
||||
class AlphaMaskEffect extends FilterEffect {
|
||||
constructor() {
|
||||
super();
|
||||
this.filters = [new MaskFilter({
|
||||
sprite: new Sprite(Texture.EMPTY),
|
||||
resolution: "inherit",
|
||||
antialias: "inherit"
|
||||
})];
|
||||
}
|
||||
get sprite() {
|
||||
return this.filters[0].sprite;
|
||||
}
|
||||
set sprite(value) {
|
||||
this.filters[0].sprite = value;
|
||||
}
|
||||
}
|
||||
class AlphaMaskPipe {
|
||||
constructor(renderer) {
|
||||
this._activeMaskStage = [];
|
||||
this._renderer = renderer;
|
||||
}
|
||||
push(mask, maskedContainer, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "alphaMask",
|
||||
action: "pushMaskBegin",
|
||||
mask,
|
||||
canBundle: false,
|
||||
maskedContainer
|
||||
});
|
||||
if (mask.renderMaskToTexture) {
|
||||
const maskContainer = mask.mask;
|
||||
maskContainer.includeInBuild = true;
|
||||
collectAllRenderables(
|
||||
maskContainer,
|
||||
instructionSet,
|
||||
renderer
|
||||
);
|
||||
maskContainer.includeInBuild = false;
|
||||
}
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "alphaMask",
|
||||
action: "pushMaskEnd",
|
||||
mask,
|
||||
maskedContainer,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
pop(mask, _maskedContainer, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "alphaMask",
|
||||
action: "popMaskEnd",
|
||||
mask,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
execute(instruction) {
|
||||
const renderer = this._renderer;
|
||||
const renderMask = instruction.mask.renderMaskToTexture;
|
||||
if (instruction.action === "pushMaskBegin") {
|
||||
const filterEffect = BigPool.get(AlphaMaskEffect);
|
||||
if (renderMask) {
|
||||
instruction.mask.mask.measurable = true;
|
||||
const bounds = getGlobalBounds(instruction.mask.mask, true, tempBounds);
|
||||
instruction.mask.mask.measurable = false;
|
||||
bounds.ceil();
|
||||
const colorTextureSource = renderer.renderTarget.renderTarget.colorTexture.source;
|
||||
const filterTexture = TexturePool.getOptimalTexture(
|
||||
bounds.width,
|
||||
bounds.height,
|
||||
colorTextureSource._resolution,
|
||||
colorTextureSource.antialias
|
||||
);
|
||||
renderer.renderTarget.push(filterTexture, true);
|
||||
renderer.globalUniforms.push({
|
||||
offset: bounds,
|
||||
worldColor: 4294967295
|
||||
});
|
||||
const sprite = filterEffect.sprite;
|
||||
sprite.texture = filterTexture;
|
||||
sprite.worldTransform.tx = bounds.minX;
|
||||
sprite.worldTransform.ty = bounds.minY;
|
||||
this._activeMaskStage.push({
|
||||
filterEffect,
|
||||
maskedContainer: instruction.maskedContainer,
|
||||
filterTexture
|
||||
});
|
||||
} else {
|
||||
filterEffect.sprite = instruction.mask.mask;
|
||||
this._activeMaskStage.push({
|
||||
filterEffect,
|
||||
maskedContainer: instruction.maskedContainer
|
||||
});
|
||||
}
|
||||
} else if (instruction.action === "pushMaskEnd") {
|
||||
const maskData = this._activeMaskStage[this._activeMaskStage.length - 1];
|
||||
if (renderMask) {
|
||||
if (renderer.type === RendererType.WEBGL) {
|
||||
renderer.renderTarget.finishRenderPass();
|
||||
}
|
||||
renderer.renderTarget.pop();
|
||||
renderer.globalUniforms.pop();
|
||||
}
|
||||
renderer.filter.push({
|
||||
renderPipeId: "filter",
|
||||
action: "pushFilter",
|
||||
container: maskData.maskedContainer,
|
||||
filterEffect: maskData.filterEffect,
|
||||
canBundle: false
|
||||
});
|
||||
} else if (instruction.action === "popMaskEnd") {
|
||||
renderer.filter.pop();
|
||||
const maskData = this._activeMaskStage.pop();
|
||||
if (renderMask) {
|
||||
TexturePool.returnTexture(maskData.filterTexture);
|
||||
}
|
||||
BigPool.return(maskData.filterEffect);
|
||||
}
|
||||
}
|
||||
destroy() {
|
||||
this._renderer = null;
|
||||
this._activeMaskStage = null;
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
AlphaMaskPipe.extension = {
|
||||
type: [
|
||||
ExtensionType.WebGLPipes,
|
||||
ExtensionType.WebGPUPipes,
|
||||
ExtensionType.CanvasPipes
|
||||
],
|
||||
name: "alphaMask"
|
||||
};
|
||||
|
||||
export { AlphaMaskPipe };
|
||||
//# sourceMappingURL=AlphaMaskPipe.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.d.ts
generated
vendored
Normal file
15
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { ExtensionMetadata } from '../../../extensions/Extensions';
|
||||
import type { Effect } from '../../../scene/container/Effect';
|
||||
import type { PoolItem } from '../../../utils/pool/Pool';
|
||||
export declare class ColorMask implements Effect, PoolItem {
|
||||
static extension: ExtensionMetadata;
|
||||
priority: number;
|
||||
mask: number;
|
||||
pipe: string;
|
||||
constructor(options: {
|
||||
mask: number;
|
||||
});
|
||||
init(mask: number): void;
|
||||
destroy(): void;
|
||||
static test(mask: any): boolean;
|
||||
}
|
26
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.js
generated
vendored
Normal file
26
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../../extensions/Extensions.js');
|
||||
|
||||
"use strict";
|
||||
class ColorMask {
|
||||
constructor(options) {
|
||||
this.priority = 0;
|
||||
this.pipe = "colorMask";
|
||||
if (options?.mask) {
|
||||
this.init(options.mask);
|
||||
}
|
||||
}
|
||||
init(mask) {
|
||||
this.mask = mask;
|
||||
}
|
||||
destroy() {
|
||||
}
|
||||
static test(mask) {
|
||||
return typeof mask === "number";
|
||||
}
|
||||
}
|
||||
ColorMask.extension = Extensions.ExtensionType.MaskEffect;
|
||||
|
||||
exports.ColorMask = ColorMask;
|
||||
//# sourceMappingURL=ColorMask.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ColorMask.js","sources":["../../../../src/rendering/mask/color/ColorMask.ts"],"sourcesContent":["import { ExtensionType } from '../../../extensions/Extensions';\n\nimport type { ExtensionMetadata } from '../../../extensions/Extensions';\nimport type { Effect } from '../../../scene/container/Effect';\nimport type { PoolItem } from '../../../utils/pool/Pool';\n\nexport class ColorMask implements Effect, PoolItem\n{\n public static extension: ExtensionMetadata = ExtensionType.MaskEffect;\n\n public priority = 0;\n public mask: number;\n public pipe = 'colorMask';\n\n constructor(options: {mask: number})\n {\n if (options?.mask)\n {\n this.init(options.mask);\n }\n }\n\n public init(mask: number): void\n {\n this.mask = mask;\n }\n\n public destroy(): void\n {\n // nothing to destroy\n }\n\n public static test(mask: any): boolean\n {\n return typeof mask === 'number';\n }\n}\n"],"names":["ExtensionType"],"mappings":";;;;;AAMO,MAAM,SACb,CAAA;AAAA,EAOI,YAAY,OACZ,EAAA;AALA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,WAAA,CAAA;AAIV,IAAA,IAAI,SAAS,IACb,EAAA;AACI,MAAK,IAAA,CAAA,IAAA,CAAK,QAAQ,IAAI,CAAA,CAAA;AAAA,KAC1B;AAAA,GACJ;AAAA,EAEO,KAAK,IACZ,EAAA;AACI,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,OACP,GAAA;AAAA,GAEA;AAAA,EAEA,OAAc,KAAK,IACnB,EAAA;AACI,IAAA,OAAO,OAAO,IAAS,KAAA,QAAA,CAAA;AAAA,GAC3B;AACJ,CAAA;AA9Ba,SAAA,CAEK,YAA+BA,wBAAc,CAAA,UAAA;;;;"}
|
24
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.mjs
generated
vendored
Normal file
24
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions.mjs';
|
||||
|
||||
"use strict";
|
||||
class ColorMask {
|
||||
constructor(options) {
|
||||
this.priority = 0;
|
||||
this.pipe = "colorMask";
|
||||
if (options?.mask) {
|
||||
this.init(options.mask);
|
||||
}
|
||||
}
|
||||
init(mask) {
|
||||
this.mask = mask;
|
||||
}
|
||||
destroy() {
|
||||
}
|
||||
static test(mask) {
|
||||
return typeof mask === "number";
|
||||
}
|
||||
}
|
||||
ColorMask.extension = ExtensionType.MaskEffect;
|
||||
|
||||
export { ColorMask };
|
||||
//# sourceMappingURL=ColorMask.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMask.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ColorMask.mjs","sources":["../../../../src/rendering/mask/color/ColorMask.ts"],"sourcesContent":["import { ExtensionType } from '../../../extensions/Extensions';\n\nimport type { ExtensionMetadata } from '../../../extensions/Extensions';\nimport type { Effect } from '../../../scene/container/Effect';\nimport type { PoolItem } from '../../../utils/pool/Pool';\n\nexport class ColorMask implements Effect, PoolItem\n{\n public static extension: ExtensionMetadata = ExtensionType.MaskEffect;\n\n public priority = 0;\n public mask: number;\n public pipe = 'colorMask';\n\n constructor(options: {mask: number})\n {\n if (options?.mask)\n {\n this.init(options.mask);\n }\n }\n\n public init(mask: number): void\n {\n this.mask = mask;\n }\n\n public destroy(): void\n {\n // nothing to destroy\n }\n\n public static test(mask: any): boolean\n {\n return typeof mask === 'number';\n }\n}\n"],"names":[],"mappings":";;;AAMO,MAAM,SACb,CAAA;AAAA,EAOI,YAAY,OACZ,EAAA;AALA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,WAAA,CAAA;AAIV,IAAA,IAAI,SAAS,IACb,EAAA;AACI,MAAK,IAAA,CAAA,IAAA,CAAK,QAAQ,IAAI,CAAA,CAAA;AAAA,KAC1B;AAAA,GACJ;AAAA,EAEO,KAAK,IACZ,EAAA;AACI,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,OACP,GAAA;AAAA,GAEA;AAAA,EAEA,OAAc,KAAK,IACnB,EAAA;AACI,IAAA,OAAO,OAAO,IAAS,KAAA,QAAA,CAAA;AAAA,GAC3B;AACJ,CAAA;AA9Ba,SAAA,CAEK,YAA+B,aAAc,CAAA,UAAA;;;;"}
|
28
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.d.ts
generated
vendored
Normal file
28
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions';
|
||||
import type { Container } from '../../../scene/container/Container';
|
||||
import type { Effect } from '../../../scene/container/Effect';
|
||||
import type { Instruction } from '../../renderers/shared/instructions/Instruction';
|
||||
import type { InstructionSet } from '../../renderers/shared/instructions/InstructionSet';
|
||||
import type { InstructionPipe } from '../../renderers/shared/instructions/RenderPipe';
|
||||
import type { Renderer } from '../../renderers/types';
|
||||
export interface ColorMaskInstruction extends Instruction {
|
||||
renderPipeId: 'colorMask';
|
||||
colorMask: number;
|
||||
}
|
||||
export declare class ColorMaskPipe implements InstructionPipe<ColorMaskInstruction> {
|
||||
/** @ignore */
|
||||
static extension: {
|
||||
readonly type: readonly [ExtensionType.WebGLPipes, ExtensionType.WebGPUPipes, ExtensionType.CanvasPipes];
|
||||
readonly name: "colorMask";
|
||||
};
|
||||
private readonly _renderer;
|
||||
private _colorStack;
|
||||
private _colorStackIndex;
|
||||
private _currentColor;
|
||||
constructor(renderer: Renderer);
|
||||
buildStart(): void;
|
||||
push(mask: Effect, _container: Container, instructionSet: InstructionSet): void;
|
||||
pop(_mask: Effect, _container: Container, instructionSet: InstructionSet): void;
|
||||
execute(instruction: ColorMaskInstruction): void;
|
||||
destroy(): void;
|
||||
}
|
68
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.js
generated
vendored
Normal file
68
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../../extensions/Extensions.js');
|
||||
|
||||
"use strict";
|
||||
class ColorMaskPipe {
|
||||
constructor(renderer) {
|
||||
this._colorStack = [];
|
||||
this._colorStackIndex = 0;
|
||||
this._currentColor = 0;
|
||||
this._renderer = renderer;
|
||||
}
|
||||
buildStart() {
|
||||
this._colorStack[0] = 15;
|
||||
this._colorStackIndex = 1;
|
||||
this._currentColor = 15;
|
||||
}
|
||||
push(mask, _container, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
const colorStack = this._colorStack;
|
||||
colorStack[this._colorStackIndex] = colorStack[this._colorStackIndex - 1] & mask.mask;
|
||||
const currentColor = this._colorStack[this._colorStackIndex];
|
||||
if (currentColor !== this._currentColor) {
|
||||
this._currentColor = currentColor;
|
||||
instructionSet.add({
|
||||
renderPipeId: "colorMask",
|
||||
colorMask: currentColor,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
this._colorStackIndex++;
|
||||
}
|
||||
pop(_mask, _container, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
const colorStack = this._colorStack;
|
||||
this._colorStackIndex--;
|
||||
const currentColor = colorStack[this._colorStackIndex - 1];
|
||||
if (currentColor !== this._currentColor) {
|
||||
this._currentColor = currentColor;
|
||||
instructionSet.add({
|
||||
renderPipeId: "colorMask",
|
||||
colorMask: currentColor,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
}
|
||||
execute(instruction) {
|
||||
const renderer = this._renderer;
|
||||
renderer.colorMask.setMask(instruction.colorMask);
|
||||
}
|
||||
destroy() {
|
||||
this._colorStack = null;
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
ColorMaskPipe.extension = {
|
||||
type: [
|
||||
Extensions.ExtensionType.WebGLPipes,
|
||||
Extensions.ExtensionType.WebGPUPipes,
|
||||
Extensions.ExtensionType.CanvasPipes
|
||||
],
|
||||
name: "colorMask"
|
||||
};
|
||||
|
||||
exports.ColorMaskPipe = ColorMaskPipe;
|
||||
//# sourceMappingURL=ColorMaskPipe.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
66
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.mjs
generated
vendored
Normal file
66
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.mjs
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions.mjs';
|
||||
|
||||
"use strict";
|
||||
class ColorMaskPipe {
|
||||
constructor(renderer) {
|
||||
this._colorStack = [];
|
||||
this._colorStackIndex = 0;
|
||||
this._currentColor = 0;
|
||||
this._renderer = renderer;
|
||||
}
|
||||
buildStart() {
|
||||
this._colorStack[0] = 15;
|
||||
this._colorStackIndex = 1;
|
||||
this._currentColor = 15;
|
||||
}
|
||||
push(mask, _container, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
const colorStack = this._colorStack;
|
||||
colorStack[this._colorStackIndex] = colorStack[this._colorStackIndex - 1] & mask.mask;
|
||||
const currentColor = this._colorStack[this._colorStackIndex];
|
||||
if (currentColor !== this._currentColor) {
|
||||
this._currentColor = currentColor;
|
||||
instructionSet.add({
|
||||
renderPipeId: "colorMask",
|
||||
colorMask: currentColor,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
this._colorStackIndex++;
|
||||
}
|
||||
pop(_mask, _container, instructionSet) {
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
const colorStack = this._colorStack;
|
||||
this._colorStackIndex--;
|
||||
const currentColor = colorStack[this._colorStackIndex - 1];
|
||||
if (currentColor !== this._currentColor) {
|
||||
this._currentColor = currentColor;
|
||||
instructionSet.add({
|
||||
renderPipeId: "colorMask",
|
||||
colorMask: currentColor,
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
}
|
||||
execute(instruction) {
|
||||
const renderer = this._renderer;
|
||||
renderer.colorMask.setMask(instruction.colorMask);
|
||||
}
|
||||
destroy() {
|
||||
this._colorStack = null;
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
ColorMaskPipe.extension = {
|
||||
type: [
|
||||
ExtensionType.WebGLPipes,
|
||||
ExtensionType.WebGPUPipes,
|
||||
ExtensionType.CanvasPipes
|
||||
],
|
||||
name: "colorMask"
|
||||
};
|
||||
|
||||
export { ColorMaskPipe };
|
||||
//# sourceMappingURL=ColorMaskPipe.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.d.ts
generated
vendored
Normal file
15
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Point } from '../../../maths/point/Point';
|
||||
import type { Bounds } from '../../../scene/container/bounds/Bounds';
|
||||
import type { Container } from '../../../scene/container/Container';
|
||||
import type { Effect } from '../../../scene/container/Effect';
|
||||
export declare class ScissorMask implements Effect {
|
||||
priority: number;
|
||||
mask: Container;
|
||||
pipe: string;
|
||||
constructor(mask: Container);
|
||||
addBounds(bounds: Bounds, skipUpdateTransform?: boolean): void;
|
||||
addLocalBounds(bounds: Bounds, localRoot: Container): void;
|
||||
containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean;
|
||||
reset(): void;
|
||||
destroy(): void;
|
||||
}
|
35
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.js
generated
vendored
Normal file
35
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
var addMaskBounds = require('../utils/addMaskBounds.js');
|
||||
var addMaskLocalBounds = require('../utils/addMaskLocalBounds.js');
|
||||
|
||||
"use strict";
|
||||
class ScissorMask {
|
||||
constructor(mask) {
|
||||
this.priority = 0;
|
||||
this.pipe = "scissorMask";
|
||||
this.mask = mask;
|
||||
this.mask.renderable = false;
|
||||
this.mask.measurable = false;
|
||||
}
|
||||
addBounds(bounds, skipUpdateTransform) {
|
||||
addMaskBounds.addMaskBounds(this.mask, bounds, skipUpdateTransform);
|
||||
}
|
||||
addLocalBounds(bounds, localRoot) {
|
||||
addMaskLocalBounds.addMaskLocalBounds(this.mask, bounds, localRoot);
|
||||
}
|
||||
containsPoint(point, hitTestFn) {
|
||||
const mask = this.mask;
|
||||
return hitTestFn(mask, point);
|
||||
}
|
||||
reset() {
|
||||
this.mask.measurable = true;
|
||||
this.mask = null;
|
||||
}
|
||||
destroy() {
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
exports.ScissorMask = ScissorMask;
|
||||
//# sourceMappingURL=ScissorMask.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ScissorMask.js","sources":["../../../../src/rendering/mask/scissor/ScissorMask.ts"],"sourcesContent":["import { addMaskBounds } from '../utils/addMaskBounds';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds';\n\nimport type { Point } from '../../../maths/point/Point';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\nimport type { Effect } from '../../../scene/container/Effect';\n\nexport class ScissorMask implements Effect\n{\n public priority = 0;\n public mask: Container;\n public pipe = 'scissorMask';\n\n constructor(mask: Container)\n {\n this.mask = mask;\n\n this.mask.renderable = false;\n this.mask.measurable = false;\n }\n\n public addBounds(bounds: Bounds, skipUpdateTransform?: boolean): void\n {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n\n public addLocalBounds(bounds: Bounds, localRoot: Container): void\n {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n\n public containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean\n {\n const mask = this.mask as any;\n\n // if the point is in the mask, yay!\n return hitTestFn(mask, point);\n }\n\n public reset()\n {\n this.mask.measurable = true;\n this.mask = null;\n }\n\n public destroy(): void\n {\n this.reset();\n }\n}\n"],"names":["addMaskBounds","addMaskLocalBounds"],"mappings":";;;;;;AAQO,MAAM,WACb,CAAA;AAAA,EAKI,YAAY,IACZ,EAAA;AALA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,aAAA,CAAA;AAIV,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAEZ,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AACvB,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AAAA,GAC3B;AAAA,EAEO,SAAA,CAAU,QAAgB,mBACjC,EAAA;AACI,IAAcA,2BAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,mBAAmB,CAAA,CAAA;AAAA,GACxD;AAAA,EAEO,cAAA,CAAe,QAAgB,SACtC,EAAA;AACI,IAAmBC,qCAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,SAAS,CAAA,CAAA;AAAA,GACnD;AAAA,EAEO,aAAA,CAAc,OAAc,SACnC,EAAA;AACI,IAAA,MAAM,OAAO,IAAK,CAAA,IAAA,CAAA;AAGlB,IAAO,OAAA,SAAA,CAAU,MAAM,KAAK,CAAA,CAAA;AAAA,GAChC;AAAA,EAEO,KACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,IAAA,CAAA;AACvB,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAM,EAAA,CAAA;AAAA,GACf;AACJ;;;;"}
|
33
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.mjs
generated
vendored
Normal file
33
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.mjs
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { addMaskBounds } from '../utils/addMaskBounds.mjs';
|
||||
import { addMaskLocalBounds } from '../utils/addMaskLocalBounds.mjs';
|
||||
|
||||
"use strict";
|
||||
class ScissorMask {
|
||||
constructor(mask) {
|
||||
this.priority = 0;
|
||||
this.pipe = "scissorMask";
|
||||
this.mask = mask;
|
||||
this.mask.renderable = false;
|
||||
this.mask.measurable = false;
|
||||
}
|
||||
addBounds(bounds, skipUpdateTransform) {
|
||||
addMaskBounds(this.mask, bounds, skipUpdateTransform);
|
||||
}
|
||||
addLocalBounds(bounds, localRoot) {
|
||||
addMaskLocalBounds(this.mask, bounds, localRoot);
|
||||
}
|
||||
containsPoint(point, hitTestFn) {
|
||||
const mask = this.mask;
|
||||
return hitTestFn(mask, point);
|
||||
}
|
||||
reset() {
|
||||
this.mask.measurable = true;
|
||||
this.mask = null;
|
||||
}
|
||||
destroy() {
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
export { ScissorMask };
|
||||
//# sourceMappingURL=ScissorMask.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/scissor/ScissorMask.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ScissorMask.mjs","sources":["../../../../src/rendering/mask/scissor/ScissorMask.ts"],"sourcesContent":["import { addMaskBounds } from '../utils/addMaskBounds';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds';\n\nimport type { Point } from '../../../maths/point/Point';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\nimport type { Effect } from '../../../scene/container/Effect';\n\nexport class ScissorMask implements Effect\n{\n public priority = 0;\n public mask: Container;\n public pipe = 'scissorMask';\n\n constructor(mask: Container)\n {\n this.mask = mask;\n\n this.mask.renderable = false;\n this.mask.measurable = false;\n }\n\n public addBounds(bounds: Bounds, skipUpdateTransform?: boolean): void\n {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n\n public addLocalBounds(bounds: Bounds, localRoot: Container): void\n {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n\n public containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean\n {\n const mask = this.mask as any;\n\n // if the point is in the mask, yay!\n return hitTestFn(mask, point);\n }\n\n public reset()\n {\n this.mask.measurable = true;\n this.mask = null;\n }\n\n public destroy(): void\n {\n this.reset();\n }\n}\n"],"names":[],"mappings":";;;;AAQO,MAAM,WACb,CAAA;AAAA,EAKI,YAAY,IACZ,EAAA;AALA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,aAAA,CAAA;AAIV,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAEZ,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AACvB,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AAAA,GAC3B;AAAA,EAEO,SAAA,CAAU,QAAgB,mBACjC,EAAA;AACI,IAAc,aAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,mBAAmB,CAAA,CAAA;AAAA,GACxD;AAAA,EAEO,cAAA,CAAe,QAAgB,SACtC,EAAA;AACI,IAAmB,kBAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,SAAS,CAAA,CAAA;AAAA,GACnD;AAAA,EAEO,aAAA,CAAc,OAAc,SACnC,EAAA;AACI,IAAA,MAAM,OAAO,IAAK,CAAA,IAAA,CAAA;AAGlB,IAAO,OAAA,SAAA,CAAU,MAAM,KAAK,CAAA,CAAA;AAAA,GAChC;AAAA,EAEO,KACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,IAAA,CAAA;AACvB,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAM,EAAA,CAAA;AAAA,GACf;AACJ;;;;"}
|
22
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.d.ts
generated
vendored
Normal file
22
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Container } from '../../../scene/container/Container';
|
||||
import type { ExtensionMetadata } from '../../../extensions/Extensions';
|
||||
import type { Point } from '../../../maths/point/Point';
|
||||
import type { Bounds } from '../../../scene/container/bounds/Bounds';
|
||||
import type { Effect } from '../../../scene/container/Effect';
|
||||
import type { PoolItem } from '../../../utils/pool/Pool';
|
||||
export declare class StencilMask implements Effect, PoolItem {
|
||||
static extension: ExtensionMetadata;
|
||||
priority: number;
|
||||
mask: Container;
|
||||
pipe: string;
|
||||
constructor(options: {
|
||||
mask: Container;
|
||||
});
|
||||
init(mask: Container): void;
|
||||
reset(): void;
|
||||
addBounds(bounds: Bounds, skipUpdateTransform: boolean): void;
|
||||
addLocalBounds(bounds: Bounds, localRoot: Container): void;
|
||||
containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean;
|
||||
destroy(): void;
|
||||
static test(mask: any): boolean;
|
||||
}
|
47
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.js
generated
vendored
Normal file
47
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../../extensions/Extensions.js');
|
||||
var Container = require('../../../scene/container/Container.js');
|
||||
var addMaskBounds = require('../utils/addMaskBounds.js');
|
||||
var addMaskLocalBounds = require('../utils/addMaskLocalBounds.js');
|
||||
|
||||
"use strict";
|
||||
class StencilMask {
|
||||
constructor(options) {
|
||||
this.priority = 0;
|
||||
this.pipe = "stencilMask";
|
||||
if (options?.mask) {
|
||||
this.init(options.mask);
|
||||
}
|
||||
}
|
||||
init(mask) {
|
||||
this.mask = mask;
|
||||
this.mask.includeInBuild = false;
|
||||
this.mask.measurable = false;
|
||||
}
|
||||
reset() {
|
||||
this.mask.measurable = true;
|
||||
this.mask.includeInBuild = true;
|
||||
this.mask = null;
|
||||
}
|
||||
addBounds(bounds, skipUpdateTransform) {
|
||||
addMaskBounds.addMaskBounds(this.mask, bounds, skipUpdateTransform);
|
||||
}
|
||||
addLocalBounds(bounds, localRoot) {
|
||||
addMaskLocalBounds.addMaskLocalBounds(this.mask, bounds, localRoot);
|
||||
}
|
||||
containsPoint(point, hitTestFn) {
|
||||
const mask = this.mask;
|
||||
return hitTestFn(mask, point);
|
||||
}
|
||||
destroy() {
|
||||
this.reset();
|
||||
}
|
||||
static test(mask) {
|
||||
return mask instanceof Container.Container;
|
||||
}
|
||||
}
|
||||
StencilMask.extension = Extensions.ExtensionType.MaskEffect;
|
||||
|
||||
exports.StencilMask = StencilMask;
|
||||
//# sourceMappingURL=StencilMask.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"StencilMask.js","sources":["../../../../src/rendering/mask/stencil/StencilMask.ts"],"sourcesContent":["import { ExtensionType } from '../../../extensions/Extensions';\nimport { Container } from '../../../scene/container/Container';\nimport { addMaskBounds } from '../utils/addMaskBounds';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds';\n\nimport type { ExtensionMetadata } from '../../../extensions/Extensions';\nimport type { Point } from '../../../maths/point/Point';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Effect } from '../../../scene/container/Effect';\nimport type { PoolItem } from '../../../utils/pool/Pool';\n\nexport class StencilMask implements Effect, PoolItem\n{\n public static extension: ExtensionMetadata = ExtensionType.MaskEffect;\n\n public priority = 0;\n public mask: Container;\n public pipe = 'stencilMask';\n\n constructor(options: {mask: Container})\n {\n if (options?.mask)\n {\n this.init(options.mask);\n }\n }\n\n public init(mask: Container): void\n {\n this.mask = mask;\n this.mask.includeInBuild = false;\n this.mask.measurable = false;\n }\n\n public reset()\n {\n this.mask.measurable = true;\n this.mask.includeInBuild = true;\n this.mask = null;\n }\n\n public addBounds(bounds: Bounds, skipUpdateTransform: boolean): void\n {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n\n public addLocalBounds(bounds: Bounds, localRoot: Container): void\n {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n\n public containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean\n {\n const mask = this.mask as any;\n\n // if the point is in the mask, yay!\n return hitTestFn(mask, point);\n }\n\n public destroy(): void\n {\n this.reset();\n }\n\n public static test(mask: any): boolean\n {\n return mask instanceof Container;\n }\n}\n"],"names":["addMaskBounds","addMaskLocalBounds","Container","ExtensionType"],"mappings":";;;;;;;;AAWO,MAAM,WACb,CAAA;AAAA,EAOI,YAAY,OACZ,EAAA;AALA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,aAAA,CAAA;AAIV,IAAA,IAAI,SAAS,IACb,EAAA;AACI,MAAK,IAAA,CAAA,IAAA,CAAK,QAAQ,IAAI,CAAA,CAAA;AAAA,KAC1B;AAAA,GACJ;AAAA,EAEO,KAAK,IACZ,EAAA;AACI,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AACZ,IAAA,IAAA,CAAK,KAAK,cAAiB,GAAA,KAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AAAA,GAC3B;AAAA,EAEO,KACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,IAAA,CAAA;AACvB,IAAA,IAAA,CAAK,KAAK,cAAiB,GAAA,IAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,SAAA,CAAU,QAAgB,mBACjC,EAAA;AACI,IAAcA,2BAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,mBAAmB,CAAA,CAAA;AAAA,GACxD;AAAA,EAEO,cAAA,CAAe,QAAgB,SACtC,EAAA;AACI,IAAmBC,qCAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,SAAS,CAAA,CAAA;AAAA,GACnD;AAAA,EAEO,aAAA,CAAc,OAAc,SACnC,EAAA;AACI,IAAA,MAAM,OAAO,IAAK,CAAA,IAAA,CAAA;AAGlB,IAAO,OAAA,SAAA,CAAU,MAAM,KAAK,CAAA,CAAA;AAAA,GAChC;AAAA,EAEO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAM,EAAA,CAAA;AAAA,GACf;AAAA,EAEA,OAAc,KAAK,IACnB,EAAA;AACI,IAAA,OAAO,IAAgB,YAAAC,mBAAA,CAAA;AAAA,GAC3B;AACJ,CAAA;AAzDa,WAAA,CAEK,YAA+BC,wBAAc,CAAA,UAAA;;;;"}
|
45
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.mjs
generated
vendored
Normal file
45
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.mjs
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions.mjs';
|
||||
import { Container } from '../../../scene/container/Container.mjs';
|
||||
import { addMaskBounds } from '../utils/addMaskBounds.mjs';
|
||||
import { addMaskLocalBounds } from '../utils/addMaskLocalBounds.mjs';
|
||||
|
||||
"use strict";
|
||||
class StencilMask {
|
||||
constructor(options) {
|
||||
this.priority = 0;
|
||||
this.pipe = "stencilMask";
|
||||
if (options?.mask) {
|
||||
this.init(options.mask);
|
||||
}
|
||||
}
|
||||
init(mask) {
|
||||
this.mask = mask;
|
||||
this.mask.includeInBuild = false;
|
||||
this.mask.measurable = false;
|
||||
}
|
||||
reset() {
|
||||
this.mask.measurable = true;
|
||||
this.mask.includeInBuild = true;
|
||||
this.mask = null;
|
||||
}
|
||||
addBounds(bounds, skipUpdateTransform) {
|
||||
addMaskBounds(this.mask, bounds, skipUpdateTransform);
|
||||
}
|
||||
addLocalBounds(bounds, localRoot) {
|
||||
addMaskLocalBounds(this.mask, bounds, localRoot);
|
||||
}
|
||||
containsPoint(point, hitTestFn) {
|
||||
const mask = this.mask;
|
||||
return hitTestFn(mask, point);
|
||||
}
|
||||
destroy() {
|
||||
this.reset();
|
||||
}
|
||||
static test(mask) {
|
||||
return mask instanceof Container;
|
||||
}
|
||||
}
|
||||
StencilMask.extension = ExtensionType.MaskEffect;
|
||||
|
||||
export { StencilMask };
|
||||
//# sourceMappingURL=StencilMask.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"StencilMask.mjs","sources":["../../../../src/rendering/mask/stencil/StencilMask.ts"],"sourcesContent":["import { ExtensionType } from '../../../extensions/Extensions';\nimport { Container } from '../../../scene/container/Container';\nimport { addMaskBounds } from '../utils/addMaskBounds';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds';\n\nimport type { ExtensionMetadata } from '../../../extensions/Extensions';\nimport type { Point } from '../../../maths/point/Point';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Effect } from '../../../scene/container/Effect';\nimport type { PoolItem } from '../../../utils/pool/Pool';\n\nexport class StencilMask implements Effect, PoolItem\n{\n public static extension: ExtensionMetadata = ExtensionType.MaskEffect;\n\n public priority = 0;\n public mask: Container;\n public pipe = 'stencilMask';\n\n constructor(options: {mask: Container})\n {\n if (options?.mask)\n {\n this.init(options.mask);\n }\n }\n\n public init(mask: Container): void\n {\n this.mask = mask;\n this.mask.includeInBuild = false;\n this.mask.measurable = false;\n }\n\n public reset()\n {\n this.mask.measurable = true;\n this.mask.includeInBuild = true;\n this.mask = null;\n }\n\n public addBounds(bounds: Bounds, skipUpdateTransform: boolean): void\n {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n\n public addLocalBounds(bounds: Bounds, localRoot: Container): void\n {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n\n public containsPoint(point: Point, hitTestFn: (container: Container, point: Point) => boolean): boolean\n {\n const mask = this.mask as any;\n\n // if the point is in the mask, yay!\n return hitTestFn(mask, point);\n }\n\n public destroy(): void\n {\n this.reset();\n }\n\n public static test(mask: any): boolean\n {\n return mask instanceof Container;\n }\n}\n"],"names":[],"mappings":";;;;;;AAWO,MAAM,WACb,CAAA;AAAA,EAOI,YAAY,OACZ,EAAA;AALA,IAAA,IAAA,CAAO,QAAW,GAAA,CAAA,CAAA;AAElB,IAAA,IAAA,CAAO,IAAO,GAAA,aAAA,CAAA;AAIV,IAAA,IAAI,SAAS,IACb,EAAA;AACI,MAAK,IAAA,CAAA,IAAA,CAAK,QAAQ,IAAI,CAAA,CAAA;AAAA,KAC1B;AAAA,GACJ;AAAA,EAEO,KAAK,IACZ,EAAA;AACI,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AACZ,IAAA,IAAA,CAAK,KAAK,cAAiB,GAAA,KAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,KAAA,CAAA;AAAA,GAC3B;AAAA,EAEO,KACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAK,UAAa,GAAA,IAAA,CAAA;AACvB,IAAA,IAAA,CAAK,KAAK,cAAiB,GAAA,IAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEO,SAAA,CAAU,QAAgB,mBACjC,EAAA;AACI,IAAc,aAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,mBAAmB,CAAA,CAAA;AAAA,GACxD;AAAA,EAEO,cAAA,CAAe,QAAgB,SACtC,EAAA;AACI,IAAmB,kBAAA,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,EAAQ,SAAS,CAAA,CAAA;AAAA,GACnD;AAAA,EAEO,aAAA,CAAc,OAAc,SACnC,EAAA;AACI,IAAA,MAAM,OAAO,IAAK,CAAA,IAAA,CAAA;AAGlB,IAAO,OAAA,SAAA,CAAU,MAAM,KAAK,CAAA,CAAA;AAAA,GAChC;AAAA,EAEO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,KAAM,EAAA,CAAA;AAAA,GACf;AAAA,EAEA,OAAc,KAAK,IACnB,EAAA;AACI,IAAA,OAAO,IAAgB,YAAA,SAAA,CAAA;AAAA,GAC3B;AACJ,CAAA;AAzDa,WAAA,CAEK,YAA+B,aAAc,CAAA,UAAA;;;;"}
|
29
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.d.ts
generated
vendored
Normal file
29
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions';
|
||||
import type { Container } from '../../../scene/container/Container';
|
||||
import type { Effect } from '../../../scene/container/Effect';
|
||||
import type { Instruction } from '../../renderers/shared/instructions/Instruction';
|
||||
import type { InstructionSet } from '../../renderers/shared/instructions/InstructionSet';
|
||||
import type { InstructionPipe } from '../../renderers/shared/instructions/RenderPipe';
|
||||
import type { Renderer } from '../../renderers/types';
|
||||
import type { StencilMask } from './StencilMask';
|
||||
type MaskMode = 'pushMaskBegin' | 'pushMaskEnd' | 'popMaskBegin' | 'popMaskEnd';
|
||||
export interface StencilMaskInstruction extends Instruction {
|
||||
renderPipeId: 'stencilMask';
|
||||
action: MaskMode;
|
||||
mask: StencilMask;
|
||||
}
|
||||
export declare class StencilMaskPipe implements InstructionPipe<StencilMaskInstruction> {
|
||||
static extension: {
|
||||
readonly type: readonly [ExtensionType.WebGLPipes, ExtensionType.WebGPUPipes, ExtensionType.CanvasPipes];
|
||||
readonly name: "stencilMask";
|
||||
};
|
||||
private _renderer;
|
||||
private _maskStackHash;
|
||||
private _maskHash;
|
||||
constructor(renderer: Renderer);
|
||||
push(mask: Effect, _container: Container, instructionSet: InstructionSet): void;
|
||||
pop(mask: Effect, _container: Container, instructionSet: InstructionSet): void;
|
||||
execute(instruction: StencilMaskInstruction): void;
|
||||
destroy(): void;
|
||||
}
|
||||
export {};
|
120
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.js
generated
vendored
Normal file
120
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../../extensions/Extensions.js');
|
||||
var buildInstructions = require('../../../scene/container/utils/buildInstructions.js');
|
||||
var _const$1 = require('../../renderers/gl/const.js');
|
||||
var _const = require('../../renderers/shared/state/const.js');
|
||||
|
||||
"use strict";
|
||||
class StencilMaskPipe {
|
||||
constructor(renderer) {
|
||||
// used when building and also when executing..
|
||||
this._maskStackHash = {};
|
||||
this._maskHash = /* @__PURE__ */ new WeakMap();
|
||||
this._renderer = renderer;
|
||||
}
|
||||
push(mask, _container, instructionSet) {
|
||||
var _a;
|
||||
const effect = mask;
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "pushMaskBegin",
|
||||
mask,
|
||||
canBundle: false
|
||||
});
|
||||
const maskContainer = effect.mask;
|
||||
maskContainer.includeInBuild = true;
|
||||
if (!this._maskHash.has(effect)) {
|
||||
this._maskHash.set(effect, {
|
||||
instructionsStart: 0,
|
||||
instructionsLength: 0
|
||||
});
|
||||
}
|
||||
const maskData = this._maskHash.get(effect);
|
||||
maskData.instructionsStart = instructionSet.instructionSize;
|
||||
buildInstructions.collectAllRenderables(
|
||||
maskContainer,
|
||||
instructionSet,
|
||||
renderer
|
||||
);
|
||||
maskContainer.includeInBuild = false;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "pushMaskEnd",
|
||||
mask,
|
||||
canBundle: false
|
||||
});
|
||||
const instructionsLength = instructionSet.instructionSize - maskData.instructionsStart - 1;
|
||||
maskData.instructionsLength = instructionsLength;
|
||||
const renderTargetUid = renderer.renderTarget.renderTarget.uid;
|
||||
(_a = this._maskStackHash)[renderTargetUid] ?? (_a[renderTargetUid] = 0);
|
||||
}
|
||||
pop(mask, _container, instructionSet) {
|
||||
const effect = mask;
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "popMaskBegin",
|
||||
canBundle: false
|
||||
});
|
||||
const maskData = this._maskHash.get(mask);
|
||||
for (let i = 0; i < maskData.instructionsLength; i++) {
|
||||
instructionSet.instructions[instructionSet.instructionSize++] = instructionSet.instructions[maskData.instructionsStart++];
|
||||
}
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "popMaskEnd",
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
execute(instruction) {
|
||||
var _a;
|
||||
const renderer = this._renderer;
|
||||
const renderTargetUid = renderer.renderTarget.renderTarget.uid;
|
||||
let maskStackIndex = (_a = this._maskStackHash)[renderTargetUid] ?? (_a[renderTargetUid] = 0);
|
||||
if (instruction.action === "pushMaskBegin") {
|
||||
renderer.renderTarget.ensureDepthStencil();
|
||||
renderer.stencil.setStencilMode(_const.STENCIL_MODES.RENDERING_MASK_ADD, maskStackIndex);
|
||||
maskStackIndex++;
|
||||
renderer.colorMask.setMask(0);
|
||||
} else if (instruction.action === "pushMaskEnd") {
|
||||
renderer.stencil.setStencilMode(_const.STENCIL_MODES.MASK_ACTIVE, maskStackIndex);
|
||||
renderer.colorMask.setMask(15);
|
||||
} else if (instruction.action === "popMaskBegin") {
|
||||
renderer.colorMask.setMask(0);
|
||||
if (maskStackIndex !== 0) {
|
||||
renderer.stencil.setStencilMode(_const.STENCIL_MODES.RENDERING_MASK_REMOVE, maskStackIndex);
|
||||
} else {
|
||||
renderer.renderTarget.clear(null, _const$1.CLEAR.STENCIL);
|
||||
renderer.stencil.setStencilMode(_const.STENCIL_MODES.DISABLED, maskStackIndex);
|
||||
}
|
||||
maskStackIndex--;
|
||||
} else if (instruction.action === "popMaskEnd") {
|
||||
renderer.stencil.setStencilMode(_const.STENCIL_MODES.MASK_ACTIVE, maskStackIndex);
|
||||
renderer.colorMask.setMask(15);
|
||||
}
|
||||
this._maskStackHash[renderTargetUid] = maskStackIndex;
|
||||
}
|
||||
destroy() {
|
||||
this._renderer = null;
|
||||
this._maskStackHash = null;
|
||||
this._maskHash = null;
|
||||
}
|
||||
}
|
||||
StencilMaskPipe.extension = {
|
||||
type: [
|
||||
Extensions.ExtensionType.WebGLPipes,
|
||||
Extensions.ExtensionType.WebGPUPipes,
|
||||
Extensions.ExtensionType.CanvasPipes
|
||||
],
|
||||
name: "stencilMask"
|
||||
};
|
||||
|
||||
exports.StencilMaskPipe = StencilMaskPipe;
|
||||
//# sourceMappingURL=StencilMaskPipe.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
118
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.mjs
generated
vendored
Normal file
118
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.mjs
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions.mjs';
|
||||
import { collectAllRenderables } from '../../../scene/container/utils/buildInstructions.mjs';
|
||||
import { CLEAR } from '../../renderers/gl/const.mjs';
|
||||
import { STENCIL_MODES } from '../../renderers/shared/state/const.mjs';
|
||||
|
||||
"use strict";
|
||||
class StencilMaskPipe {
|
||||
constructor(renderer) {
|
||||
// used when building and also when executing..
|
||||
this._maskStackHash = {};
|
||||
this._maskHash = /* @__PURE__ */ new WeakMap();
|
||||
this._renderer = renderer;
|
||||
}
|
||||
push(mask, _container, instructionSet) {
|
||||
var _a;
|
||||
const effect = mask;
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "pushMaskBegin",
|
||||
mask,
|
||||
canBundle: false
|
||||
});
|
||||
const maskContainer = effect.mask;
|
||||
maskContainer.includeInBuild = true;
|
||||
if (!this._maskHash.has(effect)) {
|
||||
this._maskHash.set(effect, {
|
||||
instructionsStart: 0,
|
||||
instructionsLength: 0
|
||||
});
|
||||
}
|
||||
const maskData = this._maskHash.get(effect);
|
||||
maskData.instructionsStart = instructionSet.instructionSize;
|
||||
collectAllRenderables(
|
||||
maskContainer,
|
||||
instructionSet,
|
||||
renderer
|
||||
);
|
||||
maskContainer.includeInBuild = false;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "pushMaskEnd",
|
||||
mask,
|
||||
canBundle: false
|
||||
});
|
||||
const instructionsLength = instructionSet.instructionSize - maskData.instructionsStart - 1;
|
||||
maskData.instructionsLength = instructionsLength;
|
||||
const renderTargetUid = renderer.renderTarget.renderTarget.uid;
|
||||
(_a = this._maskStackHash)[renderTargetUid] ?? (_a[renderTargetUid] = 0);
|
||||
}
|
||||
pop(mask, _container, instructionSet) {
|
||||
const effect = mask;
|
||||
const renderer = this._renderer;
|
||||
renderer.renderPipes.batch.break(instructionSet);
|
||||
renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet);
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "popMaskBegin",
|
||||
canBundle: false
|
||||
});
|
||||
const maskData = this._maskHash.get(mask);
|
||||
for (let i = 0; i < maskData.instructionsLength; i++) {
|
||||
instructionSet.instructions[instructionSet.instructionSize++] = instructionSet.instructions[maskData.instructionsStart++];
|
||||
}
|
||||
instructionSet.add({
|
||||
renderPipeId: "stencilMask",
|
||||
action: "popMaskEnd",
|
||||
canBundle: false
|
||||
});
|
||||
}
|
||||
execute(instruction) {
|
||||
var _a;
|
||||
const renderer = this._renderer;
|
||||
const renderTargetUid = renderer.renderTarget.renderTarget.uid;
|
||||
let maskStackIndex = (_a = this._maskStackHash)[renderTargetUid] ?? (_a[renderTargetUid] = 0);
|
||||
if (instruction.action === "pushMaskBegin") {
|
||||
renderer.renderTarget.ensureDepthStencil();
|
||||
renderer.stencil.setStencilMode(STENCIL_MODES.RENDERING_MASK_ADD, maskStackIndex);
|
||||
maskStackIndex++;
|
||||
renderer.colorMask.setMask(0);
|
||||
} else if (instruction.action === "pushMaskEnd") {
|
||||
renderer.stencil.setStencilMode(STENCIL_MODES.MASK_ACTIVE, maskStackIndex);
|
||||
renderer.colorMask.setMask(15);
|
||||
} else if (instruction.action === "popMaskBegin") {
|
||||
renderer.colorMask.setMask(0);
|
||||
if (maskStackIndex !== 0) {
|
||||
renderer.stencil.setStencilMode(STENCIL_MODES.RENDERING_MASK_REMOVE, maskStackIndex);
|
||||
} else {
|
||||
renderer.renderTarget.clear(null, CLEAR.STENCIL);
|
||||
renderer.stencil.setStencilMode(STENCIL_MODES.DISABLED, maskStackIndex);
|
||||
}
|
||||
maskStackIndex--;
|
||||
} else if (instruction.action === "popMaskEnd") {
|
||||
renderer.stencil.setStencilMode(STENCIL_MODES.MASK_ACTIVE, maskStackIndex);
|
||||
renderer.colorMask.setMask(15);
|
||||
}
|
||||
this._maskStackHash[renderTargetUid] = maskStackIndex;
|
||||
}
|
||||
destroy() {
|
||||
this._renderer = null;
|
||||
this._maskStackHash = null;
|
||||
this._maskHash = null;
|
||||
}
|
||||
}
|
||||
StencilMaskPipe.extension = {
|
||||
type: [
|
||||
ExtensionType.WebGLPipes,
|
||||
ExtensionType.WebGPUPipes,
|
||||
ExtensionType.CanvasPipes
|
||||
],
|
||||
name: "stencilMask"
|
||||
};
|
||||
|
||||
export { StencilMaskPipe };
|
||||
//# sourceMappingURL=StencilMaskPipe.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.d.ts
generated
vendored
Normal file
3
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { Bounds } from '../../../scene/container/bounds/Bounds';
|
||||
import type { Container } from '../../../scene/container/Container';
|
||||
export declare function addMaskBounds(mask: Container, bounds: Bounds, skipUpdateTransform: boolean): void;
|
17
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.js
generated
vendored
Normal file
17
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var Bounds = require('../../../scene/container/bounds/Bounds.js');
|
||||
var getGlobalBounds = require('../../../scene/container/bounds/getGlobalBounds.js');
|
||||
|
||||
"use strict";
|
||||
const tempBounds = new Bounds.Bounds();
|
||||
function addMaskBounds(mask, bounds, skipUpdateTransform) {
|
||||
const boundsToMask = tempBounds;
|
||||
mask.measurable = true;
|
||||
getGlobalBounds.getGlobalBounds(mask, skipUpdateTransform, boundsToMask);
|
||||
bounds.addBoundsMask(boundsToMask);
|
||||
mask.measurable = false;
|
||||
}
|
||||
|
||||
exports.addMaskBounds = addMaskBounds;
|
||||
//# sourceMappingURL=addMaskBounds.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"addMaskBounds.js","sources":["../../../../src/rendering/mask/utils/addMaskBounds.ts"],"sourcesContent":["import { Bounds } from '../../../scene/container/bounds/Bounds';\nimport { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds';\n\nimport type { Container } from '../../../scene/container/Container';\n\nconst tempBounds = new Bounds();\n\nexport function addMaskBounds(mask: Container, bounds: Bounds, skipUpdateTransform: boolean): void\n{\n const boundsToMask = tempBounds;\n\n mask.measurable = true;\n\n getGlobalBounds(mask, skipUpdateTransform, boundsToMask);\n\n bounds.addBoundsMask(boundsToMask);\n\n mask.measurable = false;\n}\n\n"],"names":["Bounds","getGlobalBounds"],"mappings":";;;;;;AAKA,MAAM,UAAA,GAAa,IAAIA,aAAO,EAAA,CAAA;AAEd,SAAA,aAAA,CAAc,IAAiB,EAAA,MAAA,EAAgB,mBAC/D,EAAA;AACI,EAAA,MAAM,YAAe,GAAA,UAAA,CAAA;AAErB,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAgBC,+BAAA,CAAA,IAAA,EAAM,qBAAqB,YAAY,CAAA,CAAA;AAEvD,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AACtB;;;;"}
|
15
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.mjs
generated
vendored
Normal file
15
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.mjs
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Bounds } from '../../../scene/container/bounds/Bounds.mjs';
|
||||
import { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds.mjs';
|
||||
|
||||
"use strict";
|
||||
const tempBounds = new Bounds();
|
||||
function addMaskBounds(mask, bounds, skipUpdateTransform) {
|
||||
const boundsToMask = tempBounds;
|
||||
mask.measurable = true;
|
||||
getGlobalBounds(mask, skipUpdateTransform, boundsToMask);
|
||||
bounds.addBoundsMask(boundsToMask);
|
||||
mask.measurable = false;
|
||||
}
|
||||
|
||||
export { addMaskBounds };
|
||||
//# sourceMappingURL=addMaskBounds.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"addMaskBounds.mjs","sources":["../../../../src/rendering/mask/utils/addMaskBounds.ts"],"sourcesContent":["import { Bounds } from '../../../scene/container/bounds/Bounds';\nimport { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds';\n\nimport type { Container } from '../../../scene/container/Container';\n\nconst tempBounds = new Bounds();\n\nexport function addMaskBounds(mask: Container, bounds: Bounds, skipUpdateTransform: boolean): void\n{\n const boundsToMask = tempBounds;\n\n mask.measurable = true;\n\n getGlobalBounds(mask, skipUpdateTransform, boundsToMask);\n\n bounds.addBoundsMask(boundsToMask);\n\n mask.measurable = false;\n}\n\n"],"names":[],"mappings":";;;;AAKA,MAAM,UAAA,GAAa,IAAI,MAAO,EAAA,CAAA;AAEd,SAAA,aAAA,CAAc,IAAiB,EAAA,MAAA,EAAgB,mBAC/D,EAAA;AACI,EAAA,MAAM,YAAe,GAAA,UAAA,CAAA;AAErB,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAgB,eAAA,CAAA,IAAA,EAAM,qBAAqB,YAAY,CAAA,CAAA;AAEvD,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AACtB;;;;"}
|
5
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.d.ts
generated
vendored
Normal file
5
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { Matrix } from '../../../maths/matrix/Matrix';
|
||||
import type { Bounds } from '../../../scene/container/bounds/Bounds';
|
||||
import type { Container } from '../../../scene/container/Container';
|
||||
export declare function addMaskLocalBounds(mask: Container, bounds: Bounds, localRoot: Container): void;
|
||||
export declare function getMatrixRelativeToParent(target: Container, root: Container, matrix: Matrix): Matrix;
|
34
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.js
generated
vendored
Normal file
34
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
|
||||
var getLocalBounds = require('../../../scene/container/bounds/getLocalBounds.js');
|
||||
var matrixAndBoundsPool = require('../../../scene/container/bounds/utils/matrixAndBoundsPool.js');
|
||||
var warn = require('../../../utils/logging/warn.js');
|
||||
|
||||
"use strict";
|
||||
function addMaskLocalBounds(mask, bounds, localRoot) {
|
||||
const boundsToMask = matrixAndBoundsPool.boundsPool.get();
|
||||
mask.measurable = true;
|
||||
const tempMatrix = matrixAndBoundsPool.matrixPool.get().identity();
|
||||
const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);
|
||||
getLocalBounds.getLocalBounds(mask, boundsToMask, relativeMask);
|
||||
mask.measurable = false;
|
||||
bounds.addBoundsMask(boundsToMask);
|
||||
matrixAndBoundsPool.matrixPool.return(tempMatrix);
|
||||
matrixAndBoundsPool.boundsPool.return(boundsToMask);
|
||||
}
|
||||
function getMatrixRelativeToParent(target, root, matrix) {
|
||||
if (!target) {
|
||||
warn.warn("Mask bounds, renderable is not inside the root container");
|
||||
return matrix;
|
||||
}
|
||||
if (target !== root) {
|
||||
getMatrixRelativeToParent(target.parent, root, matrix);
|
||||
target.updateLocalTransform();
|
||||
matrix.append(target.localTransform);
|
||||
}
|
||||
return matrix;
|
||||
}
|
||||
|
||||
exports.addMaskLocalBounds = addMaskLocalBounds;
|
||||
exports.getMatrixRelativeToParent = getMatrixRelativeToParent;
|
||||
//# sourceMappingURL=addMaskLocalBounds.js.map
|
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"addMaskLocalBounds.js","sources":["../../../../src/rendering/mask/utils/addMaskLocalBounds.ts"],"sourcesContent":["import { getLocalBounds } from '../../../scene/container/bounds/getLocalBounds';\nimport { boundsPool, matrixPool } from '../../../scene/container/bounds/utils/matrixAndBoundsPool';\nimport { warn } from '../../../utils/logging/warn';\n\nimport type { Matrix } from '../../../maths/matrix/Matrix';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\n\nexport function addMaskLocalBounds(mask: Container, bounds: Bounds, localRoot: Container): void\n{\n const boundsToMask = boundsPool.get();\n\n mask.measurable = true;\n\n const tempMatrix = matrixPool.get().identity();\n\n const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);\n\n getLocalBounds(mask, boundsToMask, relativeMask);\n\n mask.measurable = false;\n\n bounds.addBoundsMask(boundsToMask);\n\n matrixPool.return(tempMatrix);\n boundsPool.return(boundsToMask);\n}\n\nexport function getMatrixRelativeToParent(target: Container, root: Container, matrix: Matrix): Matrix\n{\n if (!target)\n {\n // we have reach the top of the tree!\n // #if _DEBUG\n warn('Mask bounds, renderable is not inside the root container');\n // #endif\n\n return matrix;\n }\n\n if (target !== root)\n {\n getMatrixRelativeToParent(target.parent, root, matrix);\n\n target.updateLocalTransform();\n\n matrix.append(target.localTransform);\n }\n\n return matrix;\n}\n"],"names":["boundsPool","matrixPool","getLocalBounds","warn"],"mappings":";;;;;;;AAQgB,SAAA,kBAAA,CAAmB,IAAiB,EAAA,MAAA,EAAgB,SACpE,EAAA;AACI,EAAM,MAAA,YAAA,GAAeA,+BAAW,GAAI,EAAA,CAAA;AAEpC,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAA,MAAM,UAAa,GAAAC,8BAAA,CAAW,GAAI,EAAA,CAAE,QAAS,EAAA,CAAA;AAE7C,EAAA,MAAM,YAAe,GAAA,yBAAA,CAA0B,IAAM,EAAA,SAAA,EAAW,UAAU,CAAA,CAAA;AAE1E,EAAeC,6BAAA,CAAA,IAAA,EAAM,cAAc,YAAY,CAAA,CAAA;AAE/C,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AAElB,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAAD,8BAAA,CAAW,OAAO,UAAU,CAAA,CAAA;AAC5B,EAAAD,8BAAA,CAAW,OAAO,YAAY,CAAA,CAAA;AAClC,CAAA;AAEgB,SAAA,yBAAA,CAA0B,MAAmB,EAAA,IAAA,EAAiB,MAC9E,EAAA;AACI,EAAA,IAAI,CAAC,MACL,EAAA;AAGI,IAAAG,SAAA,CAAK,0DAA0D,CAAA,CAAA;AAG/D,IAAO,OAAA,MAAA,CAAA;AAAA,GACX;AAEA,EAAA,IAAI,WAAW,IACf,EAAA;AACI,IAA0B,yBAAA,CAAA,MAAA,CAAO,MAAQ,EAAA,IAAA,EAAM,MAAM,CAAA,CAAA;AAErD,IAAA,MAAA,CAAO,oBAAqB,EAAA,CAAA;AAE5B,IAAO,MAAA,CAAA,MAAA,CAAO,OAAO,cAAc,CAAA,CAAA;AAAA,GACvC;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;;"}
|
31
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.mjs
generated
vendored
Normal file
31
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.mjs
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import { getLocalBounds } from '../../../scene/container/bounds/getLocalBounds.mjs';
|
||||
import { boundsPool, matrixPool } from '../../../scene/container/bounds/utils/matrixAndBoundsPool.mjs';
|
||||
import { warn } from '../../../utils/logging/warn.mjs';
|
||||
|
||||
"use strict";
|
||||
function addMaskLocalBounds(mask, bounds, localRoot) {
|
||||
const boundsToMask = boundsPool.get();
|
||||
mask.measurable = true;
|
||||
const tempMatrix = matrixPool.get().identity();
|
||||
const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);
|
||||
getLocalBounds(mask, boundsToMask, relativeMask);
|
||||
mask.measurable = false;
|
||||
bounds.addBoundsMask(boundsToMask);
|
||||
matrixPool.return(tempMatrix);
|
||||
boundsPool.return(boundsToMask);
|
||||
}
|
||||
function getMatrixRelativeToParent(target, root, matrix) {
|
||||
if (!target) {
|
||||
warn("Mask bounds, renderable is not inside the root container");
|
||||
return matrix;
|
||||
}
|
||||
if (target !== root) {
|
||||
getMatrixRelativeToParent(target.parent, root, matrix);
|
||||
target.updateLocalTransform();
|
||||
matrix.append(target.localTransform);
|
||||
}
|
||||
return matrix;
|
||||
}
|
||||
|
||||
export { addMaskLocalBounds, getMatrixRelativeToParent };
|
||||
//# sourceMappingURL=addMaskLocalBounds.mjs.map
|
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"addMaskLocalBounds.mjs","sources":["../../../../src/rendering/mask/utils/addMaskLocalBounds.ts"],"sourcesContent":["import { getLocalBounds } from '../../../scene/container/bounds/getLocalBounds';\nimport { boundsPool, matrixPool } from '../../../scene/container/bounds/utils/matrixAndBoundsPool';\nimport { warn } from '../../../utils/logging/warn';\n\nimport type { Matrix } from '../../../maths/matrix/Matrix';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\n\nexport function addMaskLocalBounds(mask: Container, bounds: Bounds, localRoot: Container): void\n{\n const boundsToMask = boundsPool.get();\n\n mask.measurable = true;\n\n const tempMatrix = matrixPool.get().identity();\n\n const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);\n\n getLocalBounds(mask, boundsToMask, relativeMask);\n\n mask.measurable = false;\n\n bounds.addBoundsMask(boundsToMask);\n\n matrixPool.return(tempMatrix);\n boundsPool.return(boundsToMask);\n}\n\nexport function getMatrixRelativeToParent(target: Container, root: Container, matrix: Matrix): Matrix\n{\n if (!target)\n {\n // we have reach the top of the tree!\n // #if _DEBUG\n warn('Mask bounds, renderable is not inside the root container');\n // #endif\n\n return matrix;\n }\n\n if (target !== root)\n {\n getMatrixRelativeToParent(target.parent, root, matrix);\n\n target.updateLocalTransform();\n\n matrix.append(target.localTransform);\n }\n\n return matrix;\n}\n"],"names":[],"mappings":";;;;;AAQgB,SAAA,kBAAA,CAAmB,IAAiB,EAAA,MAAA,EAAgB,SACpE,EAAA;AACI,EAAM,MAAA,YAAA,GAAe,WAAW,GAAI,EAAA,CAAA;AAEpC,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAA,MAAM,UAAa,GAAA,UAAA,CAAW,GAAI,EAAA,CAAE,QAAS,EAAA,CAAA;AAE7C,EAAA,MAAM,YAAe,GAAA,yBAAA,CAA0B,IAAM,EAAA,SAAA,EAAW,UAAU,CAAA,CAAA;AAE1E,EAAe,cAAA,CAAA,IAAA,EAAM,cAAc,YAAY,CAAA,CAAA;AAE/C,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AAElB,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAA,UAAA,CAAW,OAAO,UAAU,CAAA,CAAA;AAC5B,EAAA,UAAA,CAAW,OAAO,YAAY,CAAA,CAAA;AAClC,CAAA;AAEgB,SAAA,yBAAA,CAA0B,MAAmB,EAAA,IAAA,EAAiB,MAC9E,EAAA;AACI,EAAA,IAAI,CAAC,MACL,EAAA;AAGI,IAAA,IAAA,CAAK,0DAA0D,CAAA,CAAA;AAG/D,IAAO,OAAA,MAAA,CAAA;AAAA,GACX;AAEA,EAAA,IAAI,WAAW,IACf,EAAA;AACI,IAA0B,yBAAA,CAAA,MAAA,CAAO,MAAQ,EAAA,IAAA,EAAM,MAAM,CAAA,CAAA;AAErD,IAAA,MAAA,CAAO,oBAAqB,EAAA,CAAA;AAE5B,IAAO,MAAA,CAAA,MAAA,CAAO,OAAO,cAAc,CAAA,CAAA;AAAA,GACvC;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}
|
Reference in New Issue
Block a user