Skip to content

WPF HW Acceleration of Layered Windows for RTM

[this post was originally posted on on Sept 18, 2006. It is reposted here as I’m moving hosting sites -Seema]

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 viaIDirect3DSurface9::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 usingWindow.AllowsTransparency=”true” will not be available on Windows XP from the RC1 and RTM releases of WPF.

Post a Comment

Your email is never published nor shared. Required fields are marked *