Documentation
¶
Overview ¶
Package orders renders the drawing orders a server sends when the client says it supports them.
Orders are how RDP drew things before bitmap updates and EGFX. The server puts bitmaps into a cache with secondary orders and then blits them to the screen with MEMBLT, often with a couple of fills alongside. That is the whole model in practice: a session measured against Windows 10 consisted of 1770 MEMBLTs, 1000 cache fills and 62 alternate secondary orders, and nothing else.
Whether to advertise support is a trade: the server stops sending bitmap updates entirely, so a client that cannot render orders gets a blank screen rather than a slower one. See docs/windows-verification.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache holds the bitmaps the server stores with secondary orders and reads back with MEMBLT.
Entries are dropped rather than reused when the server overwrites a slot, which is what it does when its own cache fills up: the protocol has no eviction message for the client because the client is not expected to hand anything back.
func (*Cache) Get ¶
Get returns a cache entry, or nil if the slot is empty. The caller must not modify the pixels.
func (*Cache) Put ¶
func (c *Cache) Put(cb *pdu.CacheBitmap)
Put stores a bitmap from a cache order. Entries the server says not to keep are still stored, because a MEMBLT usually follows immediately and expects to find them; they are simply not relied upon to last.
The order's own pixels are in the bitmap's pixel format and are converted to BGRA here, so that blitting is a copy.
type Screen ¶
type Screen struct {
// Cache holds the bitmaps the server blits from. Without it MEMBLT has
// nothing to read.
Cache *Cache
// contains filtered or unexported fields
}
Screen is a framebuffer that renders drawing orders. It holds BGRA pixels, top down, like the surfaces EGFX uses.
func (*Screen) Draw ¶
Draw renders a batch of orders and returns the area they changed, which is empty when nothing was drawn. The returned error is for a batch that could not be applied at all; orders that are merely unsupported are counted instead, since the rest of the batch is still worth drawing.
func (*Screen) Resize ¶
Resize discards the contents and changes the size. Servers send a fresh set of orders after a resize, so there is nothing worth keeping.
func (*Screen) Unsupported ¶
Unsupported reports how many orders were recognised but not drawn, by kind. A stream of MEMBLTs with an unhandled ROP shows up here rather than as a silently wrong screen.