Hi tonikitoo,
Thanks for your hint. It seems that WebKit doesn't support the windowless
plugin in X11.
Is their other way to implement feature? We can get some infomation of the
native windows now.
Can we do it with raw Xlib functions?
I found a topic in MDC that claims the support of windowless plugins in X11.
> Date: Mon, 15 Jun 2009 14:03:02 -0400
> Subject: Re: [webkit-dev] Another problem: how to dump flash content into
> image in Linux?
> From: [email protected]
> To: [email protected]
> CC: [email protected]
>
> TianShijun,
>
> QtWebKit (as well as Gtk and possibly others port) uses XEmbed to get
> plugins (e.g. Flash) running. XEmbed is a X protocol to embed X window
> onto others (containers). That said, when you try "dumping" flash by
> the way you pasted below, you are not even touching the plugin
> painting surface at all, but instead dumping the background "image"
> QtWebKit draws under the XEmbed plugin window. Webkit has no control
> of what flash is drawing. That is sorta default behavior on Linux ...
>
> Windows we have ways to force flash to get painted onto WebKit drawing
> surface, but it is unsupport by Flash on Linux. You are probably
> looking for a *windowless* plugin implementation ...
>
>
>
> 2009/6/15 TianShijun <[email protected]>:
> > Hi All,
> > I have tried to modify the PluginView::paint method in PluginViewQt.cpp to
> > dump the flash content. But the result is always a gray image. Does any one
> > know why? Or has anyone implemented the similar function before?
> >
> > I have also tested the "print/print preview" function on many browsers
> > (Firefox, Konqueror, arora, Opera). None of them can print flash content. Is
> > there any way to implement it?
> >
> > Thanks a lot.
> >
> > PS: There may be a bug of PluginView::paint in PuginViewWin.cpp.While
> > dumping web page with flash content into image, the dumped flash content has
> > a doubled offset. It works well if we comment the "SetWorldTransform" lines
> > in PluginView::paintWindowedPluginIntoContext.
> >
> > Here are the codes of my PluginView::paint in PluginViewQt.cpp. It always
> > outputs a gray image in Linux.
> > -------------------------------------------------------------------------------------------------------------------
> > void PluginView::paint(GraphicsC ontext* context, const IntRect& rect)
> > {
> > if (!m_isStarted) {
> > paintMissingPluginIcon(context, rect);
> > return;
> > }
> >
> > //if (m_isWindowed || context->paintingDisabled())
> > // return;
> > //notImplemented();
> >
> > if(context->paintingDisabled()) return;
> > PlatformGraphicsContext *painter = context->platformContext();
> > if(painter){
> > PlatformPluginWidget widget = platformPluginWidget();
> > if(widget){
> > //QPixmap pixmap = QPixmap::grabWidget(widget);
> > //QPixm ap pixmap = QPixmap::grabWindow(widget->winId());
> > //QPixmap pixmap =
> > QPixmap::grabWindow((WId)m_npWindow.window);
> > //widget->render(painter, QPoint(widget->x(),widget->y()),
> > QRegion(0,0,widget->width(),widget->height()),
> > //QWidget::DrawWindowBackground | QWidget::DrawChildren |
> > QWidget::IgnoreMask );
> > QPixmap pixmap(widget->size());
> > widget->render(&pixmap);
> > pixmap.save("/tmp/test.ppm");
> > &nb sp; painter->drawPixmap(QPoint(widget->x(),widget->y()),
> > pixmap);
> > }
> > }
> > }
> >
> >
> >
> > ________________________________
> > 立刻下载 MSN 保护盾,保障Messenger 安全稳定! 现在就下载!
> > _______________________________________________
> > webkit-dev mailing list
> > [email protected]
> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> >
> >
>
>
>
> --
> --Antonio Gomes
_________________________________________________________________
Messenger安全保护中心,免费修复系统漏洞,保护Messenger安全!
http://im.live.cn/safe/_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev