1 #ifndef EGLSURFACE_INCLUDED
2 #define EGLSURFACE_INCLUDED
5 #include "egltypedefs.h"
9 * "Base" class for device driver surfaces.
13 /* Managed by EGLDisplay for linking */
18 /* The bound status of the surface */
20 EGLBoolean BoundToTexture
;
24 EGLint Type
; /* one of EGL_WINDOW_BIT, EGL_PIXMAP_BIT or EGL_PBUFFER_BIT */
26 EGLint TextureFormat
, TextureTarget
;
27 EGLint MipmapTexture
, MipmapLevel
;
30 /* If type == EGL_SCREEN_BIT: */
31 EGLint VisibleRefCount
; /* number of screens I'm displayed on */
33 #ifdef EGL_VERSION_1_2
34 EGLint SwapBehavior
; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
35 EGLint HorizontalResolution
, VerticalResolution
;
37 EGLint RenderBuffer
; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
38 EGLint AlphaFormat
; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
39 EGLint Colorspace
; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
40 #endif /* EGL_VERSION_1_2 */
45 _eglInitSurface(_EGLDriver
*drv
, _EGLSurface
*surf
, EGLint type
,
46 _EGLConfig
*config
, const EGLint
*attrib_list
);
50 _eglSwapBuffers(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surf
);
54 _eglCopyBuffers(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surf
, NativePixmapType target
);
58 _eglQuerySurface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surf
, EGLint attribute
, EGLint
*value
);
62 _eglCreateWindowSurface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, NativeWindowType window
, const EGLint
*attrib_list
);
66 _eglCreatePixmapSurface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, NativePixmapType pixmap
, const EGLint
*attrib_list
);
70 _eglCreatePbufferSurface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLConfig
*conf
, const EGLint
*attrib_list
);
74 _eglDestroySurface(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surf
);
78 _eglSurfaceAttrib(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surf
, EGLint attribute
, EGLint value
);
82 _eglBindTexImage(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surf
, EGLint buffer
);
86 _eglReleaseTexImage(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSurface
*surf
, EGLint buffer
);
90 _eglSwapInterval(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLint interval
);
93 #ifdef EGL_VERSION_1_2
96 _eglCreatePbufferFromClientBuffer(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
97 EGLenum buftype
, EGLClientBuffer buffer
,
98 _EGLConfig
*conf
, const EGLint
*attrib_list
);
100 #endif /* EGL_VERSION_1_2 */
104 * Return true if the surface is bound to a thread.
105 * A surface bound to a texutre is not considered bound by
108 static INLINE EGLBoolean
109 _eglIsSurfaceBound(_EGLSurface
*surf
)
111 return (surf
->Binding
!= NULL
);
115 #endif /* EGLSURFACE_INCLUDED */