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

Fix material caching for canvases #2843

Closed
wants to merge 1 commit into from
Closed

Conversation

mramato
Copy link
Contributor

@mramato mramato commented Jun 29, 2015

Cesium would incorrectly use an HTMLCanvasElement as the key to the Material texture cache dictionary. This means that if you had multiple canvas-based materials, we would only ever use the first one that was added (because the cache lookup would always succeed even if the canvases were difference).

This change uses toDataURL to store canvas elements in the cache. This is sub-optimal since toDataURL is slow and also creates huge string, but the best we can do in the short term. We need a good overlal long term strategy for dealing with canvases, but that's outside the scope of this PR.

Fixes #2821

Cesium would incorrectly use an HTMLCanvasElement as the key to the Material
texture cache dictionary.  This means that if you had multiple canvas-based
materials, we would only ever use the first one that was added (because
the cache lookup would always succeed even if the canvases were difference).

This change uses toDataURL to store canvas elements in the cache.  This
is sub-optimal since toDataURL is slow and also creates huge string,
but the best we can do in the short term.  We need a good overlal long
term strategy for dealing with canvases, but that's outside the scope of
this PR.
@mramato
Copy link
Contributor Author

mramato commented Jun 30, 2015

Superseded by #2850

@mramato mramato closed this Jun 30, 2015
@mramato mramato deleted the fix-canvas-material-caching branch June 30, 2015 14:18
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.

1 participant