egl: Implement EGL_NOK_texture_from_pixmap
[mesa.git] / src / egl / main / eglsurface.h
index eee66f6d861320101326aa8e6194331bc0261b8d..8f520dcdf650f606d0cdf54d0879be2772df0159 100644 (file)
@@ -20,30 +20,34 @@ struct _egl_surface
    _EGLConfig *Config;
 
    EGLint Type; /* one of EGL_WINDOW_BIT, EGL_PIXMAP_BIT or EGL_PBUFFER_BIT */
+
+   /* attributes set by attribute list */
    EGLint Width, Height;
-   EGLint TextureFormat, TextureTarget;
-   EGLint MipmapTexture, MipmapLevel;
+   EGLenum TextureFormat;
+   EGLenum TextureTarget;
+   EGLBoolean MipmapTexture;
+   EGLBoolean LargestPbuffer;
+   EGLenum RenderBuffer;
+   EGLenum VGAlphaFormat;
+   EGLenum VGColorspace;
+
+   /* attributes set by eglSurfaceAttrib */
+   EGLint MipmapLevel;
+   EGLenum MultisampleResolve;
+   EGLenum SwapBehavior;
+
+   EGLint HorizontalResolution, VerticalResolution;
+   EGLint AspectRatio;
+
    EGLint SwapInterval;
 
    /* True if the surface is bound to an OpenGL ES texture */
    EGLBoolean BoundToTexture;
-
-   /* If type == EGL_SCREEN_BIT: */
-   EGLint VisibleRefCount; /* number of screens I'm displayed on */
-
-#ifdef EGL_VERSION_1_2
-   EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
-   EGLint HorizontalResolution, VerticalResolution;
-   EGLint AspectRatio;
-   EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
-   EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
-   EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
-#endif /* EGL_VERSION_1_2 */
 };
 
 
 PUBLIC EGLBoolean
-_eglInitSurface(_EGLDriver *drv, _EGLSurface *surf, EGLint type,
+_eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
                 _EGLConfig *config, const EGLint *attrib_list);
 
 
@@ -79,7 +83,7 @@ extern EGLBoolean
 _eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint attribute, EGLint value);
 
 
-extern EGLBoolean
+PUBLIC extern EGLBoolean
 _eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint buffer);
 
 
@@ -103,6 +107,9 @@ _eglCreatePbufferFromClientBuffer(_EGLDriver *drv, _EGLDisplay *dpy,
 
 /**
  * Return true if there is a context bound to the surface.
+ *
+ * The binding is considered a reference to the surface.  Drivers should not
+ * destroy a surface when it is bound.
  */
 static INLINE EGLBoolean
 _eglIsSurfaceBound(_EGLSurface *surf)
@@ -162,6 +169,9 @@ _eglGetSurfaceHandle(_EGLSurface *surf)
 
 /**
  * Return true if the surface is linked to a display.
+ *
+ * The link is considered a reference to the surface (the display is owning the
+ * surface).  Drivers should not destroy a surface when it is linked.
  */
 static INLINE EGLBoolean
 _eglIsSurfaceLinked(_EGLSurface *surf)