struct wl_display *display;
struct wl_visual *visual;
int fd;
- cairo_drm_context_t *ctx;
+ cairo_drm_device_t *device;
cairo_surface_t *s;
struct timespec ts;
GMainLoop *loop;
srandom(ts.tv_nsec);
flower.offset = random();
- ctx = cairo_drm_context_get_for_fd(fd);
- s = cairo_drm_surface_create(ctx, CAIRO_CONTENT_COLOR_ALPHA,
+ device = cairo_drm_device_get_for_fd(fd);
+ s = cairo_drm_surface_create(device,
+ CAIRO_CONTENT_COLOR_ALPHA,
flower.width, flower.height);
draw_stuff(s, flower.width, flower.height);
struct wl_output *output;
struct wl_input_device *input_device;
struct rectangle screen_allocation;
- cairo_drm_context_t *ctx;
+ cairo_drm_device_t *device;
int fd;
};
int width, height;
window->cairo_surface =
- cairo_drm_surface_create(window->display->ctx,
+ cairo_drm_surface_create(window->display->device,
CAIRO_CONTENT_COLOR_ALPHA,
window->allocation.width,
window->allocation.height);
struct wl_visual *visual;
window->cairo_surface =
- cairo_drm_surface_create(window->display->ctx,
+ cairo_drm_surface_create(window->display->device,
CAIRO_CONTENT_COLOR_ALPHA,
window->allocation.width,
window->allocation.height);
window_create_surface(struct window *window,
struct rectangle *rectangle)
{
- return cairo_drm_surface_create(window->display->ctx,
+ return cairo_drm_surface_create(window->display->device,
CAIRO_CONTENT_COLOR_ALPHA,
rectangle->width,
rectangle->height);
return NULL;
d->display = display;
- d->ctx = cairo_drm_context_get_for_fd(fd);
- if (d->ctx == NULL) {
- fprintf(stderr, "failed to get cairo drm context\n");
+ d->device = cairo_drm_device_get_for_fd(fd);
+ if (d->device == NULL) {
+ fprintf(stderr, "failed to get cairo drm device\n");
return NULL;
}