static void paint_image(data_t *d, struct igt_fb *fb, uint16_t w, uint16_t h) { cairo_t *cr; cr = igt_get_cairo_ctx(d->drm_fd, fb); igt_paint_image(cr, FILE_NAME, 0, 0, w, h); cairo_destroy(cr); }
static void paint_image(cairo_t *cr, const char *file) { int img_x, img_y, img_w, img_h; img_y = height * (0.10 ); img_h = height * 0.08 * 4; img_w = img_h; img_x = (width / 2) - (img_w / 2); igt_paint_image(cr, file, img_x, img_y, img_h, img_w); }
/** * igt_create_stereo_fb: * @drm_fd: open i915 drm file descriptor * @mode: A stereo 3D mode. * @format: drm fourcc pixel format code * @tiling: tiling layout of the framebuffer * * Create a framebuffer for use with the stereo 3D mode specified by @mode. * * Returns: * The kms id of the created framebuffer on success or a negative error code on * failure. */ unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode, uint32_t format, uint64_t tiling) { struct stereo_fb_layout layout; cairo_t *cr; uint32_t fb_id; struct igt_fb fb; stereo_fb_layout_from_mode(&layout, mode); fb_id = igt_create_fb(drm_fd, layout.fb_width, layout.fb_height, format, tiling, &fb); cr = igt_get_cairo_ctx(drm_fd, &fb); igt_paint_image(cr, "1080p-left.png", layout.left.x, layout.left.y, layout.left.width, layout.left.height); igt_paint_image(cr, "1080p-right.png", layout.right.x, layout.right.y, layout.right.width, layout.right.height); cairo_destroy(cr); return fb_id; }