summaryrefslogtreecommitdiff
path: root/src/egl/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/eglscreen.c28
-rw-r--r--src/egl/main/eglscreen.h8
2 files changed, 28 insertions, 8 deletions
diff --git a/src/egl/main/eglscreen.c b/src/egl/main/eglscreen.c
index c4cc8bfe1a..d8ec5b5f73 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 64198446ae..5d1cff9284 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