-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support for canvas elements on quads. #634
Conversation
Rather than using an image, a canvas can be rendered on a quad. On the canvas renderer, after changing the canvas quad, a draw call is sufficient to update it. On the vgl renderer, the texture is cached, so it will take more work to update the texture.
Current coverage is 86.50% (diff: 100%)@@ master #634 diff @@
==========================================
Files 85 85
Lines 8325 8328 +3
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 7201 7204 +3
Misses 1124 1124
Partials 0 0
|
@@ -423,6 +423,7 @@ capabilities[quadFeature.capabilities.image] = true; | |||
capabilities[quadFeature.capabilities.imageCrop] = true; | |||
capabilities[quadFeature.capabilities.imageFixedScale] = false; | |||
capabilities[quadFeature.capabilities.imageFull] = true; | |||
capabilities[quadFeature.capabilities.canvas] = false; |
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.
Do we need this? Can't we state missing key as false?
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.
We don't need it, but I want to explicitly document what capabilities different renderers have rather than implicitly document them.
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.
My only concern is that now we need something similar in canvas version? my slight preference would be not to list canvas in gl and gl in canvas (and what about d3).
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.
This is if we can render a canvas on a quad, not if we can use the canvas renderer.
For instance, we could do this in gl by regenerating the texture whenever the canvas changes, and thus using gl to render the feature. Similarly, for d3, we can convert a canvas to an Image, then render that (super inefficient, but possible).
ah, makes sense. The name was bit confusing. LGTM then. |
Rather than using an image, a canvas can be rendered on a quad. On the canvas renderer, after changing the canvas quad, a draw call is sufficient to update it. On the vgl renderer, the texture is cached, so it will take more work to update the texture.