egl: Remove code blocks that are commented out.

They are either unit tests or to demonstrate how functions are supposed
to be used.  The unit test is outdated and it should be better to take a
look at any of the working drivers to see how a function is used.
This commit is contained in:
Chia-I Wu 2010-01-31 11:26:56 +08:00
parent 89e6eb5fbe
commit 996fd61442
4 changed files with 4 additions and 113 deletions

View file

@ -58,20 +58,6 @@ _EGLContext *
_eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
_EGLContext *share_list, const EGLint *attrib_list)
{
#if 0 /* example code */
_EGLContext *context;
context = (_EGLContext *) calloc(1, sizeof(_EGLContext));
if (!context)
return NULL;
if (!_eglInitContext(drv, context, conf, attrib_list)) {
free(context);
return NULL;
}
return context;
#endif
return NULL;
}

View file

@ -350,41 +350,3 @@ _eglQueryModeStringMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLMode *m)
{
return m->Name;
}
#if 0
static int
_eglRand(int max)
{
return rand() % max;
}
void
_eglTestModeModule(void)
{
EGLint count = 30;
_EGLMode *modes = (_EGLMode *) malloc(count * sizeof(_EGLMode));
_EGLMode **modeList = (_EGLMode **) malloc(count * sizeof(_EGLMode*));
EGLint i;
for (i = 0; i < count; i++) {
modes[i].Handle = _eglRand(20);
modes[i].Width = 512 + 256 * _eglRand(2);
modes[i].Height = 512 + 256 * _eglRand(2);
modes[i].RefreshRate = 50 + 5 * _eglRand(3);
modes[i].Interlaced = _eglRand(2);
modes[i].Optimal = _eglRand(4) == 0;
modeList[i] = modes + i;
}
/* sort array of pointers */
qsort(modeList, count, sizeof(_EGLMode *), compareModes);
for (i = 0; i < count; i++) {
_EGLMode *m = modeList[i];
printf("%2d: %3d %4d x %4d @ %3d opt %d int %d\n", i,
m->Handle, m->Width, m->Height, m->RefreshRate,
m->Optimal, m->Interlaced);
}
}
#endif

View file

@ -111,27 +111,12 @@ _eglGetScreensMESA(_EGLDriver *drv, _EGLDisplay *display, EGLScreenMESA *screens
/**
* Example function - drivers should do a proper implementation.
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreateScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
const EGLint *attrib_list)
{
#if 0 /* THIS IS JUST EXAMPLE CODE */
_EGLSurface *surf;
surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
if (!surf)
return NULL;
if (!_eglInitSurface(drv, surf, EGL_SCREEN_BIT_MESA,
conf, attrib_list)) {
free(surf);
return NULL;
}
return surf;
#endif
return NULL;
}

View file

@ -314,76 +314,34 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
/**
* Example function - drivers should do a proper implementation.
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
EGLNativeWindowType window, const EGLint *attrib_list)
{
#if 0 /* THIS IS JUST EXAMPLE CODE */
_EGLSurface *surf;
surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
if (!surf)
return NULL;
if (!_eglInitSurface(drv, surf, EGL_WINDOW_BIT, conf, attrib_list)) {
free(surf);
return NULL;
}
return surf;
#endif
return NULL;
}
/**
* Example function - drivers should do a proper implementation.
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
EGLNativePixmapType pixmap, const EGLint *attrib_list)
{
#if 0 /* THIS IS JUST EXAMPLE CODE */
_EGLSurface *surf;
surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
if (!surf)
return NULL;
if (!_eglInitSurface(drv, surf, EGL_PIXMAP_BIT, conf, attrib_list)) {
free(surf);
return NULL;
}
return surf;
#endif
return NULL;
}
/**
* Example function - drivers should do a proper implementation.
* Drivers should do a proper implementation.
*/
_EGLSurface *
_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
const EGLint *attrib_list)
{
#if 0 /* THIS IS JUST EXAMPLE CODE */
_EGLSurface *surf;
surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface));
if (!surf)
return NULL;
if (!_eglInitSurface(drv, surf, EGL_PBUFFER_BIT, conf, attrib_list)) {
free(surf);
return NULL;
}
return NULL;
#endif
return NULL;
}