Partilhar via


More about layered windows

Got a lot of responses to that last post, let's see if I can answer more questions than I raise:

Why doesn't per-pixel alpha work?   Basically, because Avalon uses DirectX to render, not GDI, and DirectX rendering to layered window don't work so good.  On XP, we're investigating workarounds to these limitations in GDI and DirectX, but there's no guarantee they will pan out.  Actually, most of the same limitations in GDI and DirectX are also present on Longhorn, but on that platform we at least have some ability to change GDI and DirectX.  In theory, we could change Avalon to use GDI to render to layered windows, thus avoiding the problems with per-pixel elf (if doing nothing to get hardware acceleration) -- but that's prohibitive in practice, it would mean rewriting some large portion of our rendering stack.

How do Avalon menus get drop shadows?   Using Win32's CS_DROPSHADOW.  The implementation of this in Win32k.sys leverages a lot of the same layered window infrastructure, but the style can be applied to non-layered windows.

Does not the HGRN model above just clip the rectangle window?   Yes (both input and output).

I'd like to see an 3D object able to live without the chrome -- I'd like that too, but it's not something we think we'll be able to finish in Longhorn.  We're taking a big step forward in Longhorn with the Desktop Window Manager (DWM), which for the first time treats Windows as composable objects rather than a just some random set of pixels on the screens that applications draw directly to, which will allow a lot of things never before possible, including window transition animations, flicker-free layered windows on top of DirectX, and magnification of specific windows.  But the communication between the DWM and the application is essentially a bitmap in video memory, not an arbitrary 3D scene or other complex data structure, so there's limits to what can be done.  (OK, the pipe between the DWM and applications is more than a bitmap for accessibility and terminal server scenarios, but the core rendering part is basically a bitmap)  We'll get there eventually, but we can only do so much in one version.

If we get per-pixel alpha working as I hope we do, that might be a good approximation to a chrome-less 3D object.  It will ultimately be a 3D object on a bitmap (rendered non-rectangular), and something tells me that would limit your options somehow, whether in terms of performance or otherwise, although right now no problems are jumping out at me.

Comments

  • Anonymous
    June 30, 2005
    Nick Kramer on Avalon