Beispiel #1
0
static struct pipe_screen *
gdi_screen_create(void)
{
   const char *default_driver;
   const char *driver;
   struct pipe_screen *screen = NULL;
   struct sw_winsys *winsys;

   winsys = gdi_create_sw_winsys();
   if(!winsys)
      goto no_winsys;

#ifdef HAVE_LLVMPIPE
   default_driver = "llvmpipe";
#else
   default_driver = "softpipe";
#endif

   driver = debug_get_option("GALLIUM_DRIVER", default_driver);

#ifdef HAVE_LLVMPIPE
   if (strcmp(driver, "llvmpipe") == 0) {
      screen = llvmpipe_create_screen( winsys );
   }
#else
   (void) driver;
#endif

   if (screen == NULL) {
      screen = softpipe_create_screen( winsys );
   } else {
      use_llvmpipe = TRUE;
   }

   if(!screen)
      goto no_screen;

   return screen;
   
no_screen:
   winsys->destroy(winsys);
no_winsys:
   return NULL;
}
Beispiel #2
0
static boolean
gdi_display_init_screen(struct native_display *ndpy)
{
   struct gdi_display *gdpy = gdi_display(ndpy);
   struct sw_winsys *winsys;

   winsys = gdi_create_sw_winsys();
   if (!winsys)
      return FALSE;

   gdpy->base.screen = gdpy->event_handler->new_sw_screen(&gdpy->base, winsys);
   if (!gdpy->base.screen) {
      if (winsys->destroy)
         winsys->destroy(winsys);
      return FALSE;
   }

   return TRUE;
}
static struct pipe_screen *
gdi_softpipe_screen_create(void)
{
   static struct sw_winsys *winsys;
   struct pipe_screen *screen;

   winsys = gdi_create_sw_winsys();
   if(!winsys)
      goto no_winsys;

   screen = softpipe_create_screen(winsys);
   if(!screen)
      goto no_screen;

   return screen;
   
no_screen:
   winsys->destroy(winsys);
no_winsys:
   return NULL;
}