HW Acceleration of Layered Windows for RTM


To obtain GPU-accelerated rendering, Windows Presentation Foundation (WPF) normally renders and presents graphical content through the DirectX pipeline – including the composition of the scene geometry and presentation of the results.  


Since before Windows XP, Win32 has supported an alternative window presentation mechanism called “layered windows”.  Layered windows allow for top-level window transparency effects when composed with the desktop; on WPF, this feature is available by setting Window.AllowsTransparency=”true”.  For example, to get a dropshadow effect, WPF composes Menus and Popups as layered windows.


There are two aspects to rendering: composing the scene, and presenting the surface. The Windows Vista D3D 9.0 graphics API provides support for rendering to surfaces with an alpha channel, but does not directly support a mechanism to present that surface to the desktop and retain alpha information. On Windows Vista, WPF renders via hardware accelerated DX, acquires the surface via IDirect3DSurface9::GetDC, and presents to the screen via GDI.


DirectX 9.0C, the version of DX available on Windows XP, does not support IDirect3DSurface9::GetDC of a surface with an alpha channel. As such, support for hardware accelerated rendering when using Window.AllowsTransparency=”true” will not be available on Windows XP from the RC1 and RTM releases of WPF.

Comments (6)

  1. Seema posted the final word on hardware acceleration for WPF layered windows. Long story short, layered…

  2. avalite says:

    Previously, I had posted that Avalon’s layered windows on XP will be rendered via the software pipeline.

  3. A feature that the WPF team added late to WPF was the ability to allow transparent windows ( property

  4. seemar1 says:

    UPDATE, there is an XP QFE to enable HW acceleration of layered windows:

    http://blogs.msdn.com/seema/archive/2007/07/02/hw-acceleration-of-layered-windows-good-news.aspx

    Enjoy!