Closed liuxi150 closed 4 months ago
The recent updates streamline the AlipayDowngradePlugin
by removing unnecessary properties and methods, simplifying event handling for webglcontextlost
, and adding new functionality to the demo for simulating memory-related WebGL context loss. These changes enhance code efficiency and offer better tools for testing WebGL context behavior.
File Path | Change Summary |
---|---|
plugin-packages/alipay-downgrade/src/alipay-downgrade-plugin.ts |
Removed glLostOccurred property, onPlayerCreated method, and updated processRawJSON logic. |
plugin-packages/alipay-downgrade/src/utils.ts |
Removed unnecessary imports and properties, updated registerEvent for webglcontextlost . |
web-packages/demo/html/context-lost-restore.html |
Added a new button labeled "Lost by memory" to the HTML content. |
web-packages/demo/src/context-lost-restore.ts |
Added new variables, event listeners, and functions for handling WebGL context loss and memory. |
sequenceDiagram
participant User
participant MemoryButton
participant WebGLContext
participant AlipayDowngradePlugin
User->>MemoryButton: Click "Lost by memory"
MemoryButton->>WebGLContext: Trigger memory allocation
WebGLContext->>AlipayDowngradePlugin: webglcontextlost event
AlipayDowngradePlugin-->>User: Notify context lost
User->>WebGLContext: Attempt to restore context
WebGLContext->>AlipayDowngradePlugin: webglcontextrestored event
AlipayDowngradePlugin-->>User: Notify context restored
In code's vast and winding maze,
We found a better, simpler phase.
No more lost in WebGL's night,
With memory clicks, we set it right.
A button press, a context lost,
Then restored, no matter the cost.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Improvements
Bug Fixes