This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Table of a driver's context 2D drawing functions
#include <draw.h> typedef struct disp_draw_contextfuncs { void (*draw_span) (...); void (*draw_span_list) (...); void (*draw_rect) (...); void (*blit) (...); void (*update_general) (...); void (*update_color) (...); void (*update_rop3) (...); void (*update_chroma) (...); void (*update_alpha) (...); } disp_draw_contextfuncs_t;
The disp_draw_contextfuncs_t structure is a table that your driver uses to define the context 2D drawing functions that it provides to the graphics framework. Your driver's devg_get_contextfuncs() entry point must fill in this structure.
All functions in the context drawing structure must obey the members of the disp_draw_context_t structure (e.g. the current foreground color, and the alpha- and chroma-related members); check the flags to see which members of the context structure need to be obeyed. Note also that the core functions update_pattern() and update_draw_surface() affect the operation of these (the context) functions.
The graphics framework calls this function to draw a single, horizontal line from (x1, y) to (x2, y). The prototype is:
void (*draw_span) (disp_draw_context_t *context, int x1, int x2, int y)
Fallback function: ffb_ctx_draw_span()
The graphics framework calls this function to draw count number of horizontal lines as given by the arrays x1, x2, and y. The prototype is:
void (*draw_span_list) ( disp_draw_context_t *context, int count, int *x1, int *x2, int *y)
Fallback function: ffb_ctx_draw_span_list()
The graphics framework calls this function to draw a rectangle from (x1, y1) to (x2, y2). The prototype is:
void (*draw_rect) (disp_draw_context_t *context, int x1, int y1, int x2, int y2)
Fallback function: ffb_ctx_draw_rect()
The graphics framework calls this function to perform a blit. The prototype is:
void (*blit) (disp_draw_context_t *context, disp_surface_t *src, disp_surface_t *dst, int sx, int sy, int dx, int dy, int width, int height)
This function should move the pixels from the source surface (src) specified by the rectangle beginning at (sx, sy) for the specified size (length and height) to the destination surface beginning with the rectangle at (dx, dy) for the same size.
The disp_surface_t structures pointed to by src and dst may actually describe the same 2D surface. In this case, the driver must be prepared to handle the case where the source and destination areas intersect (i.e. this function must handle overlapping blits). |
Fallback function: ffb_ctx_blit()
The graphics framework calls this function to notify the driver that potentially all the members of the context structure have changed. The prototype is:
void (*update_general) ( disp_draw_context_t *context)
Fallback function: ffb_ctx_update_general()
The graphics framework calls this function to notify the driver that the fg_color and bg_color members of the context structure could have changed. The prototype is:
void (*update_color) (disp_draw_context_t *context)
Fallback function: ffb_ctx_update_color()
The graphics framework calls this function to notify the driver that the rop3 member of the context structure could have changed. The prototype is:
void (*update_rop3) (disp_draw_context_t *context)
Fallback function: ffb_ctx_update_rop3()
The graphics framework calls this function to notify the driver that the chroma-related members of the context structure could have changed. This includes the flags, chroma_mode and chroma_color0 members. The prototype is:
void (*update_chroma) ( disp_draw_context_t *context)
Fallback function: ffb_ctx_update_chroma()
The graphics framework calls this function to notify the driver that the alpha-related members of the context structure could have changed. This includes the flags, alpha_mode, d_alpha, alpha_map_width, alpha_map_height, alpha_map_xoff, alpha_map_yoff, and alpha_map members. The prototype is:
void (*update_alpha) (disp_draw_context_t *context)
Fallback function: ffb_ctx_update_alpha()
Photon
disp_draw_context_t, disp_surface_t
"FFB library -- 2D software fallback routines" in the Libraries chapter