Top |
const char * | igt_draw_get_method_name () |
void | igt_draw_rect () |
void | igt_draw_rect_fb () |
void | igt_draw_fill_fb () |
This library contains some functions for drawing rectangles on buffers using the many different drawing methods we have. It also contains some wrappers that make the process easier if you have the abstract objects in hand.
This library only claims support for some pixel formats, but adding support for more formats should be faily easy now that we support both 16bpp and 32bpp. If you need a new pixel format, make sure you update both this file and tests/kms_draw_crc.c.
const char *
igt_draw_get_method_name (enum igt_draw_method method
);
Simple function to transform the enum into a string. Useful when naming subtests and printing debug messages.
void igt_draw_rect (int fd
,drm_intel_bufmgr *bufmgr
,drm_intel_context *context
,uint32_t buf_handle
,uint32_t buf_size
,uint32_t buf_stride
,enum igt_draw_method method
,int rect_x
,int rect_y
,int rect_w
,int rect_h
,uint32_t color
,int bpp
);
This function draws a colored rectangle on the destination buffer, allowing you to specify the method used to draw the rectangle.
fd |
the DRM file descriptor |
|
bufmgr |
the libdrm bufmgr, only required for IGT_DRAW_BLT and IGT_DRAW_RENDER |
|
context |
the context, can be NULL if you don't want to think about it |
|
buf_handle |
the handle of the buffer where you're going to draw to |
|
buf_size |
the size of the buffer |
|
buf_stride |
the stride of the buffer |
|
method |
method you're going to use to write to the buffer |
|
rect_x |
horizontal position on the buffer where your rectangle starts |
|
rect_y |
vertical position on the buffer where your rectangle starts |
|
rect_w |
width of the rectangle |
|
rect_h |
height of the rectangle |
|
color |
color of the rectangle |
|
bpp |
bits per pixel |
void igt_draw_rect_fb (int fd
,drm_intel_bufmgr *bufmgr
,drm_intel_context *context
,struct igt_fb *fb
,enum igt_draw_method method
,int rect_x
,int rect_y
,int rect_w
,int rect_h
,uint32_t color
);
This is exactly the same as igt_draw_rect, but you can pass an igt_fb instead of manually providing its details. See igt_draw_rect.
fd |
the DRM file descriptor |
|
bufmgr |
the libdrm bufmgr, only required for IGT_DRAW_BLT and IGT_DRAW_RENDER |
|
context |
the context, can be NULL if you don't want to think about it |
|
fb |
framebuffer |
|
method |
method you're going to use to write to the buffer |
|
rect_x |
horizontal position on the buffer where your rectangle starts |
|
rect_y |
vertical position on the buffer where your rectangle starts |
|
rect_w |
width of the rectangle |
|
rect_h |
height of the rectangle |
|
color |
color of the rectangle |