-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
chore: simplify text systems #11345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: simplify text systems #11345
Conversation
… rendering - Removed the `_getKey` method from `AbstractText` and related texture management logic from `CanvasTextSystem`, `CanvasTextPipe`, and `HTMLTextPipe`. - Updated texture retrieval methods to use promises for better async handling. - Cleaned up tests to reflect changes in texture management and ensure proper rendering of HTML text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies the text systems by removing the legacy reference-counting logic and the _getKey method, and by shifting texture retrieval to a promise‐based flow.
- Removed redundant texture key management and reference counting in AbstractText and related systems.
- Updated the CanvasTextPipe, CanvasTextSystem, HTMLTextSystem, and HTMLTextPipe to use simplified texture methods.
- Adjusted tests and style modules accordingly to reflect these changes.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/scene/text/canvas/CanvasTextPipe.ts | Removed currentKey and updated texture handling logic. |
src/scene/text/canvas/CanvasTextSystem.ts | Removed reference count methods and cleaned up texture returns. |
src/scene/text-html/HTMLTextSystem.ts | Switched texture management to promise‐based retrieval. |
tests/visual/scenes/text/html-text-loaded-font.scene.ts | Changed texture call from getTexture to getTexturePromise. |
src/scene/text/tests/Text.test.ts | Updated test to use the new getTexture method for consistency. |
src/scene/text/canvas/CanvasTextMetrics.ts | Removed caching of measurement results. |
src/scene/text-html/HTMLTextStyle.ts | Removed custom key generation to simplify text styles. |
tests/visual/scenes/text/html-text.scene.ts | Updated texture call from getTexture to getTexturePromise. |
src/scene/text/AbstractText.ts | Removed the _getKey method to streamline texture handling. |
src/scene/text-html/HTMLTextPipe.ts | Updated texture promise handling and removed legacy key checks. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 04bdbfb:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✂️✂️✂️✂️✂️✂️✂️✂️✂️
Description of change
Removed a chunk of code for text to simlify things a bit. Rather than ref count text textures, we just have one texture for one Text. This keeps things much simpler especially as generally text is rarely the same in real life.
This step also paves the way for further simplification PR and removal of the need for renderableGCSystem.
_getKey
method fromAbstractText
and related texture management logic fromCanvasTextSystem
,CanvasTextPipe
, andHTMLTextPipe
.Pre-Merge Checklist
npm run lint
)npm run test
)