Changeset 846 for trunk/doc/src/platforms/emb-hardwareacceleration.qdocinc
- Timestamp:
- May 5, 2011, 5:36:53 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
doc/src/platforms/emb-hardwareacceleration.qdocinc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/doc/src/platforms/emb-hardwareacceleration.qdocinc
r561 r846 1 \section1 Hardware Acceleration2 3 When designing applications for embedded devices there is often a4 compromise between graphics effects and performance. On most5 devices, you cannot have both simply because the hardware needed6 for such operations just is not there. With a growing number of7 devices that use hardware dedicated to graphics operations there is8 less need to compromise.9 10 In addition to enabling dynamic graphics effects, there are two11 other benefits to using graphics acceleration. One is that graphics12 acceleration hardware is more power efficient than using the CPU.13 The reason for this is that the CPU might require a clock speed14 that is up to 20 times higher than the GPU, achieving the same15 results. E.g. a typical hardware accelerated mobile graphics unit16 can rasterize one or two bilinear texture fetches in one cycle,17 while a software implementation takes easily more than 20 cycles.18 Typical \e {System-on-a-chip} (SoC) graphics hardware generally have19 a much lower clock speed and memory bandwidth, and different level20 of acceleration than desktop GPUs. One example is that many GPUs21 leave out transformation and lighting from the graphics pipeline22 and only implements rasterization.23 24 Another reason to use a GPU is to offload the main CPU, either for25 power saving or to perform other operations in parallel. Often26 drawing speed with a GPU is not that much faster than a CPU but27 the clear benefit of using the GPU is to free up the CPU to perform28 other tasks which can be used to create a more responsive use29 experience.30 31 The key to writing good applications for devices is therefore to32 limit the wow factor down to what the target hardware can handle,33 and to take advantage of any graphics dedicated hardware. Qt34 provides several ways to both render advanced effects on the screen35 and speed up your application using hardware accelerated graphics.36 37 \tableofcontents38 39 \section2 Qt for Embedded Graphics pipeline40 41 Qt uses QPainter for all graphics operations. By using the same API42 regardless of platform, the code can be reused on different devices.43 QPainter use different paint engines implemented in the QPaintEngine API to44 do the actual painting.45 46 The QPaintEngine API provides paint engines for each window system and47 painting framework supported by Qt. In regards to Qt for Embedded, this48 also includes implementations for OpenGL ES versions 1.1 and 2.0, as well49 as OpenVG and DirectFB(Embedded Linux only).50 51 By using one of these paint engines, you will be able to improve the52 graphics performance of your Qt application. However, if the graphics53 operations used are not supported, this might as well be a trap, slowing54 down your application significantly. This all depends on what kind of55 graphics operations that are supported by the target devices hardware56 configuration.57 58 \image platformHWAcc.png59 60 The paint engine will direct all graphics operations supported by the61 devices hardware to the GPU, and from there they are sent to the62 framebuffer. Unsupported graphics operations falls back to the63 QRasterPaintEngine and are handled by the CPU before sent to the64 framebuffer. In the end, the operating system sends the paint updates off65 to the screen/display. The fallback operation is quite expensive in regards66 to memory consumption, and should be avoided.67 68 \section2 Hardware configuration requirements69 70 Before implementing any application using hardware acceleration, it is wise71 to get an overview of what kind of hardware accelerated graphics operations72 that are available for the target device.73 74 \note On devices with no hardware acceleration, Qt will use75 QRasterPaintEngine, which handles the acceleration using software. On76 devices supporting OpenGL ES, OpenVG or DirectFB(not supported by Windows77 CE), Qt will use the78 respective paint engines to accelerate painting. However, hardware79 configurations that only support a limited set of hardware acceleration80 features, might slow the application graphics down rather than speeding it81 up when using unsupported operations that must fall back to the raster82 engine.83 84 \section3 Different architectures85 86 Based on the architecture used in a device we can make a recommendation on87 which hardware acceleration techniques to use. There are mainly two88 different architectures on embedded devices. These are devices with a89 Unified Memory Architecture (UMA), and devices with dedicated graphics90 memory. Generally, high-end devices will have dedicated graphics memory.91 Low-end devices will just use system memory, sometimes reserving a memory92 region and sometimes not.93 94 In addition to this, we can categorize the devices into five types based on95 the different graphics operations supported by their hardware.96 97 \list 198 \o No support for graphics acceleration.99 \o Support for blitter and alpha blending.100 \o Support for path based 2D vector graphics.101 \o Support for fixed function 3D graphics.102 \o Support for programmable 3D graphics.103 \endlist104 105 Based on these characteristics the table below recommends which paint106 engines to use with the different types of hardware configurations.107 108 \section3 Recommended use of hardware acceleration based on hardware109 110 \table111 \header112 \o Type113 \o UMA114 \o Non-UMA115 \row116 \o \bold {None}117 \o Qt Raster Engine118 \o Qt Raster Engine119 \row120 \o \bold {Blitter}121 \o DirectFB122 \o DirectFB123 \row124 \o \bold {2D Vector}125 \o OpenVG126 \o OpenVG127 \row128 \o \bold {Fixed 3D}129 \o OpenGL (ES) 1.x130 \o OpenGL (ES) 1.x131 \row132 \o \bold {Programmable 3D}133 \o OpenGL (ES) 2.x134 \o OpenGL (ES) 2.x135 \endtable136 137 \note Since the DirectFB API is quite primitive, the raster paint engine138 handles most of the operations.139 140 \note Blitter and Alpha blending is currently not supported on Windows CE.1 \section1 Hardware Acceleration 2 3 When designing applications for embedded devices there is often a 4 compromise between graphics effects and performance. On most 5 devices, you cannot have both simply because the hardware needed 6 for such operations just is not there. With a growing number of 7 devices that use hardware dedicated to graphics operations there is 8 less need to compromise. 9 10 In addition to enabling dynamic graphics effects, there are two 11 other benefits to using graphics acceleration. One is that graphics 12 acceleration hardware is more power efficient than using the CPU. 13 The reason for this is that the CPU might require a clock speed 14 that is up to 20 times higher than the GPU, achieving the same 15 results. E.g. a typical hardware accelerated mobile graphics unit 16 can rasterize one or two bilinear texture fetches in one cycle, 17 while a software implementation takes easily more than 20 cycles. 18 Typical \e {System-on-a-chip} (SoC) graphics hardware generally have 19 a much lower clock speed and memory bandwidth, and different level 20 of acceleration than desktop GPUs. One example is that many GPUs 21 leave out transformation and lighting from the graphics pipeline 22 and only implements rasterization. 23 24 Another reason to use a GPU is to offload the main CPU, either for 25 power saving or to perform other operations in parallel. Often 26 drawing speed with a GPU is not that much faster than a CPU but 27 the clear benefit of using the GPU is to free up the CPU to perform 28 other tasks which can be used to create a more responsive use 29 experience. 30 31 The key to writing good applications for devices is therefore to 32 limit the wow factor down to what the target hardware can handle, 33 and to take advantage of any graphics dedicated hardware. Qt 34 provides several ways to both render advanced effects on the screen 35 and speed up your application using hardware accelerated graphics. 36 37 \tableofcontents 38 39 \section2 Qt for Embedded Graphics pipeline 40 41 Qt uses QPainter for all graphics operations. By using the same API 42 regardless of platform, the code can be reused on different devices. 43 QPainter use different paint engines implemented in the QPaintEngine API to 44 do the actual painting. 45 46 The QPaintEngine API provides paint engines for each window system and 47 painting framework supported by Qt. In regards to Qt for Embedded, this 48 also includes implementations for OpenGL ES versions 1.1 and 2.0, as well 49 as OpenVG and DirectFB(Embedded Linux only). 50 51 By using one of these paint engines, you will be able to improve the 52 graphics performance of your Qt application. However, if the graphics 53 operations used are not supported, this might as well be a trap, slowing 54 down your application significantly. This all depends on what kind of 55 graphics operations that are supported by the target devices hardware 56 configuration. 57 58 \image platformHWAcc.png 59 60 The paint engine will direct all graphics operations supported by the 61 devices hardware to the GPU, and from there they are sent to the 62 framebuffer. Unsupported graphics operations falls back to the 63 QRasterPaintEngine and are handled by the CPU before sent to the 64 framebuffer. In the end, the operating system sends the paint updates off 65 to the screen/display. The fallback operation is quite expensive in regards 66 to memory consumption, and should be avoided. 67 68 \section2 Hardware configuration requirements 69 70 Before implementing any application using hardware acceleration, it is wise 71 to get an overview of what kind of hardware accelerated graphics operations 72 that are available for the target device. 73 74 \note On devices with no hardware acceleration, Qt will use 75 QRasterPaintEngine, which handles the acceleration using software. On 76 devices supporting OpenGL ES, OpenVG or DirectFB(not supported by Windows 77 CE), Qt will use the 78 respective paint engines to accelerate painting. However, hardware 79 configurations that only support a limited set of hardware acceleration 80 features, might slow the application graphics down rather than speeding it 81 up when using unsupported operations that must fall back to the raster 82 engine. 83 84 \section3 Different architectures 85 86 Based on the architecture used in a device we can make a recommendation on 87 which hardware acceleration techniques to use. There are mainly two 88 different architectures on embedded devices. These are devices with a 89 Unified Memory Architecture (UMA), and devices with dedicated graphics 90 memory. Generally, high-end devices will have dedicated graphics memory. 91 Low-end devices will just use system memory, sometimes reserving a memory 92 region and sometimes not. 93 94 In addition to this, we can categorize the devices into five types based on 95 the different graphics operations supported by their hardware. 96 97 \list 1 98 \o No support for graphics acceleration. 99 \o Support for blitter and alpha blending. 100 \o Support for path based 2D vector graphics. 101 \o Support for fixed function 3D graphics. 102 \o Support for programmable 3D graphics. 103 \endlist 104 105 Based on these characteristics the table below recommends which paint 106 engines to use with the different types of hardware configurations. 107 108 \section3 Recommended use of hardware acceleration based on hardware 109 110 \table 111 \header 112 \o Type 113 \o UMA 114 \o Non-UMA 115 \row 116 \o \bold {None} 117 \o Qt Raster Engine 118 \o Qt Raster Engine 119 \row 120 \o \bold {Blitter} 121 \o DirectFB 122 \o DirectFB 123 \row 124 \o \bold {2D Vector} 125 \o OpenVG 126 \o OpenVG 127 \row 128 \o \bold {Fixed 3D} 129 \o OpenGL (ES) 1.x 130 \o OpenGL (ES) 1.x 131 \row 132 \o \bold {Programmable 3D} 133 \o OpenGL (ES) 2.x 134 \o OpenGL (ES) 2.x 135 \endtable 136 137 \note Since the DirectFB API is quite primitive, the raster paint engine 138 handles most of the operations. 139 140 \note Blitter and Alpha blending is currently not supported on Windows CE.
Note:
See TracChangeset
for help on using the changeset viewer.
