I have C++ code running well with XULRunner from 7 up to 11 versions:
nsRefPtr<gfxWindowsSurface> targetSurface = new gfxWindowsSurface(hDC, gfxWindowsSurface::FLAG_FOR_PRINTING);
nsRefPtr<gfxContext> ctx = new gfxContext(targetSurface);
But when I tried to compile it with XULRunner 12 and later, it cause linkage errors:
error LNK2019: unresolved external symbol "public: __thiscall gfxContext::gfxContext(class gfxASurface *)" (??0gfxContext@@QAE@PAVgfxASurface@@@Z)
error LNK2019: unresolved external symbol "public: __thiscall gfxWindowsSurface::gfxWindowsSurface(struct HDC__ *,unsigned int)" (??0gfxWindowsSurface@@QAE@PAUHDC__@@I@Z)
I've make dumpbin for xul.lib and found that there are no any exports for THEBES API now. They were removed when SDK change version from 11 to 12. Is it way to use gfxWindowsSurface and gfxContext in binary XPCOM in the latest xulrunner sdk`s?
Thanks,
Serge
The relevant change is bug 683891, also see bug 718985 for extended discussion. It seems that allowing third parties access graphics code directly is no longer considered desirable. So the answer to your question is: no, you can no longer do this with the stock XULRunner. So you can either look for alternative ways to achieve your goal (e.g. higher level drawing surfaces like <canvas>
as suggested in the bug) or you can create your own XULRunner build with this particular patch reverted.