-
GDI/Driver Division of Labor
-
To understand graphics driver design, it is important to understand the
roles of GDI and the driver, and how they negotiate. GDI, with its
enhanced capabilities, can handle many operations that previously
required a graphics driver. GDI also has the responsibility of managing
data structures critical to graphics operations, such as surfaces,
although each graphics driver must have access to them.
-
(为了理解图形驱动的设计,就需要理解GDI和驱动的角色以及交互过程。GDI,拥有增强的能力集可以处理多种操作,这些操作以前需要驱动完成。
-
GDI Communication with the Driver
-
-
The driver exports only one function to GDI: DrvEnableDriver. All other driver-supported functions, including the DrvDisableDriver function, are exposed to GDI through an array of pointers. A GDI call to DrvEnableDriver initializes the driver and passes back the list of driver-supported graphics DDI functions. While there are some functions a driver must support, GDI will handle those operations not included in the function list received from the driver
-
(驱动只导出一个接口给GDI:DrvEnableDriver。其他所有驱动支持的函数,包括DrvDisableDriver函数,都是通过结构体制作传递给GDI。GDI调用DrvEnableDriver初始化驱动,并返回一个驱动支持的DDI函数列表。
-
%28v=vs.85%29.aspx
-
GDI User Objects
-
-
GDI maintains important internal data structures, but gives the driver access to the public fields of these structures by passing them down as user objects. User objects are intermediate data structures that provide an interface between GDI data structures and the drivers that need access to the information within these structures. The driver can pass the pointer to a user object back to GDI to query for information or to ask for various services. User objects with public fields provide the following advantages:
-
(GDI管理重要的内部数据结构,以user objects的形式将public字段传递给driver。user objects用于GDI和驱动交互信息。驱动通过user objects向GDI查询信息或获取服务。)
-
-
They eliminate problems associated with direct access to internal GDI data structures.
-
-
They provide a place to hold GDI data for the driver. For example, a PATHOBJ structure can hold all the extra data required to enumerate a complex object like a path.
-
-
The following user objects are available:
-
Object Description
-
-
BRUSHOBJ
-
-
-
Defines the brush objects for graphic functions that output lines, text, or fills. Drivers can call BRUSHOBJ services to realize brushes or to find realizations previously cached by GDI.
-
-
CLIPOBJ
-
-
-
Provides the driver with access to a clip region for drawing or filling. This region can be enumerated as a series of rectangles.
-
-
FLOATOBJ
-
-
-
Allows graphics drivers to emulate floating-point operations. Floating-point operations are disabled for all other kernel-mode drivers.
-
-
FONTOBJ
-
-
-
Gives the driver access to information about a particular instance (or realization) of a font.
-
-
PALOBJ
-
-
-
A structure containing RGB palette colors; accessible via the PALOBJ_cGetColors and DrvSetPalette functions. The PALOBJ structure contains no public members.
-
-
PATHOBJ
-
-
-
Defines a path that specifies what is to be drawn (lines or Bezier curves). A PATHOBJ structure is passed to the driver to describe a set of lines and Bezier curves that are to be stroked or filled.
-
-
STROBJ
-
-
-
Enumerates for the driver a list of glyph handles and positions that describe how a text string is to be drawn.
-
-
SURFOBJ
-
-
-
Identifies a surface, which can be a GDI bitmap, a device-dependent bitmap, or a device-managed surface. See Surface Types for more information.
-
-
XFORMOBJ
-
-
-
Describes an arbitrary linear two-dimensional transform, such as for geometric wide lines.
-
-
XLATEOBJ
-
-
-
Defines the translations needed to convert pixels from the source surface format to the destination surface format.
-
GDI Service Routines
-
-
GDI exports many service routines, whose names have the form EngXxx. The driver dynamically links to win32k.sys to directly access these routines. GDI service routines include surface management, rendering simulations, and path, palette, font, and text services. These services are discussed in detail in GDI Support Services.
-
(GDI导出服务接口,已EngXxx命名。驱动可以动态链接到win32k.sys去直接获得该接口。GDI服务包括表面管理,渲染模拟,以及路径,画刷,字体,文字服务。
阅读(854) | 评论(0) | 转发(0) |