Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Draw on canvas from within C++ XPCOM code

32 views
Skip to first unread message

gpee...@gmail.com

unread,
Aug 19, 2013, 5:25:52 PM8/19/13
to
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

Boris Zbarsky

unread,
Aug 20, 2013, 12:51:49 PM8/20/13
to
On 8/19/13 5:25 PM, gpee...@gmail.com 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
0 new messages