Archive for April, 2011

There are at least two ways to render a cursor (or ie9 rendering bug)

Thursday, April 7th, 2011

This post, and anything else tagged spice, is about the spice project development that I’m a part of, ever since starting to work for Red Hat last year.

So the first post will be just about a recent fix to a rendering problem (tl;dr version): ie9 (Internet Explorer 9) rendering. A glaring bug was discovered recently – we didn’t render ie9 pages correctly. After a lot of investigation this turned out to be a caching issue – we were using the same key to cache two different bitmap copy operations (this is the driver cache, unrelated to the server/client cache). The DrvCopyBits operation has two parameters, a SURFOBJ containing the bitmap, and a XLATEOBJ containing a color translation object. We ignored the later in some cases. Basically rendering of a blinking cursor (and any text) is done differently in ie9 as compared to a login blinking cursor:

ie9 renders a blinking cursor by sending the same SURFOBJ (iUniq is constant) with two alternating pallettes.

login (and ff4) draw a blinkinging cursor by using DrvBitBlt with a fill operation with mask 0xff (I assume xor, although this didn’t break so I didn’t take a too close look).

To be more precise this is the view from the device driver that is not implementing any DirectDraw, just GDI. So this could be actually an implementation detail of some dll being used by either of those browsers.

These are the logs for the events:

ie9, uses DrvCopyBits with the same SURFOBJ and alternating XLATEOBJ’s:

125684577551 qxldd: DrvCopyBits [0,296191,(15,16,130,146),3,0,(15,16,130,146)]
125684662828 qxldd: _BitBlt
125684693209 qxldd: __DrvBitBlt
125684725824 qxldd: DoCopy
125684760256 qxldd: GetDrawable 0x91f44d70
125684785190 qxldd: SetClip
125684808936 qxldd: SetClip: QXL_CLIP_TYPE_NONE
125684833241 qxldd: GetBitmap
125684856218 qxldd: QXLGetBitmap
125684885552 qxldd: QXLGetBitmap: iUniq=123d DONTCACHE=0 w=1 h=16 cx=1024 cy=674 hsurf=330507e4 ctiUniq=2263 XO_TABLE=0 format=6
125686471440 qxldd: GetCacheImage: ImageKeyPut 231944847
125686542120 qxldd: GetCacheImage: ImageCacheGetByKey 231944847 hits 8
125686567542 qxldd: QXLGetBitmap: cached image found 231944847
125686589891 qxldd: AddRes
125686610494 qxldd: AddRes: done
125686634939 qxldd: WaitForCmdRing: 0xffb83018
125686657847 qxldd: DoCopy: done
126216044861 qxldd: DrvCopyBits [0,296191,(15,16,130,146),3,0,(15,16,130,146)]
126216155001 qxldd: _BitBlt
126216198721 qxldd: __DrvBitBlt
126216264443 qxldd: DoCopy
126216321015 qxldd: GetDrawable 0x92086190
126216365434 qxldd: SetClip
126216406919 qxldd: SetClip: QXL_CLIP_TYPE_NONE
126216456437 qxldd: GetBitmap
126216499180 qxldd: QXLGetBitmap
126216553237 qxldd: QXLGetBitmap: iUniq=123d DONTCACHE=0 w=1 h=16 cx=1024 cy=674 hsurf=330507e4 ctiUniq=2264 XO_TABLE=0 format=6
126219653568 qxldd: GetCacheImage: ImageKeyPut 707842221
126219750019 qxldd: GetCacheImage: ImageCacheGetByKey 707842221 hits 8
126219808546 qxldd: QXLGetBitmap: cached image found 707842221
126220005499 qxldd: AddRes
126220069404 qxldd: AddRes: done
126220184642 qxldd: WaitForCmdRing: 0xffb83018

login cursor – using a fill DrvBitBlt (xor probably – the turn on and turn off operations are identical):

59327727656 qxldd: DrvBitBlt [-1,4294967295,(406,407,499,514),3,0,(406,407,499,514)]
59327845688 qxldd: _BitBlt
59327969167 qxldd: __DrvBitBlt
59328036913 qxldd: DoFill
59328186375 qxldd: GetDrawable 0x91235030
59328263480 qxldd: SetClip
59328360489 qxldd: SetClip: QXL_CLIP_TYPE_NONE
59328455334 qxldd: QXLGetBrush
59328550877 qxldd: QXLGetBrush: color 0xffffff
59328644953 qxldd: QXLGetBrush: done
59328741544 qxldd: WaitForCmdRing: 0xffb83018
59328837925 qxldd: DrvBitBlt: done
59827733713 qxldd: DrvBitBlt [-1,4294967295,(406,407,499,514),3,0,(406,407,499,514)]
59827853002 qxldd: _BitBlt
59827921377 qxldd: __DrvBitBlt
59827982837 qxldd: DoFill
59828117910 qxldd: GetDrawable 0x91233f90
59828291676 qxldd: SetClip
59828366476 qxldd: SetClip: QXL_CLIP_TYPE_NONE
59828461111 qxldd: QXLGetBrush
59828564826 qxldd: QXLGetBrush: color 0xffffff
59828664000 qxldd: QXLGetBrush: done
59828736566 qxldd: WaitForCmdRing: 0xffb83018
59828818839 qxldd: DrvBitBlt: done