Chinaunix首页 | 论坛 | 博客
  • 博客访问: 88137
  • 博文数量: 70
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 417
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-11 10:48
文章分类

全部博文(70)

分类: IT业界

2014-05-07 22:55:54

    PhantomJS 1.5 "Ghost Flower"blablabla...

    Pure headless (no X11) on Linux

    While it's always possible to customize the build of PhantomJS Linux without X11 (in particular since the last 1.4 release), it's a tedious adventure. Beginning from this release, X11-less setup is the standard when building PhantomJS Linux from source.

    The benefits of pure headless are two-fold: no need to use Xvfb, it also compiles out-of-the-box on a barebone Linux server without GUI. This should make it easy to place PhantomJS in various continuous integration systems and cloud/elastic platforms.

    Note that the pure headless mode does not compromise the functionalities and rendering quality. For screen capture, text rasterization is still done through FreeType and Fontconfig. Various formats (PNG, GIF, JPEG) for inlined images are still supported. Even producing PDF from the web page works just fine.

    很好奇哈,不知道咋把 X11 依赖去除的呢?话说 Qt 整个是需要 GUI 支持的。

    通过群里各位大哥指路。偶知道了还有个 Lighthouse。

    这玩意已经被合并到 Qt 4.8 中了。Lighthouse 是Qt Platform Abstraction 项目的名字,它使得将Qt移植到新的平台变得比容易。

    它是 QtGui 的一个Window System Agnostic移植,它和X11、MAC、WIN在代码上处于同等地位(所以也就不依赖于系统具体 GIU 了):

    kernel/qwidget_qpa.cpp

    kernel/qwidget_mac.mm

    kernel/qwidget_x11.cpp

    kernel/qwidget_win.cpp

    话说它怎么用呢…… 这个可纠结了,要在编译 Qt 时候加入配置参数 -qpa 才可以,如:

    ./configure -developer-build -qpa -opensource -nomake examples -nomake demos -nomake tests

    使用此 Qt 编译出的 Qt 具体工程就脱离 X11 依赖了。

    具体工程使用方法:

    在 Qt 4.8 中,我们可与原来一样不通过lighthouse使用X11,又可以通过 xlib 插件使用lighthouse。

    如工程编译后任意执行:

    ./myApp -platform Xlib就可以通过 xlib 插件使用 lighthouse 了。而不用依赖系统 GUI。而 Minimal 参数可以将视窗在虚拟帧中渲染。 ./myApp -platform Minimal

阅读(1478) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~