Merge branch 'gallium-tex-surfaces' into gallium-0.1
[mesa.git] / src / egl / main / eglsurface.h
1 #ifndef EGLSURFACE_INCLUDED
2 #define EGLSURFACE_INCLUDED
3
4
5 #include "egltypedefs.h"
6
7
8 /**
9 * "Base" class for device driver surfaces.
10 */
11 struct _egl_surface
12 {
13 EGLSurface Handle; /* The public/opaque handle which names this object */
14 _EGLConfig *Config;
15
16 /* May need reference counting here */
17 EGLBoolean IsBound;
18 EGLBoolean DeletePending;
19
20 EGLint Type; /* one of EGL_WINDOW_BIT, EGL_PIXMAP_BIT or EGL_PBUFFER_BIT */
21 EGLint Width, Height;
22 EGLint TextureFormat, TextureTarget;
23 EGLint MipmapTexture, MipmapLevel;
24 EGLint SwapInterval;
25
26 /* If type == EGL_SCREEN_BIT: */
27 EGLint VisibleRefCount; /* number of screens I'm displayed on */
28
29 #ifdef EGL_VERSION_1_2
30 EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
31 EGLint HorizontalResolution, VerticalResolution;
32 EGLint AspectRatio;
33 EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
34 EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
35 EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
36 #endif /* EGL_VERSION_1_2 */
37 };
38
39
40 extern EGLBoolean
41 _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
42 _EGLSurface *surf, EGLint type, EGLConfig config,
43 const EGLint *attrib_list);
44
45
46 extern void
47 _eglSaveSurface(_EGLSurface *surf);
48
49
50 extern void
51 _eglRemoveSurface(_EGLSurface *surf);
52
53
54 extern EGLSurface
55 _eglGetSurfaceHandle(_EGLSurface *surface);
56
57
58 extern _EGLSurface *
59 _eglLookupSurface(EGLSurface surf);
60
61
62 extern _EGLSurface *
63 _eglGetCurrentSurface(EGLint readdraw);
64
65
66 extern EGLBoolean
67 _eglSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw);
68
69
70 extern EGLBoolean
71 _eglCopyBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
72
73
74 extern EGLBoolean
75 _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
76
77
78 extern EGLSurface
79 _eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
80
81
82 extern EGLSurface
83 _eglCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
84
85
86 extern EGLSurface
87 _eglCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
88
89
90 extern EGLBoolean
91 _eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface);
92
93
94 extern EGLBoolean
95 _eglSurfaceAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
96
97
98 extern EGLBoolean
99 _eglBindTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
100
101
102 extern EGLBoolean
103 _eglReleaseTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
104
105
106 extern EGLBoolean
107 _eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
108
109
110 #ifdef EGL_VERSION_1_2
111
112 extern EGLSurface
113 _eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
114 EGLenum buftype, EGLClientBuffer buffer,
115 EGLConfig config, const EGLint *attrib_list);
116
117 #endif /* EGL_VERSION_1_2 */
118
119
120
121 #endif /* EGLSURFACE_INCLUDED */