转自: http://blog.chinaunix.net/u/17258/showart_371661.html
A Surface is a reserved area in memory where pixel data for one image is stored in a
specific pixel format. A Surface can reside in video and/or system memory. It is possible to perform drawing operations on a surface or to Blit the surface to another.
In fullscreen mode, the visible screen is represented by the ”‘Primary Surface”’, so it is possible to perform graphics operations directly on the visible screen.Every Surface can optionally use double buffering, graphics operations are then first executed on a secondary buffer and become valid after Flip() is called. To prevent flickering it is advised to use Doublebuffering on the primary Surface in most cases.
Depending on the graphics hardware, there are one or more display Layers. A standard PC graphics card has only one Layer, but sophisticated devices like TV set top boxes may support two or more layers. Layers occupy different areas in video ram, and are usually combined by using alpha blending. This in done automatically by the display hardware. If the content of the lowest Layer changes, no repaint has to be done and the contents of the above layers remain untouched. Today, most PC graphics cards also support an additional layer (a ”‘video layer”’), which can be scaled and does color conversion from YUV to RGB. This layer cannot usually be blended and has to remain fully opaque. Video layers are supported by varios DirectFB graphics drivers.
Normally the contents of a layer’s surface is controlled by the integrated windowing system that shows the windows belonging to the layer on a configurable background. Each window has its own surface that is used by the windowing system to produce the composed image of overlapping windows. Alternatively applications, especially games, can get exclusive access to the layer. This way the application has direct control over the layer’s surface and it’s contents, no windows are shown.
layer object:screen,layer,window
drawing object:surface
Every layers has its own surface.
Then the concepts above told us how to use DFB:drawing on the surface ,management on the layer object.
A Surface is a reserved area in memory where pixel data for one image is stored in a
specific pixel format. A Surface can reside in video and/or system memory. It is possible to perform drawing operations on a surface or to Blit the surface to another.
In fullscreen mode, the visible screen is represented by the ”‘Primary Surface”’, so it is possible to perform graphics operations directly on the visible screen.Every Surface can optionally use double buffering, graphics operations are then first executed on a secondary buffer and become valid after Flip() is called. To prevent flickering it is advised to use Doublebuffering on the primary Surface in most cases.
Depending on the graphics hardware, there are one or more display Layers. A standard PC graphics card has only one Layer, but sophisticated devices like TV set top boxes may support two or more layers. Layers occupy different areas in video ram, and are usually combined by using alpha blending. This in done automatically by the display hardware. If the content of the lowest Layer changes, no repaint has to be done and the contents of the above layers remain untouched. Today, most PC graphics cards also support an additional layer (a ”‘video layer”’), which can be scaled and does color conversion from YUV to RGB. This layer cannot usually be blended and has to remain fully opaque. Video layers are supported by varios DirectFB graphics drivers.
Normally the contents of a layer’s surface is controlled by the integrated windowing system that shows the windows belonging to the layer on a configurable background. Each window has its own surface that is used by the windowing system to produce the composed image of overlapping windows. Alternatively applications, especially games, can get exclusive access to the layer. This way the application has direct control over the layer’s surface and it’s contents, no windows are shown.
- 1 IDirectFB (top-level) <--> N Screens
- 1 Screen <--> N Layers
- 1 Layer <--> 1 Primary Surface
- 1 Layer <--> N Windows
- 1 Window <--> 1 Window Surface
- 1 Surface <--> N Subsurfaces
layer object:screen,layer,window
drawing object:surface
Every layers has its own surface.
Then the concepts above told us how to use DFB:drawing on the surface ,management on the layer object.
DirectFB图形层与绘制详解
本文详细介绍了DirectFB环境中图形层与绘制的基本概念。解释了Surface作为像素数据存储区域的作用,以及如何通过不同的缓冲机制进行图形操作。此外还探讨了Layer的概念,包括其与屏幕、窗口之间的关系,并说明了在不同情况下如何使用这些组件来实现高效的图形显示。
9566

被折叠的 条评论
为什么被折叠?



