Mesa (master): egl: make pixmaps and pbuffers EGL_BUFFER_PRESERVED

Chia-I Wu olv at kemper.freedesktop.org
Fri Jul 29 01:25:02 UTC 2011


Module: Mesa
Branch: master
Commit: a5ab46909e9475da0eb8c814efb8e1859a6e6ed3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5ab46909e9475da0eb8c814efb8e1859a6e6ed3

Author: Chia-I Wu <olv at lunarg.com>
Date:   Thu Jul 28 13:33:55 2011 +0900

egl: make pixmaps and pbuffers EGL_BUFFER_PRESERVED

eglSwapBuffers is no-op to these surface types anyway.

---

 src/egl/main/eglsurface.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
index c9cfb01..3564ecd 100644
--- a/src/egl/main/eglsurface.c
+++ b/src/egl/main/eglsurface.c
@@ -269,11 +269,13 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
 {
    const char *func;
    EGLint renderBuffer = EGL_BACK_BUFFER;
+   EGLint swapBehavior = EGL_BUFFER_PRESERVED;
    EGLint err;
 
    switch (type) {
    case EGL_WINDOW_BIT:
       func = "eglCreateWindowSurface";
+      swapBehavior = EGL_BUFFER_DESTROYED;
       break;
    case EGL_PIXMAP_BIT:
       func = "eglCreatePixmapSurface";
@@ -315,7 +317,7 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
 
    surf->MipmapLevel = 0;
    surf->MultisampleResolve = EGL_MULTISAMPLE_RESOLVE_DEFAULT;
-   surf->SwapBehavior = EGL_BUFFER_DESTROYED;
+   surf->SwapBehavior = swapBehavior;
 
    surf->HorizontalResolution = EGL_UNKNOWN;
    surf->VerticalResolution = EGL_UNKNOWN;




More information about the mesa-commit mailing list