mesa: Rename GLX_USE_TLS to USE_ELF_TLS.
[mesa.git] / src / egl / main / eglsurface.c
index ffef1b8f259e7a0f6327dfe61b84f9424e780878..22257391d5c3810871b6ea85b89ed49210eebfd3 100644 (file)
@@ -334,7 +334,8 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
  */
 EGLBoolean
 _eglInitSurface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
-                _EGLConfig *conf, const EGLint *attrib_list)
+                _EGLConfig *conf, const EGLint *attrib_list,
+                void *native_surface)
 {
    const char *func;
    EGLint renderBuffer = EGL_BACK_BUFFER;
@@ -421,6 +422,8 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
       surf->Height = MIN2(surf->Height, _EGL_MAX_PBUFFER_HEIGHT);
    }
 
+   surf->NativeSurface = native_surface;
+
    return EGL_TRUE;
 }
 
@@ -522,7 +525,12 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface,
       *value = surface->PostSubBufferSupportedNV;
       break;
    case EGL_BUFFER_AGE_EXT:
-      if (!disp->Extensions.EXT_buffer_age)
+      /* Both EXT_buffer_age and KHR_partial_update accept EGL_BUFFER_AGE_EXT.
+       * To be precise, the KHR one accepts EGL_BUFFER_AGE_KHR which is an
+       * alias with the same numeric value.
+       */
+      if (!disp->Extensions.EXT_buffer_age &&
+          !disp->Extensions.KHR_partial_update)
          return _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
 
       _EGLContext *ctx = _eglGetCurrentContext();