Draw on canvas from within C++ XPCOM code

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Draw on canvas from within C++ XPCOM code

gpeetonn
Hi there!

Is it possible to draw on <canvas> element from C++ XPCOM add-on?
Previously (long time ago probably) one could get an object of nsIDOMCanvasRenderingContext2D interface and use ti's method PutImageData_explicit in order to draw image on canvas. Nowadays, nsIDOMCanvasRenderingContext2D hides everything and I have no clue how to achieve this.

Any advice will be appreciated.
Thank you
_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Draw on canvas from within C++ XPCOM code

Boris Zbarsky
On 8/19/13 5:25 PM, [hidden email] wrote:
> Is it possible to draw on <canvas> element from C++ XPCOM add-on?

Not easily.

Note that the correct behavior of most of the canvas methods is very
JS-specific (e.g. the JS bindings are what handle non-finite float
arguments).  There are some methods that might be usable from C++, but
they're not that common.

Please do file bugs on exposing a sane C++ canvas API as needed.

-Boris
_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Loading...