st/dri: minor cosmetic for screen
authorGeorge Sapountzis <gsapountzis@gmail.com>
Thu, 25 Mar 2010 15:01:52 +0000 (17:01 +0200)
committerGeorge Sapountzis <gsapountzis@gmail.com>
Thu, 25 Mar 2010 15:01:52 +0000 (17:01 +0200)
- put extensions above init_screen
- split out destroy_option_cache

src/gallium/state_trackers/dri/dri_screen.c

index 733d71f99595e45657270573d45ab78348632e9c..cb650122668bddc997c8c2ef9f98280b0c6964f3 100644 (file)
@@ -51,7 +51,7 @@ PUBLIC const char __driConfigOptions[] =
    DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
    DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
    DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY
-    /*DRI_CONF_FORCE_S3TC_ENABLE(false) */
+/* DRI_CONF_FORCE_S3TC_ENABLE(false) */
    DRI_CONF_ALLOW_LARGE_TEXTURES(1)
    DRI_CONF_SECTION_END DRI_CONF_END;
 
@@ -87,17 +87,6 @@ static const __DRI2flushExtension dri2FlushExtension = {
     dri2_invalidate_drawable,
 };
 
-   static const __DRIextension *dri_screen_extensions[] = {
-      &driReadDrawableExtension,
-      &driCopySubBufferExtension.base,
-      &driSwapControlExtension.base,
-      &driFrameTrackingExtension.base,
-      &driMediaStreamCounterExtension.base,
-      &dri2TexBufferExtension.base,
-      &dri2FlushExtension.base,
-      NULL
-   };
-
 const __DRIconfig **
 dri_fill_in_modes(struct dri_screen *screen,
                  unsigned pixel_bits)
@@ -313,11 +302,24 @@ dri_get_swap_info(__DRIdrawable * dPriv, __DRIswapInfo * sInfo)
       return 0;
 }
 
+static void
+dri_destroy_option_cache(struct dri_screen * screen)
+{
+   int i;
+
+   for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
+      FREE(screen->optionCache.info[i].name);
+      FREE(screen->optionCache.info[i].ranges);
+   }
+
+   FREE(screen->optionCache.info);
+   FREE(screen->optionCache.values);
+}
+
 static void
 dri_destroy_screen(__DRIscreen * sPriv)
 {
    struct dri_screen *screen = dri_screen(sPriv);
-   int i;
 
    if (screen->dri1_pipe)
       screen->dri1_pipe->destroy(screen->dri1_pipe);
@@ -327,19 +329,24 @@ dri_destroy_screen(__DRIscreen * sPriv)
    if (screen->pipe_screen)
       screen->pipe_screen->destroy(screen->pipe_screen);
 
-   for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
-      FREE(screen->optionCache.info[i].name);
-      FREE(screen->optionCache.info[i].ranges);
-   }
-
-   FREE(screen->optionCache.info);
-   FREE(screen->optionCache.values);
+   dri_destroy_option_cache(screen);
 
    FREE(screen);
    sPriv->private = NULL;
    sPriv->extensions = NULL;
 }
 
+static const __DRIextension *dri_screen_extensions[] = {
+   &driReadDrawableExtension,
+   &driCopySubBufferExtension.base,
+   &driSwapControlExtension.base,
+   &driFrameTrackingExtension.base,
+   &driMediaStreamCounterExtension.base,
+   &dri2TexBufferExtension.base,
+   &dri2FlushExtension.base,
+   NULL
+};
+
 /**
  * This is the driver specific part of the createNewScreen entry point.
  *