[webkit-dev] Another problem: how to dump flash content into image in Linux?

tonikitoo (Antonio Gomes) tonikitoo at gmail.com
Mon Jun 15 11:03:02 PDT 2009


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 <tiansjun at hotmail.com>:
> 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
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>



-- 
--Antonio Gomes


More information about the webkit-dev mailing list