Merge commit 'origin/gallium-master-merge'
[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 EGLBoolean BoundToTexture;
20
21 EGLint Type; /* one of EGL_WINDOW_BIT, EGL_PIXMAP_BIT or EGL_PBUFFER_BIT */
22 EGLint Width, Height;
23 EGLint TextureFormat, TextureTarget;
24 EGLint MipmapTexture, MipmapLevel;
25 EGLint SwapInterval;
26
27 /* If type == EGL_SCREEN_BIT: */
28 EGLint VisibleRefCount; /* number of screens I'm displayed on */
29
30 #ifdef EGL_VERSION_1_2
31 EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
32 EGLint HorizontalResolution, VerticalResolution;
33 EGLint AspectRatio;
34 EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
35 EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
36 EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
37 #endif /* EGL_VERSION_1_2 */
38 };
39
40
41 extern EGLBoolean
42 _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
43 _EGLSurface *surf, EGLint type, EGLConfig config,
44 const EGLint *attrib_list);
45
46
47 extern void
48 _eglSaveSurface(_EGLSurface *surf);
49
50
51 extern void
52 _eglRemoveSurface(_EGLSurface *surf);
53
54
55 extern EGLSurface
56 _eglGetSurfaceHandle(_EGLSurface *surface);
57
58
59 extern _EGLSurface *
60 _eglLookupSurface(EGLSurface surf);
61
62
63 extern _EGLSurface *
64 _eglGetCurrentSurface(EGLint readdraw);
65
66
67 extern EGLBoolean
68 _eglSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw);
69
70
71 extern EGLBoolean
72 _eglCopyBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
73
74
75 extern EGLBoolean
76 _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
77
78
79 extern EGLSurface
80 _eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
81
82
83 extern EGLSurface
84 _eglCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
85
86
87 extern EGLSurface
88 _eglCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
89
90
91 extern EGLBoolean
92 _eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface);
93
94
95 extern EGLBoolean
96 _eglSurfaceAttrib(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
97
98
99 extern EGLBoolean
100 _eglBindTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
101
102
103 extern EGLBoolean
104 _eglReleaseTexImage(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface, EGLint buffer);
105
106
107 extern EGLBoolean
108 _eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
109
110
111 #ifdef EGL_VERSION_1_2
112
113 extern EGLSurface
114 _eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
115 EGLenum buftype, EGLClientBuffer buffer,
116 EGLConfig config, const EGLint *attrib_list);
117
118 #endif /* EGL_VERSION_1_2 */
119
120
121
122 #endif /* EGLSURFACE_INCLUDED */