Skip to content
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

HTMLMesh: Reuse <canvas> instance #22098

Merged
merged 2 commits into from
Jul 7, 2021
Merged

HTMLMesh: Reuse <canvas> instance #22098

merged 2 commits into from
Jul 7, 2021

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Jul 7, 2021

Fixes: #22093

Description

Avoid instantiating new <canvas> elements every interacting frame 😬

@mrdoob mrdoob added this to the r131 milestone Jul 7, 2021
@mrdoob mrdoob merged commit 9f71941 into dev Jul 7, 2021
@mrdoob mrdoob deleted the htmlmesh branch July 7, 2021 14:26
@Degubi
Copy link
Contributor

Degubi commented Sep 16, 2022

Hi!
I was looking at HTMLMesh (for absolutely no specific reason)
I noticed that we read from the canvas cache, but we never set anything anywhere?

https://github.com/mrdoob/three.js/blob/dev/examples/jsm/interactive/HTMLMesh.js#L474

We read here, but we never set it in the else branch, I think this might be a mistake
I commented here because it was this PR that added the canvas cache
@mrdoob @Mugen87

@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 16, 2022

Good catch. Indeed, I can't spot a canvases.set( element, canvas ); statement.

Would you be willing to file a PR with the fix?

@Mugen87 Mugen87 restored the htmlmesh branch September 16, 2022 08:18
@Mugen87 Mugen87 deleted the htmlmesh branch September 16, 2022 08:18
@Mugen87 Mugen87 restored the htmlmesh branch September 16, 2022 08:18
@Degubi
Copy link
Contributor

Degubi commented Sep 16, 2022

Sure! #24650

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTMLMesh is creating a lot of canvas objects.
3 participants