Looks like Mozila plug-ins developers solve it for us:
https://wiki.mozilla.org/NPAPI:CoreGraphicsDrawing
All I need is:
CGContextRef cgContext;
CGrafPtr port = (CGrafPtr) AVPageViewAcquireMachinePort(pageView);
QDBeginCGContext(port, &cgContext);
// use cgContext to draw ...
QDEndCGContext(port, &cgContext);
Thanks.