Skip to content

Conversation

GoodBoyDigital
Copy link
Member

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.

  • 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.
Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

… 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.
Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link

codesandbox-ci bot commented Mar 21, 2025

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:

Sandbox Source
pixi.js-sandbox Configuration

Copy link
Member

@bigtimebuddy bigtimebuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️✂️✂️✂️✂️✂️✂️✂️✂️

@Zyie Zyie added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label May 4, 2025
@Zyie Zyie added this pull request to the merge queue May 4, 2025
Merged via the queue into dev with commit 7602157 May 4, 2025
5 checks passed
@Zyie Zyie deleted the chore/text-simplify branch May 4, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants