egl: Remove code blocks that are commented out.
authorChia-I Wu <olvaffe@gmail.com>
Sun, 31 Jan 2010 03:26:56 +0000 (11:26 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sun, 31 Jan 2010 03:31:58 +0000 (11:31 +0800)
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.

src/egl/main/eglcontext.c
src/egl/main/eglmode.c
src/egl/main/eglscreen.c
src/egl/main/eglsurface.c

index 37c4b25b68a96ea431df6a2542ab1e030bff1ef4..d0c6b1b64c914e1c9136669324ab1f501b27dfee 100644 (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;
 }
 
index 1e26ea83f5fab32dac3680c07d48bb5c5041e61a..66446c0495d2fe55ab654a25636c9994867528e3 100644 (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
index 1079a1cbe610f642838a98273595e53908f79595..97a405a4b4b3c8895a53825005db152250cdb079 100644 (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;
 }
 
index 8f87239fe209971b734ea5f24668fe396bb0971b..aa2da9dd0953b9a2525ef0469ae6502007074654 100644 (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;
 }