This topic provides an introduction to the DirectGDI component. DirectGDI provides a graphics context that can be hardware accelerated, and allows an asynchronous interface.
Target audience: Device creators.
The DirectGDI framework has two parts: a generic layer, which provides a client API and an adaptation layer. Device creators can replace the adaptation layer with an implementation that takes advantage of graphics accelerated hardware, if it is available, or a software implementation, if it is not available. This section covers the generic layer.
Window Server rendering is performed by one or more render stage plug-ins, which device creators can also replace. In ScreenPlay, the Symbian render stage plug-in uses DirectGDI rather than the older BitGDI component. This means that existing Window Server applications can potentially take advantage of hardware acceleration (and therefore run faster) without recompiling the code.
The following diagram shows the usage of the DirectGDI component. In this diagram the application is a regular GUI application that draws using the Symbian Window Server API.
The Symbian DirectGDI adaptation uses the Graphics Resource component, which provides an abstraction layer for the memory management of pixel and non-pixel data (such as a list of VG commands). The Graphics Resource component supports uniform and non-uniform memory architectures, but is not available on all platforms. Like DirectGDI, the Graphics Resource component has generic and adaptation layers. When it is available, device creators can tailor the adaptation for a specific graphics hardware accelerator. The Symbian reference Graphics Resource adaptation uses surfaces.
The key elements of DirectGDI are driver, resources and drawing context as shown in the following diagram.
Driver. The driver class CDirectGdiDriver implements platform-specific functionality to create and manage device-dependent drawing contexts and resources. It defines the Hardware Adaptation Interface (HAI) that must be implemented by device creators.
Drawing Context. CDirectGdiContext represents a new drawing context that is similar to CFbsBitGc and CWindowsGc, but without functions (such as read-modify-write functions like SetFaded()) that are not suitable for hardware acceleration. CDirectGdiContext also provides new rendering operations that are not available via CFbsBitGc, such as drawing contents generated using non-native APIs.
Resources. DirectGDI introduces two new abstractions of graphics resources: RDirectGdiDrawableSource and RDirectGdiImageTarget. These resources are created by binding them to the RSgDrawable or RSgImage resource defined in the Graphics Resource component.
The DirectGDI component provides a framework that enables graphics hardware acceleration and interleaved rendering. This framework provides an API for client applications and a Hardware Adaptation Interface (HAI), which defines interfaces that must be implemented by device and hardware manufacturers in order to provide the API functionality. The framework has a dependency on the Graphics Resource component.
The Graphics package provides two DirectGDI adaptations:
a purely software adaptation that uses existing components to draw to the screen in a similar manner to BitGDI
a hardware adaptation that uses OpenVG and EGL APIs.
The following figure shows how the DirectGDI generic layer and the reference adaptations interface with each other. It shows how the software and hardware adaptations use the same HAI. However, only one adaptation can be present on a phone.
For more information about the DirectGDI adaptation layer, see the DirectGDI Adaptation Overview.
DirectGDI consists of one DLL, directgdi.dll. For more information, see DirectGDI Library .
The main usage of DirectGDI is within a Window Server render stage plug-in. This enables the Window Server rendering to be hardware accelerated when suitable hardware is available. Currently DirectGDI is not available for use by applications.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.