|
||
2D graphics acceleration enables improved performance for
multimedia applications. The API, which is defined in
graphicsaccelerator.h
, is abstract. The abstract base class for
all accelerators is CGraphicsAccelerator
. The API also defines a
set of common 2D graphics operations that are capable of being accelerated in
hardware (by a separate graphics processor), or in software (by a DLL that
optimises the algorithms for particular devices and display modes). The API may
or may not be implemented by Symbian OS licensees.
Note that graphics acceleration, if implemented, is designed to be used transparently within BITGDI, not called explicitly by clients.
2D Graphics Hardware Acceleration is closely related to the following APIs:
Graphics. Graphics acceleration has been integrated into the underlying implementation of the Graphics API. The API itself is unchanged, so that applications that use it do not need to be aware of whether or not a particular graphics operation is accelerated. If an accelerated implementation of a function is available, it will be used in preference to the existing, generic algorithm.
Bitmaps. Software graphics accelerators can draw to existing types
of bitmaps (CFbsBitmap
s), as well as a new type of bitmap, called
hardware bitmaps. These are described below. Hardware graphics accelerators can
only draw to hardware bitmaps.
Each class derived from TGraphicsOperation
represents
a different accelerated graphics operation. The subset of these operations
supported by an accelerator is hardware-dependent and will vary from device to
device. The graphics accelerator's capabilities can be enquired before it is
used. The TGraphicsAcceleratorCaps
class gives some of the
capabilities, for instance whether mask bitmaps must be in a certain display
mode. To find out whether a particular operation is supported, an attempt
should be made to execute it. Unsupported functions should simply return
KErrNotSupported
. The user of the API does not need to be aware of
whether an operation is accelerated in hardware or in software — the API is the
same for both.
The types of accelerated operations which are enabled by this API include:
filling a rectangle with a colour or pattern; fading and inverting colours
a variety of bitblt operations, including using a mask, transparency or alpha blending. These operations may involve scaling the bitmap
filling a polygon with a colour or a pattern.
All of these operations may optionally take place within a clipping region.
Hardware graphics acceleration can only draw to hardware bitmaps.
These are bitmaps that are stored in a static, contiguous area of physical
memory that is accessible to both the CPU and to a separate graphics processor.
The interface to a hardware bitmap is class RHardwareBitmap
.
Software graphics acceleration can write to both CFbsBitmap
s and
RHardwareBitmap
s.