Windows 7’s Graphics Engine Wants to be Better than Vista’s
The Windows 7 graphics engine changes the way DWM, introduced with Vista, works, it also comes with new APIs, D2D and DWrite, a new Direct3D 11, and better handling of multiple output devices.
David Blythe, a senior architect in Windows Desktop and Graphics Team, explains in a Channel 9 interview what is the Desktop Window Manager (DWM) and how it works. Applications no longer draw directly on the screen but they draw on a bitmap in memory, and DWM takes care of drawing on the screen. This is used in order to apply various transformations to the graphics drawn before they appear on the screen. This is how the animated taskbar thumbnails are created or the desktop magnification works.
The problem with Vista’s DWM was its efficiency. Until Vista, an application would, for example, use the GDI to draw a picture on the screen while GDI would use the hardware graphics accelerator to do the actual job. In Vista, the GDI draws to the memory, and DWM takes that bitmap and draws it on the screen using the GPU. This resulted in having two copies of the same image. The improvement in Vista 7 means that the GDI is going to draw directly on the graphics memory and that meant reintroducing a minimum hardware acceleration layer in GDI. This change resulted in “dramatic” reduction in memory consumption and faster rendering.
Two new DirectX APIs are Direct2D and DirectWrite. According to MSDN, Direct2D is:
a hardware-accelerated, immediate-mode, 2-D graphics API that provides high performance and high quality rendering for 2-D geometry, bitmaps, and text. The Direct2D API is designed to interoperate well with GDI, GDI+, and Direct3D,
while, DirectWrite is:
DirectWrite provides high-quality text rendering, resolution-independent outline fonts, and full Unicode text and layout support. When used with Direct2D, DirectWrite is hardware-accelerated.
Direct3D 11 coming in Windows 7 is a superset of D3D10 and will run on D3D9 and D3D10.x hardware. Some of the new features present in D3D11 are:
- Tessellation — to increase at runtime the number of visible polygons from a low detail polygonal model
- Multithreaded rendering — to render to the same Direct3D device object from different threads for multi core CPUs
- Compute shaders — which exposes the shader pipeline for non-graphical tasks such as stream processing and physics acceleration, similar in spirit to what NVIDIA CUDA achieves, and HLSL Shader Model 5 among others.
One of the features not working quite smoothly in Vista but being addressed with Windows 7 is managing multiple monitors and display devices like projectors. In order to handle the huge number of possible output devices configurations, the GDI APIs have been extended and the desired output configuration can be easily selected by pressing Win + P.