diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-12-10 17:53:07 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-12-10 17:53:07 +0000 |
commit | b04dd5c58763039a564c50b5e3c0bbc9755e7f72 (patch) | |
tree | a0774f43a6e62b969fd4097873cc467bc55f2032 /src/egl | |
parent | ad6f8eba00359fcb7abff8105dcb7a9dd2f32fec (diff) | |
download | external_mesa3d-b04dd5c58763039a564c50b5e3c0bbc9755e7f72.zip external_mesa3d-b04dd5c58763039a564c50b5e3c0bbc9755e7f72.tar.gz external_mesa3d-b04dd5c58763039a564c50b5e3c0bbc9755e7f72.tar.bz2 |
Added EGL_SCREEN_POSITION_GRANULARITY_MESA query.
Rename eglShowSurfaceMESA to eglShowScreenSurfaceMESA.
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/main/eglscreen.c | 28 | ||||
-rw-r--r-- | src/egl/main/eglscreen.h | 8 |
2 files changed, 28 insertions, 8 deletions
diff --git a/src/egl/main/eglscreen.c b/src/egl/main/eglscreen.c index c4cc8bf..d8ec5b5 100644 --- a/src/egl/main/eglscreen.c +++ b/src/egl/main/eglscreen.c @@ -29,8 +29,9 @@ void _eglInitScreen(_EGLScreen *screen) { - /* just init to zero for now */ memset(screen, 0, sizeof(_EGLScreen)); + screen->StepX = 1; + screen->StepY = 1; } @@ -141,8 +142,9 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, * this with code that _really_ shows the surface. */ EGLBoolean -_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, - EGLSurface surface, EGLModeMESA m) +_eglShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, + EGLScreenMESA screen, EGLSurface surface, + EGLModeMESA m) { _EGLScreen *scrn = _eglLookupScreen(dpy, screen); _EGLMode *mode = _eglLookupMode(dpy, m); @@ -158,7 +160,8 @@ _eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, if (surface == EGL_NO_SURFACE) { scrn->CurrentSurface = NULL; - } else { + } + else { _EGLSurface *surf = _eglLookupSurface(surface); if (!surf || surf->Type != EGL_SCREEN_BIT_MESA) { _eglError(EGL_BAD_SURFACE, "eglShowSurfaceMESA"); @@ -269,6 +272,10 @@ _eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, value[0] = scrn->OriginX; value[1] = scrn->OriginY; break; + case EGL_SCREEN_POSITION_GRANULARITY_MESA: + value[0] = scrn->StepX; + value[1] = scrn->StepY; + break; default: _eglError(EGL_BAD_ATTRIBUTE, "eglQueryScreenMESA"); return EGL_FALSE; @@ -278,10 +285,21 @@ _eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, } +/** + * Delete the modes associated with given screen. + */ void _eglDestroyScreenModes(_EGLScreen *scrn) { - free(scrn->Modes); + EGLint i; + for (i = 0; i < scrn->NumModes; i++) { + if (scrn->Modes[i].Name) + free((char *) scrn->Modes[i].Name); /* cast away const */ + } + if (scrn->Modes) + free(scrn->Modes); + scrn->Modes = NULL; + scrn->NumModes = 0; } diff --git a/src/egl/main/eglscreen.h b/src/egl/main/eglscreen.h index 6419844..5d1cff9 100644 --- a/src/egl/main/eglscreen.h +++ b/src/egl/main/eglscreen.h @@ -22,10 +22,12 @@ struct _egl_screen _EGLMode *CurrentMode; _EGLSurface *CurrentSurface; - EGLint OriginX, OriginY; + + EGLint OriginX, OriginY; /**< Origin of scan-out region w.r.t. surface */ + EGLint StepX, StepY; /**< Screen position/origin granularity */ EGLint NumModes; - _EGLMode *Modes; /* array [NumModes] */ + _EGLMode *Modes; /**< array [NumModes] */ }; @@ -50,7 +52,7 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, c extern EGLBoolean -_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); +_eglShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); extern EGLBoolean |