summaryrefslogtreecommitdiff
path: root/EGL/yagl_native_drawable.h
blob: f8d7dfce9984b88627a19831493c95146fbb077c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _YAGL_NATIVE_DRAWABLE_H_
#define _YAGL_NATIVE_DRAWABLE_H_

#include "yagl_export.h"
#include "yagl_native_types.h"

struct yagl_native_image;

struct yagl_native_drawable
{
    struct yagl_native_display *dpy;

    yagl_os_drawable os_drawable;

    /*
     * This gets incremented in drawable invalidate handler.
     */
    uint32_t stamp;

    uint32_t (*get_buffer)(struct yagl_native_drawable */*drawable*/,
                           yagl_native_attachment /*attachment*/);

    void (*swap_buffers)(struct yagl_native_drawable */*drawable*/);

    /*
     * 'width' and 'height' are here only because of DRI2.
     * DRI2 requires width and height to be passed to DRI2CopyRegion.
     */
    void (*wait)(struct yagl_native_drawable */*drawable*/,
                 uint32_t /*width*/,
                 uint32_t /*height*/);

    void (*copy_to_pixmap)(struct yagl_native_drawable */*drawable*/,
                           yagl_os_pixmap /*os_pixmap*/,
                           uint32_t /*from_x*/,
                           uint32_t /*from_y*/,
                           uint32_t /*to_x*/,
                           uint32_t /*to_y*/,
                           uint32_t /*width*/,
                           uint32_t /*height*/);

    void (*set_swap_interval)(struct yagl_native_drawable */*drawable*/,
                              int /*interval*/);

    void (*get_geometry)(struct yagl_native_drawable */*drawable*/,
                         uint32_t */*width*/,
                         uint32_t */*height*/,
                         uint32_t */*depth*/);

    struct yagl_native_image *(*get_image)(struct yagl_native_drawable */*drawable*/,
                                           uint32_t /*width*/,
                                           uint32_t /*height*/);

    void (*destroy)(struct yagl_native_drawable */*drawable*/);
};

void yagl_native_drawable_init(struct yagl_native_drawable *drawable,
                               struct yagl_native_display *dpy,
                               yagl_os_drawable os_drawable);

void yagl_native_drawable_cleanup(struct yagl_native_drawable *drawable);

#endif