mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
🆙 Fixed the colorid
This commit is contained in:
@@ -1,34 +1,3 @@
|
||||
/**
|
||||
* Runtime patches for pixi.js v8 batcher edge cases.
|
||||
*
|
||||
* Pixi v8 (through 8.19 at least) has a long-running family of crashes
|
||||
* where `getAdjustedBlendModeBlend(blendMode, textureSource)` is invoked
|
||||
* with a `null` textureSource and throws on `null.alphaMode` or
|
||||
* `null.uid`. We've seen it from at least four call sites:
|
||||
* - Batcher.break() (FilterPipe, StencilMaskPipe, AlphaMaskPipe)
|
||||
* - Batcher.checkAndUpdateTexture() (SpritePipe.validateRenderable)
|
||||
*
|
||||
* The trigger varies, but the symptom is always the same: a single bad
|
||||
* frame inside the catalog room previewer (or anywhere RoomSpriteCanvas
|
||||
* drives Pixi) tanks the whole render loop with an endless cascade of
|
||||
* requestAnimationFrame errors.
|
||||
*
|
||||
* We removed the two custom filters we owned (BlackToAlphaFilter,
|
||||
* PlaneMaskFilter) earlier, but several call sites are inside Pixi
|
||||
* itself or inside renderer-side mask setup that we can't sensibly
|
||||
* delete (RoomSpriteCanvas pins a Sprite mask on the master display to
|
||||
* clip the room to the canvas).
|
||||
*
|
||||
* Patch every known throwing entry point so that when it throws because
|
||||
* of a null textureSource we treat the frame as a no-op instead of
|
||||
* propagating the exception. The visible cost is a missed batch this
|
||||
* tick - the next tick re-renders cleanly. Without this patch the
|
||||
* LayoutRoomPreviewerView safety latch fires permanently on the first
|
||||
* affected offer.
|
||||
*
|
||||
* Importing this module has the side effect of installing the patch
|
||||
* exactly once, idempotent across HMR reloads.
|
||||
*/
|
||||
import * as PIXI from 'pixi.js';
|
||||
|
||||
type AnyFn = (...args: unknown[]) => unknown;
|
||||
@@ -95,9 +64,7 @@ const installPatch = (): void =>
|
||||
const proto = (ctor as { prototype?: MethodHost } | undefined)?.prototype;
|
||||
if(!proto) continue;
|
||||
|
||||
// break() is called during FilterPipe / StencilMaskPipe / AlphaMaskPipe.pop
|
||||
if(guardMethod(proto, 'break', name)) patched = true;
|
||||
// checkAndUpdateTexture() is called during SpritePipe.validateRenderable
|
||||
if(guardMethod(proto, 'checkAndUpdateTexture', name)) patched = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user