X: GetImage reading from the display

本文探讨了X服务器中GetImage请求的工作原理及其局限性。GetImage用于读取帧缓冲区的内容,但存在速度慢及难以正确使用的问题。文章还讨论了如何处理接收到的帧缓冲区数据。

The X Server does not keep track of what it has drawn on the display. Once bits are rendered to the FB, its responsibility for them has ended. If bits need to be re-rendered, the X server asks either a compositing manager or the application that originally drew them to draw again.

Some client applications, such as screenshots, need to read back the contents of the FB directly. The X protocol provides a GetImage request for this case.

drawbacks of GetImage:

  • GetImage is typically extremely slow, since the the hardware and software paths in moder graphics are optimized for the case of outputting pixels at the expense of redering then.
  • GetImage is also hard to use properly.

Here, more than anywhere else in the X protocol, the underlying hardware is exposed to clients. The requested FB contents are presented to the client with the FB's alignment, padding and byte ordering. Generic library code available in XCB to deal with the complexity of translating the received FB into something useful. However, using this code further slows processing.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值