Top |
const char * | igt_draw_get_method_name () |
bool | igt_draw_supports_method () |
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
,struct buf_ops *bops
,uint32_t ctx
,uint32_t buf_handle
,uint32_t buf_size
,uint32_t buf_stride
,int buf_width
,int buf_height
,uint32_t tiling
,enum igt_draw_method method
,int rect_x
,int rect_y
,int rect_w
,int rect_h
,uint64_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 |
|
bops |
buf ops, only required for IGT_DRAW_BLT and IGT_DRAW_RENDER |
|
ctx |
the context, can be 0 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 |
|
buf_width |
the width of the buffer |
|
buf_height |
the height of the buffer |
|
tiling |
the tiling 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
,struct buf_ops *bops
,uint32_t ctx
,struct igt_fb *fb
,enum igt_draw_method method
,int rect_x
,int rect_y
,int rect_w
,int rect_h
,uint64_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 |
|
bops |
buf ops, only required for IGT_DRAW_BLT and IGT_DRAW_RENDER |
|
ctx |
context, can be 0 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 |
void igt_draw_fill_fb (int fd
,struct igt_fb *fb
,uint64_t color
);
This function just paints an igt_fb using the provided color.