@taole/giftstage 0.1.32 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +636 -621
- package/dist/core/post-animator.d.ts +1 -0
- package/dist/core/render-manager.d.ts +17 -4
- package/dist/gift-stage.cjs.js +32 -32
- package/dist/gift-stage.es.js +2129 -1938
- package/dist/gpu/webgl1-backend.d.ts +3 -1
- package/dist/gpu/webgl2-backend.d.ts +3 -1
- package/dist/gpu/webgpu-backend.d.ts +7 -2
- package/dist/renderers/alpha-video-renderer.d.ts +1 -0
- package/dist/renderers/svga-batch-renderer.d.ts +4 -0
- package/dist/renderers/vap-renderer.d.ts +1 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/utils/html-video-upload-gate.d.ts +5 -0
- package/dist/utils/resource-cache.d.ts +46 -0
- package/package.json +4 -1
|
@@ -33,6 +33,7 @@ export declare class PostAnimator {
|
|
|
33
33
|
applyAnimatedState(slot: GiftSlot, now: number): boolean;
|
|
34
34
|
hasAnimation(giftId: string): boolean;
|
|
35
35
|
hasActiveAnimations(): boolean;
|
|
36
|
+
hasRunningAnimations(): boolean;
|
|
36
37
|
pauseForGift(giftId: string, now?: number): void;
|
|
37
38
|
resumeForGift(giftId: string, now?: number): void;
|
|
38
39
|
pauseAll(now?: number): void;
|
|
@@ -16,10 +16,17 @@ export declare class RenderManager {
|
|
|
16
16
|
private rafId;
|
|
17
17
|
private lastTime;
|
|
18
18
|
private running;
|
|
19
|
+
private globallyPaused;
|
|
19
20
|
private forceNextDraw;
|
|
20
21
|
private readonly onAnimationFrame;
|
|
22
|
+
private readonly onHtmlVideoFrame;
|
|
21
23
|
private readonly finishedSlotIdsScratch;
|
|
22
24
|
private readonly videoRunMapScratch;
|
|
25
|
+
private readonly sortedSlots;
|
|
26
|
+
private readonly visibleSlotsScratch;
|
|
27
|
+
private readonly collapsedLayerScratch;
|
|
28
|
+
private readonly coincidentSeenScratch;
|
|
29
|
+
private readonly drawRunScratch;
|
|
23
30
|
/** Shared WebCodecs RGBA atlas (optional); multiple slots may reference `handle` with distinct `wcAtlasRect`. */
|
|
24
31
|
private wcAtlas;
|
|
25
32
|
/** One-shot logs for WebCodecs clock debugging (filter console by `[GiftStage:WC]`). */
|
|
@@ -47,6 +54,10 @@ export declare class RenderManager {
|
|
|
47
54
|
releaseWebCodecsAtlasAllocation(slotId: string): void;
|
|
48
55
|
/** Re-apply CSS-space options when canvas backing store or layout changes (skips active fly animations). */
|
|
49
56
|
syncSlotLayoutFromOptions(): void;
|
|
57
|
+
invalidate(options?: {
|
|
58
|
+
resetClock?: boolean;
|
|
59
|
+
orderChanged?: boolean;
|
|
60
|
+
}): void;
|
|
50
61
|
private start;
|
|
51
62
|
private stop;
|
|
52
63
|
private clearFrameOnce;
|
|
@@ -77,20 +88,22 @@ export declare class RenderManager {
|
|
|
77
88
|
private onGiftPlayComplete;
|
|
78
89
|
private tickImage;
|
|
79
90
|
private removeFinished;
|
|
80
|
-
/** Reused scratch to avoid a per-frame array allocation; consumed synchronously by getRenderLayers. */
|
|
81
|
-
private orderedSlotsScratch;
|
|
82
91
|
private getRenderOrderedSlots;
|
|
83
|
-
private
|
|
92
|
+
private drawRenderLayers;
|
|
84
93
|
/**
|
|
85
94
|
* Multiple copies of the same gift are often added together before each copy
|
|
86
95
|
* flies to a different target. While their visual state is exactly identical,
|
|
87
96
|
* drawing every copy only increases overdraw and changes translucent pixels.
|
|
88
97
|
* Keep the top-most copy until a transform or frame diverges.
|
|
89
98
|
*/
|
|
90
|
-
|
|
99
|
+
collapseCoincidentVisualDuplicates(layer: GiftSlot[]): GiftSlot[];
|
|
100
|
+
private collapseCoincidentVisualRange;
|
|
91
101
|
private getCoincidentVisualKey;
|
|
92
102
|
private getSVGASlotTextureKey;
|
|
93
103
|
private drawLayer;
|
|
104
|
+
private needsContinuousFrame;
|
|
105
|
+
private insertSortedSlot;
|
|
106
|
+
private static compareSlots;
|
|
94
107
|
private drawSlotRun;
|
|
95
108
|
/** Batch keys are cached on the slot and only rebuilt when their inputs change. */
|
|
96
109
|
private getBatchKey;
|